From 9e8b2501d77b755c0a3b0e94af1850172c78bd2e Mon Sep 17 00:00:00 2001 From: Anthonin Bonnefoy Date: Fri, 5 Apr 2024 10:11:13 +0200 Subject: [PATCH] Use parent planstate in case of a tie --- src/pg_tracing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg_tracing.c b/src/pg_tracing.c index d904817..7b42e91 100644 --- a/src/pg_tracing.c +++ b/src/pg_tracing.c @@ -1307,7 +1307,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;