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

sql/catalog/lease: optimize descriptor leasing protocol for cold start #85741

Closed
ajwerner opened this issue Aug 8, 2022 · 2 comments
Closed
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@ajwerner
Copy link
Contributor

ajwerner commented Aug 8, 2022

Is your feature request related to a problem? Please describe.
In order to use tables for DML queries, sql servers need to acquire leases for the underlying descriptors. The process of acquiring a lease on a descriptor required a number of KV operations:

  • Read the namespace table to find the descriptor
  • Read the descriptor
  • Read and validate the cross-references for the descriptor
  • Write the lease entry

Today, each of these operations will potentially leave the current region. We'd like it to be the case that we can acquire leases without leaving the current region.

Describe the solution you'd like
We ought to leverage a combination of LOCALITY GLOBAL and LOCALITY REGIONAL BY ROW configurations for the relevant system tables.

Describe alternatives you've considered
We could attempt to avoid the LOCALITY GLOBAL configuration on the system.descriptors table if we used some other causality propagation mechanism. It's probably not worth the trouble.

Additional context

The above leasing protocol is also used to cache password hashes, role membership, and virtual privileges. Those system will benefit transparently from the above work.

This work depends on being able to configure system tables with MR primitives (currently tracked in #63365).

Epic: CRDB-18596

Jira issue: CRDB-18414

@ajwerner ajwerner added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 8, 2022
@ajwerner
Copy link
Contributor Author

We've done this for multi-tenant deployments within secondary tenants which are opted into multi-region functionality.

@ajwerner
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

1 participant