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

cli: order span payloads by start_time for readability #66089

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

adityamaru
Copy link
Contributor

@adityamaru adityamaru commented Jun 4, 2021

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

@adityamaru adityamaru requested a review from knz June 4, 2021 16:41
@adityamaru adityamaru requested a review from a team as a code owner June 4, 2021 16:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: with nit

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru)


pkg/cli/debug_job_trace.go, line 103 at r1 (raw file):

WHERE trace_id=$1
) SELECT *
FROM spans, LATERAL (select * from crdb_internal.payloads_for_span(spans.span_id)) ORDER BY spans.start_time`

nit: simpler LATERAL crdb_internal.payloads_for_span(spans.span_id) ORDER BY spans.start_time

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.

Release note: None
@adityamaru
Copy link
Contributor Author

TFTR!

bors r=knz

@craig
Copy link
Contributor

craig bot commented Jun 7, 2021

Build succeeded:

@craig craig bot merged commit c2edcc2 into cockroachdb:master Jun 7, 2021
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

Successfully merging this pull request may close these issues.

3 participants