-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
server: make SpanStats authoritative #104423
server: make SpanStats authoritative #104423
Conversation
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.
Great work. Thanks for this change. Don't forget to update the test expectation in TestAdminAPITableStats.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @zachlite)
-- commits
line 8 at r1:
tip: add a blank line after the colon and in-between the two list items to fix the markdown formatting. (You can also upgrade the PR description after that)
32ab463
to
2359c2a
Compare
This commit guarantees that SpanStats uses up-to-date range descriptors on all nodes. The dependency on DistSender is removed and is replaced with a dependency on rangedesc.Scanner. rangedesc.Scanner is used to: 1) Locate nodes that house replicas of a span to avoid cluster-wide fan-outs. 2) Find Range Descriptors that touch a span, to build a SpanStatsResponse. This commit also fixes cockroachdb#103809, where a SpanStatsResponse incorrectly returned the replica_count for a span, instead of the range_count. Epic: https://cockroachlabs.atlassian.net/browse/CRDB-24928 Issue: cockroachdb#103957 Release note (bug fix): SpanStats is no longer subject to stale information, and should be considered authoritative.
2359c2a
to
455148e
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.
Reviewed 1 of 5 files at r1, 3 of 5 files at r2, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz and @zachlite)
-- commits
line 6 at r2:
To confirm, this only runs on the system tenant, right?
If not, we might need to use a rangedesc.Iterator
instead, much like crdb_internal.ranges_no_leases
does.
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.
Didn't mean to publish just yet. Change looks good, just a question in-line.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz and @zachlite)
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.
Yep, span stats are fulfilled by the system tenant (KV nodes). Other tenant requests for span stats are forwarded through tenantConnect.
TFTR
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz)
bors r+ |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error setting reviewers, but backport branch blathers/backport-release-23.1-104423 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/105000/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. [] Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
This commit guarantees that SpanStats uses up-to-date range
descriptors on all nodes. The dependency on DistSender is removed
and is replaced with a dependency on rangedesc.Scanner.
rangedesc.Scanner is used to:
This commit also fixes #103809, where a SpanStatsResponse incorrectly returned
the replica_count for a span, instead of the range_count.
Epic: https://cockroachlabs.atlassian.net/browse/CRDB-24928
Issue: #103957
Release note (bug fix): SpanStats is no longer subject to stale
information, and should be considered authoritative.