-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
release-23.1: server: support multi-span statistics endpoint #101877
Conversation
Extends: #96223 This PR extends the implementation of our SpanStats RPC endpoint to fetch stats for multiple spans at once. By extending the endpoint, we amortize the cost of the RPC's node fanout across all requested spans, whereas previously, we were issuing a fanout per span requested. Additionally, this change batches KV layer requests for ranges fully contained by the span, instead of issuing a request per fully contained range. Release note (sql change): span statistics are unavailable on mixed-version clusters
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
cff1a58
to
b0a7afc
Compare
ece2060
to
84dbb3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @j82w, @THardy98, and @zachlite)
TYFR :) |
Backport 1/1 commits from #101378 on behalf of @THardy98.
/cc @cockroachdb/release
Epic: None
Extends: #96223
This PR extends the implementation of our SpanStats RPC endpoint to fetch stats for multiple spans at once. By extending the endpoint, we amortize the cost of the RPC's node fanout across all requested spans, whereas previously, we were issuing a fanout per span requested. Additionally, this change batches KV layer requests for ranges fully contained by the span, instead of issuing a request per fully contained range.
Note that we do not deprecate the
start_key
andend_key
fields as they're used to determine whether an old node is calling out to a node using the new proto format.The changes here explicitly do not support mixed-version clusters.
BENCHMARK RESULTS
Here are some benchmark results from running:
Note that
HEAD
is actually a temp change to revert to old logic (request per span) andHEAD^
is the new logic (multi-span request). As such the increases in latency/memory are actually reductions.Some notable improvements particularly with requests for spans with fewer ranges. After a point, the raw number of ranges becomes the bottleneck, despite reducing the number of fanouts. Not sure if there is a better way to fetch range statistics but I think the improvement here is enough for this PR. If improvements for fetching range statistics are identified, they can be done in a follow up PR and backported.
Release note (sql change): span statistics are unavailable on mixed-version clusters
Release justification: performance improvement fetching span statistics in bulk