Skip to content
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: the DataDistribution RPC API is not available to secondary tenants #109501

Closed
knz opened this issue Aug 25, 2023 · 2 comments · Fixed by #128578
Closed

server: the DataDistribution RPC API is not available to secondary tenants #109501

knz opened this issue Aug 25, 2023 · 2 comments · Fixed by #128578
Assignees
Labels
A-multitenancy Related to multi-tenancy C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-db-server

Comments

@knz
Copy link
Contributor

knz commented Aug 25, 2023

Is your feature request related to a problem? Please describe.

when e.g. TestAdminAPIDataDistribution is pointed to a secondary tenant (based on #108762), it fails:

    storage_inspection_test.go:273: status: 501 Not Implemented, content-type: application/json, body: {
          "error": "method DataDistribution not implemented",
          "code": 12,
          "message": "method DataDistribution not implemented",
          "details": [
          ]
        }, error: <nil>

Describe the solution you'd like

The DataDistribution API should be available for secondary tenants (and reveal ranges that contain the tenant's keyspace only).

Epic CRDB-38968

Jira issue: CRDB-30956

@knz knz added A-multitenancy Related to multi-tenancy T-cluster-observability A-cluster-observability Related to cluster observability labels Aug 25, 2023
@blathers-crl
Copy link

blathers-crl bot commented Aug 25, 2023

Hi @knz, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 25, 2023
@exalate-issue-sync exalate-issue-sync bot removed the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 25, 2023
@knz knz added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 25, 2023
@rimadeodhar rimadeodhar added T-db-server and removed A-cluster-observability Related to cluster observability T-observability labels Jun 7, 2024
@shubhamdhama
Copy link
Contributor

This test should be fixed if we fix #97942 which has more context about this issue.

craig bot pushed a commit that referenced this issue Sep 11, 2024
128578: server: enable `data_distribution` API for secondary tenants. r=dhartunian,stevendanna a=shubhamdhama

Previously, this endpoint scanned over meta KVs and used their startKey to
determine the table they belong to. However, this approach does not work
for coalesced ranges.

The fix, inspired by the `SHOW CLUSTER RANGES` query, uses the
`crdb_internal.table_spans` table and joins it with the
`crdb_internal.ranges_no_leases` table.

There is still some work left that can be addressed in follow-up PR:

- We might want to add a summation of ranges at various levels because the
  sum of replicas of all tables in a database can be more than the actual
  number of ranges that belong to that database due to coalescing.

Overall, this PR also fixes the broken behavior to a large extent of this
endpoint since range coalescing is enabled.

Informs: #97942
Fixes: #109501, #106897
Epic: CRDB-12100
Release note: None


Co-authored-by: Shubham Dhama <[email protected]>
@craig craig bot closed this as completed in 0b57de4 Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-multitenancy Related to multi-tenancy C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-db-server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants