-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5958:[backup][YCQL] Fixed incorrect column-ids in restored table if …
…original table was altered. Summary: Before the fix `CatalogManager::CreateTable()` always sets column ids into 0,1,2,3.. Due to ALTER TABLE statements columns can be added/removed. (E.g. into 0,2,3 after `ALTER TABLE t DROP c1;`) But on the backup-restore step RecreateTable() calls CreateTable(), which sets the column ids into '0,1,2' instead of using existing in the backup ids. As result the restored table schema references to wrong columns. The fix include the following code changes: - In `CatalogManager::RecreateTable()`: removed code for column ids clean-up. - In `ValidateCreateTableSchema()`: added ability to allow incoming column ids. - In `CatalogManager::CreateTable()`: the table schema must use old (provided by the caller) column ids. Test Plan: ybd --java-test org.yb.cql.TestYbBackup#testAlteredYCQLTableBackup Reviewers: mihnea, mikhail, neil, bogdan Reviewed By: bogdan Subscribers: kannan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D9608
- Loading branch information
1 parent
95667cd
commit fa1ba0a
Showing
5 changed files
with
79 additions
and
30 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
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