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.
backupccl: handle sequence ownership remapping logic for restore
Previously, we would restore sequence descriptors/table descriptors as is, without remapping the ownership dependency to the new IDs. This meant sequence ownership was broken post restore. This PR fixes that. When sequences with owners or tables that have columns that own sequences are restored: - If both the owned sequence and the owning table are being restored, the ownership is remapped. - If just the sequence is restored, the user receives an error to use the `skip_missing_sequence_owners` flag. If the flag is provided, the sequence is restored without any owner. - If just the table is restored, the user receives an error to use the `skip_missing_sequence_owners` flag. If the flag is provided, the table is restored with the table column that previously owned the sequence no longer owning that sequence. Fixes cockroachdb#50781 Release note (enterprise change): Restore now has a new option `skip_missing_sequence_owners` that must be supplied when restoring only the table/sequence that was previously a sequence owner/owned by a table. Additionally, this fixes a bug where ownership relationships would not be remapped after a restore.
- Loading branch information
1 parent
791ee6b
commit 106bd1d
Showing
4 changed files
with
321 additions
and
14 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
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