Skip to content

Commit

Permalink
Merge #66089
Browse files Browse the repository at this point in the history
66089: cli: order span payloads by start_time for readability r=knz a=adityamaru

During job execution, there can be several root spans on a node.
Egs: resumer, processor

While the recordings within a span are sorted by start time,
since the root spans are stored in an unordered map, the recordings
across root spans might not be sorted by start_time. When viewing
the output files for a job this results in the processor span printing
its payload before the job payload which is not intuitive.

We might change how we display recordings in the future, but for the
time being this fix makes the "ordering" of events deterministic.

Informs: #64992

Release note: None

Co-authored-by: Aditya Maru <[email protected]>
  • Loading branch information
craig[bot] and adityamaru committed Jun 7, 2021
2 parents ec7a10d + a3dadd3 commit c2edcc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cli/debug_job_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ SELECT span_id, goroutine_id, operation, start_time, duration
FROM crdb_internal.node_inflight_trace_spans
WHERE trace_id=$1
) SELECT *
FROM spans, LATERAL crdb_internal.payloads_for_span(spans.span_id)`
FROM spans, LATERAL crdb_internal.payloads_for_span(spans.span_id) ORDER BY spans.start_time`

var f *os.File
if f, err = os.Create(traceFilePath); err != nil {
Expand Down

0 comments on commit c2edcc2

Please sign in to comment.