-
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: return authoritative span statistics for db details endpoint #108037
server: return authoritative span statistics for db details endpoint #108037
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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! 0 of 0 LGTMs obtained (waiting on @THardy98)
-- commits
line 12 at r1:
Is there any concern about the additional overhead and perf impact of not using the cache? Would it not be better to just reset the stats for the test?
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! 0 of 0 LGTMs obtained (waiting on @j82w)
Previously, j82w (Jake) wrote…
Is there any concern about the additional overhead and perf impact of not using the cache? Would it not be better to just reset the stats for the test?
I think this makes more sense for the endpoint generally. Using the descriptor cache to measure size seems odd. There's no guarantee the cache holds all the database/table's ranges (i.e. we could be missing ranges or reading old ranges that no longer correspond to the database/table) and there's also no guarantee that the cache at some point will be up-to-date either.
I do agree that there is a concern about the additional overhead/perf impact but we also use the same logic already for the status server which we use for the console. I think the alignment between the two is also good.
I agree with Thomas. Additionally, if we find that performance is a concern, I would welcome a caching layer for the computed stats in the o11y service, separate from the range cache. |
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.
Just wanna see that the tests are passing before approval, to make sure this change is working as expected, since some of the failed ones are related to retrieving database details
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @j82w)
777c1a0
to
de3b318
Compare
Tests were failing due to directly accessing meta2 keyspace which would fail in tenant scenarios. Added a conditional to use the range iterator from |
Resolves: cockroachdb#96163 This change makes the admin API endpoint getting database statistics scan KV for span statistics instead of using the range descriptor cache. This provides authoritative output, helping deflake `TestMultiRegionDatabaseStats`. Release note (sql change): admin API database details endpoint now returns authoritative range statistics.
de3b318
to
b2faa2b
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 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @j82w)
bors r+ |
Build failed (retrying...): |
Build failed (retrying...): |
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 creating merge commit from b2faa2b to blathers/backport-release-23.1-108037: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Resolves: #96163
This change makes the admin API endpoint getting database statistics scan KV for span statistics instead of using the range descriptor cache. This provides authoritative output, helping deflake
TestMultiRegionDatabaseStats
.Release note (sql change): admin API database details endpoint now returns authoritative range statistics.