forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
68662: sql: unsafe_upsert_descriptor to bump descriptor ID sequence r=postamar a=postamar Previously, it was possible to use this descriptor repair function to insert a new descriptor with an ID greater than any descriptor in the cluster and would not update the descriptor ID sequence value. Subsequent CREATE statements would therefore write descriptors with IDs smaller or equal to the descriptor inserted previously. In the equal case, this corrupts the schema. This commit adds a test that checks that the ID is less than the value stored in the descriptor ID sequence. When that is not the case: - an error is returned when the `force` flag is not set, - otherwise, the sequence value is incremented appropriately. Fixes cockroachdb#68230. Release note: None Co-authored-by: Marius Posta <[email protected]>
- Loading branch information
Showing
2 changed files
with
117 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters