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: Add a cluster version for system / internal database descriptors #109039

Closed
fqazi opened this issue Aug 18, 2023 · 3 comments · Fixed by #111404
Closed

sql/catalog: Add a cluster version for system / internal database descriptors #109039

fqazi opened this issue Aug 18, 2023 · 3 comments · Fixed by #111404
Assignees
Labels
A-schema-descriptors Relating to SQL table/db descriptor handling. 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

@fqazi
Copy link
Collaborator

fqazi commented Aug 18, 2023

We have no way of tracking system table versions, making schema changes to them extremely difficult to reason about what a transaction would see. To help make things easier, we should introduce a cluster version field into the database descriptor, as system tables are modified within any system database, and these versions will be bumped up. This allows the database code to correctly confirm in a transaction-aware manner if changes are fully visible at a given time for the transaction, which is crucial.

Jira issue: CRDB-30748

Epic CRDB-31701

@fqazi fqazi added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Aug 18, 2023
@fqazi fqazi self-assigned this Aug 18, 2023
@rafiss rafiss added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-schema-descriptors Relating to SQL table/db descriptor handling. and removed C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Aug 22, 2023
@rafiss
Copy link
Collaborator

rafiss commented Aug 30, 2023

@fqazi I see that the database descriptor already has a ClusterVersion field. Do you know what that one is used for?

ClusterVersion *immutable

@fqazi
Copy link
Collaborator Author

fqazi commented Aug 30, 2023

@rafiss That is just the original version of the descriptor before any changes can be made since it's mutable (normally used to detect version bumps, etc..).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-schema-descriptors Relating to SQL table/db descriptor handling. 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
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants