-
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: add TenantStatusServer.NodeLocality to support crdb_internal.ranges{_no_leases} for secondary tenants #92293
sql: add TenantStatusServer.NodeLocality to support crdb_internal.ranges{_no_leases} for secondary tenants #92293
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.
LGTM with nits.
Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ecwall)
-- commits
line 13 at r1:
nit: you do not need to include the full URL here, just Epic: CRDB-14522
is sufficient.
pkg/server/status.go
line 1384 at r1 (raw file):
} // NodeLocality implements the serverpb.Status interface
nit: period at end of comment.
pkg/server/serverpb/status.go
line 84 at r1 (raw file):
// the SQL system to query for the node locality of a given node ID. // It is available for tenants. type NodeLocalityServer interface {
Could you discuss with @dhartunian whether this interface can be merged with those above (in fact, also whether the others could be merged together). At this point I do not understand why we have so many interfaces and why they need to be separate.
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 @ecwall)
pkg/server/serverpb/status.go
line 84 at r1 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
Could you discuss with @dhartunian whether this interface can be merged with those above (in fact, also whether the others could be merged together). At this point I do not understand why we have so many interfaces and why they need to be separate.
@ecwall I agree in this case that we should avoid introducing a new interface. It looks like RegionsServer
above and TenantStatusServer
are used in the same contexts so I'd suggest either:
- merging all 3 into
TenantStatusServer
to unify all the stuff tenants need from aConnector
or - add your
NodeLocality
method toTenantStatusServer
and put a TODO onRegionsServer
to merge later
I don't see anything in particular gained from a separate interface here. It does add confusion when the list of config params continues to grow, especially when multiple args are just the same struct fulfilling various single-method interfaces.
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 @knz)
Previously, knz (Raphael 'kena' Poss) wrote…
nit: you do not need to include the full URL here, just
Epic: CRDB-14522
is sufficient.
Done.
pkg/server/status.go
line 1384 at r1 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
nit: period at end of comment.
Done.
pkg/server/serverpb/status.go
line 84 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
@ecwall I agree in this case that we should avoid introducing a new interface. It looks like
RegionsServer
above andTenantStatusServer
are used in the same contexts so I'd suggest either:
- merging all 3 into
TenantStatusServer
to unify all the stuff tenants need from aConnector
or- add your
NodeLocality
method toTenantStatusServer
and put a TODO onRegionsServer
to merge laterI don't see anything in particular gained from a separate interface here. It does add confusion when the list of config params continues to grow, especially when multiple args are just the same struct fulfilling various single-method interfaces.
Created a PR to merge the preexisting TenantStatusServer
and RegionsServer
here #92599. I'll rebase this PR on top of that after it merges.
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 14 of 14 files at r3, 14 of 14 files at r4, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ecwall)
pkg/ccl/kvccl/kvtenantccl/connector.go
line 421 at r4 (raw file):
resp, err = c.Regions(ctx, req) return err }); err != nil {
nit:
err := c.withClient(...)
return resp, err
pkg/ccl/kvccl/kvtenantccl/connector.go
line 436 at r4 (raw file):
resp, err = c.NodeLocality(ctx, req) return err }); err != nil {
ditto
…ges{_no_leases} for secondary tenants This PR adds a new node locality lookup KV admin function which is used by crdb_internal.ranges{_no_leases} and SHOW RANGES to work for secondary tenants. Release note: None Epic: CRDB-14522
bors r=knz |
Build succeeded: |
This PR adds a new node locality lookup KV admin function which is
used by crdb_internal.ranges{_no_leases} and SHOW RANGES to
work for secondary tenants.
Release note: None
Epic: CRDB-14522