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

spanconfig: ensure splits on tenant boundaries within KV #73749

Closed
Tracked by #73874
irfansharif opened this issue Dec 13, 2021 · 2 comments
Closed
Tracked by #73874

spanconfig: ensure splits on tenant boundaries within KV #73749

irfansharif opened this issue Dec 13, 2021 · 2 comments
Assignees
Labels
A-multitenancy Related to multi-tenancy A-zone-configs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@irfansharif
Copy link
Contributor

irfansharif commented Dec 13, 2021

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

With the span configs infrastructure, it's currently possible for us to end up with ranges that straddle tenant boundaries (even if in a somewhat benign way). In this infrastructure we determine split boundaries by looking only at the start keys of system.span_configurations. A tenant could then augment their reconciliation process to install configs starting somewhat later in their addressable keyspace. This could induce KV to consider a range boundary that starts at the previous tenant's keyspace (albeit the tail end of it) and ending within the current tenant's one -- that's no good.

Describe the solution you'd like

We could do two things:

(i) Have each tenant install a span config that demarcates the end of its keyspace (in our example the previous tenant would defensively prevent its data straddling through the tenant ID boundary);
(ii) Have KV enforce these hard boundaries in keyspans that straddle tenant keyspaces.

Doing (ii) feels saner, and we already do something similar when seeding system.span_configurations for newly created tenants. We could have secondary tenants still govern span configurations over their keyspace, but we'd always split on the tenant boundary. For modified tenants, the config we'd apply over that range would be the fallback one KV already uses for missing spans. For unmodified tenants, it could either be the config for:

(i) its system.descriptor (very first table in its keyspace), or
(ii) whatever the tenant's RANGE DEFAULT is.

Describe alternatives you've considered

See above.

Additional context

See #71994 and #73746 for more details.

Jira issue: CRDB-11727

Epic CRDB-23344

@irfansharif irfansharif added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-zone-configs labels Dec 13, 2021
@irfansharif irfansharif changed the title spanconfig: hard-enforce splits on tenant boundaries within KV, independent of SQL spanconfig: ensure splits on tenant boundaries within KV Dec 13, 2021
@irfansharif irfansharif self-assigned this Apr 9, 2022
@irfansharif irfansharif removed their assignment Apr 20, 2022
@exalate-issue-sync exalate-issue-sync bot added the T-multitenant Issues owned by the multi-tenant virtual team label Jan 10, 2023
@knz knz added the A-multitenancy Related to multi-tenancy label Jan 11, 2023
@ecwall ecwall self-assigned this Jan 12, 2023
@ecwall ecwall added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-multitenant Issues owned by the multi-tenant virtual team labels Jan 12, 2023
@ajstorm
Copy link
Collaborator

ajstorm commented Mar 7, 2023

@ecwall @arulajmani is this addressed with 9d4e27a?

@arulajmani
Copy link
Collaborator

Yeah, this can be closed now.

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 A-zone-configs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

6 participants