-
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: enable _status/ranges
API for secondary tenants
#131100
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.
Keeping it draft as there are few TODOs I need to clear.
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.
cockroach/pkg/server/status.go
Lines 2663 to 2667 in 6a5017e
if local { | |
resp, next, err = s.rangesHelper(ctx, nodeReq, int(req.Limit), int(req.Offset)) | |
if err != nil { | |
return nil, err | |
} |
Here we take next
for local TenantRanges
but ignoring next
for remote responses. I think this pagination stuff is incomplete/incorrect for TenantRanges
endpoint. But more importantly pagination is not used so in a follow-up we can consider removing this. I almost removed it myself but reverted the change as I'm not an expert in this area. Let me know if removing it would make others happy as well.
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.
Feel free to put up a separate PR removing the pagination, I would not combine with this work. I'm not super familiar with the usage of this endpoint but I agree the pagination here is confusing at first glance. What does it mean to send the same limit/offset to all the nodes during fanout? Are their lists guaranteed to be the same size?
The next
is ignored for remote responses because it comes back already inside the resp
.
954b5e9
to
0157e73
Compare
0157e73
to
a66741c
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.
Feel free to put up a separate PR removing the pagination, I would not combine with this work. I'm not super familiar with the usage of this endpoint but I agree the pagination here is confusing at first glance. What does it mean to send the same limit/offset to all the nodes during fanout? Are their lists guaranteed to be the same size?
The next
is ignored for remote responses because it comes back already inside the resp
.
Previously, the above endpoint was only available for the system tenant. With this change, it now works for secondary tenants and returns the ranges belonging to the currently logged-in tenant. Note that although we have `TenantRanges`, which is quite similar to `Ranges`, it was developed to meet the needs of the `debug` command and has a different response body. Another difference is that `TenantRanges` returns ranges for all nodes, while `Ranges` returns data for a particular node. Fixes: cockroachdb#110019 Epic: CRDB-38968 Release note (multi-tenancy): The `ranges` endpoint on the `Advanced Debug` section of the DB Console is now enabled for secondary tenants and will return the ranges only for the currently logged-in tenant. For the system tenant, it will continue to work as before, returning ranges for all tenants on the specified node.
a66741c
to
8a35ea7
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.
LGTM, thanks!
Thanks for the review! bros r=dhartunian |
👊 |
OH-kayy, I misspelled! bors r=dhartunian |
Previously, the above endpoint was only available for the system tenant. With this change, it now works for secondary tenants and returns the ranges belonging to the currently logged-in tenant.
Note that although we have
TenantRanges
, which is quite similar toRanges
, it was developed to meet the needs of thedebug
command and has a different response body. Another difference is thatTenantRanges
returns ranges for all nodes, whileRanges
returns data for a particular node.Fixes: #110019
Epic: CRDB-38968
Release note (multi-tenancy): The
ranges
endpoint on theAdvanced Debug
section of the DB Console is now enabled for secondary tenants and will return the ranges only for the currently logged-in tenant. For the system tenant, it will continue to work as before, returning ranges for all tenants on the specified node.