Skip to content

Commit

Permalink
Use parent planstate in case of a tie
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnefoa committed Apr 16, 2024
1 parent 471f9bc commit e709908
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pg_tracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ begin_top_span(pgTracingTraceContext * trace_context, Span * top_span,
* Both planstate and previous top span can be the parent for the new
* top span, we use the most recent as a parent
*/
if (parent_traced_planstate != NULL && parent_traced_planstate->node_start > latest_top_span->start)
if (parent_traced_planstate != NULL && parent_traced_planstate->node_start >= latest_top_span->start)
parent_id = parent_traced_planstate->span_id;
else
parent_id = latest_top_span->span_id;
Expand Down

0 comments on commit e709908

Please sign in to comment.