Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on SQL comments on explicit BEGIN #13

Closed
hlinnaka opened this issue May 7, 2024 · 1 comment
Closed

Crash on SQL comments on explicit BEGIN #13

hlinnaka opened this issue May 7, 2024 · 1 comment

Comments

@hlinnaka
Copy link
Contributor

hlinnaka commented May 7, 2024

postgres=# /*traceparent='00-00000000000000000000000000000128-0000000000000128-01'*/begin; insert into foo values(1); commit;
BEGIN
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
TRAP: failed Assert("!traceid_zero(span->trace_id)"), File: "src/pg_tracing_span.c", Line: 127, PID: 556201
postgres: heikki postgres ::1(42026) INSERT(ExceptionalCondition+0xaf)[0x55900b67551f]
/home/heikki/pgsql.master/lib/pg_tracing.so(+0xc978)[0x7f045eeb0978]
/home/heikki/pgsql.master/lib/pg_tracing.so(+0x7527)[0x7f045eeab527]
/home/heikki/pgsql.master/lib/pg_tracing.so(+0x45f2)[0x7f045eea85f2]
postgres: heikki postgres ::1(42026) INSERT(planner+0x3d)[0x55900b2d09ad]
postgres: heikki postgres ::1(42026) INSERT(pg_plan_query+0x94)[0x55900b44d424]
postgres: heikki postgres ::1(42026) INSERT(pg_plan_queries+0x139)[0x55900b44d5d9]
postgres: heikki postgres ::1(42026) INSERT(+0x71b575)[0x55900b450575]
postgres: heikki postgres ::1(42026) INSERT(PostgresMain+0x922)[0x55900b44f992]
postgres: heikki postgres ::1(42026) INSERT(+0x713063)[0x55900b448063]
postgres: heikki postgres ::1(42026) INSERT(postmaster_child_launch+0xe7)[0x55900b348867]
postgres: heikki postgres ::1(42026) INSERT(+0x61a6fa)[0x55900b34f6fa]
postgres: heikki postgres ::1(42026) INSERT(+0x617b99)[0x55900b34cb99]
postgres: heikki postgres ::1(42026) INSERT(PostmasterMain+0x18e7)[0x55900b34bd87]
postgres: heikki postgres ::1(42026) INSERT(+0x4bd7dd)[0x55900b1f27dd]
/lib/x86_64-linux-gnu/libc.so.6(+0x2724a)[0x7f045e24824a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7f045e248305]
postgres: heikki postgres ::1(42026) INSERT(_start+0x21)[0x55900ae0fb21]
2024-05-07 14:14:26.263 EEST [556193] LOG:  server process (PID 556201) was terminated by signal 6: Aborted
2024-05-07 14:14:26.263 EEST [556193] DETAIL:  Failed process was running: insert into foo values(1);
2024-05-07 14:14:26.263 EEST [556193] LOG:  terminating any other active server processes
2024-05-07 14:14:26.264 EEST [556193] LOG:  all server processes terminated; reinitializing
bonnefoa added a commit that referenced this issue Jun 3, 2024
If the start of a transaction has a trace_context, we want to reuse it
for the whole transaction. Replace latest_trace_id by
tx_start_traceparent which will only be set at the start of a new
transaction and update it with both randomly generated trace_id and
extracted_trace_id from SQLComments.

If a statement has its own trace_context, we give it priority.

This fixes the issue #13 where latest_trace_id was not updated when
trace_id was provided by SQLComment, leading to creating spans with a 0
trace_id.
bonnefoa added a commit that referenced this issue Jun 3, 2024
If the start of a transaction has a trace_context, we want to reuse it
for the whole transaction. Replace latest_trace_id by
tx_start_traceparent which will only be set at the start of a new
transaction and update it with both randomly generated trace_id and
extracted_trace_id from SQLComments.

If a statement has its own trace_context, we give it priority.

This fixes the issue #13 where latest_trace_id was not updated when
trace_id was provided by SQLComment, leading to creating spans with a 0
trace_id.
@bonnefoa
Copy link
Collaborator

bonnefoa commented Jun 5, 2024

Should be fixed with #16

@bonnefoa bonnefoa closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants