-
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
sql: support crdb_internal.ranges{_no_leases} for secondary tenants #92029
Conversation
964a5df
to
2548610
Compare
754f3e3
to
4eb5fca
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.
This is good.
LGTM with nits.
Reviewed 2 of 2 files at r1, 11 of 11 files at r2, 1 of 1 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @aayushshah15)
-- commits
line 2 at r1:
No objection to this fix, but does it belong to this PR?
pkg/sql/crdb_internal.go
line 3668 at r4 (raw file):
return nil, nil } defer ri.Next(ctx)
This is elegant but it feels like magic. Please add a comment above the function definition that explains how the iteration works.
pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant
line 307 at r4 (raw file):
SELECT range_id, start_pretty, end_pretty, lease_holder FROM crdb_internal.ranges 53 /Tenant/10 /Max 1
I appreciate this is not directly a result of your change, but having /Max
as end key is problematic.
What would it take for this to be /Tenant/10/<endprefix>
or something similar? If it's a simple change in your PR I'll take it, otherwise please file an issue so we can track this.
@ecwall would you like to review this PR as well? I believe there are a few things in there you'll find interesting to learn. |
4eb5fca
to
981d957
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! 0 of 0 LGTMs obtained (waiting on @herkolategan, @knz, and @smg260)
Previously, knz (Raphael 'kena' Poss) wrote…
No objection to this fix, but does it belong to this PR?
cockroach demo
stalls without this fix since it relies on this logic during startup.
pkg/sql/crdb_internal.go
line 3668 at r4 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
This is elegant but it feels like magic. Please add a comment above the function definition that explains how the iteration works.
Let me know if that comment doesn't quite cover it.
pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant
line 307 at r4 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
I appreciate this is not directly a result of your change, but having
/Max
as end key is problematic.What would it take for this to be
/Tenant/10/<endprefix>
or something similar? If it's a simple change in your PR I'll take it, otherwise please file an issue so we can track this.
Filed: #92072
4494baa
to
d55977d
Compare
This commit fixes a stall when running `workload` splits under a secondary tenant. Secondary tenants don't support splits or scatter (as of the time of this commit), and `workload`'s splitting logic was buggy and would stall under multi-tenancy. Release note: None
This commit exposes an interface through the tenant connector that provides a map of node localities from the host cluster. This will be used in a future commit to power `crdb_internal.ranges{_no_leases}`. Release note: None
This commit makes it such that secondary tenants are allowed to issue `LeaseInfo` and `RangeStats` requests. A future commit will need this to allow `crdb_internal.ranges{_no_leases}` to work on tenants. Release note: None
This commit makes `crdb_internal.ranges{_no_leases}` and `SHOW RANGES` work for secondary tenants. It achieves this by leveraging the `DistSender` on the secondary tenant to perform privileged meta2 lookups over the tenant `Connector` boundary. Release note (sql change): `crdb_internal.ranges{_no_leases}` and `SHOW RANGES` statements now work on secondary tenants. Epic: https://cockroachlabs.atlassian.net/browse/CRDB-14522
d55977d
to
00635d8
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Moving work to #92131 |
This PR makes
crdb_internal.ranges{_no_leases}
andSHOW RANGES
work for secondary tenants. It achieves this by leveraging the
DistSender
on the secondary tenant to perform privileged meta2lookups over the tenant
Connector
boundary.Release note (sql change):
crdb_internal.ranges{_no_leases}
andSHOW RANGES
statements now work on secondary tenants.Epic: https://cockroachlabs.atlassian.net/browse/CRDB-14522