You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restore backup back into yugabyte DB - successfully recreated T1
ImportSnapshot failed due to 2 tables with the same name (1 table - new, second - deleted): Unable to import snapshot meta file /tmp/yb_backup_wkcfvtmztglztbhd/SnapshotInfoPB: Found 2 YSQL tables with the same name: ttt - 000030a9000030008000000000004000, 000030a9000030008000000000004100: SNAPSHOT_FAILED (master error 23)
The command yb-admin dump_masters_state console shows 2 tables with the same name - one table is in DELETED state, and another one - RUNNING:
…e the restoration.
Summary:
YSQL table is restored via external tool `ysqlsh` run. CatalogManager::ImportSnapshot() is searching the recreated table by name.
The function must find only one such table.
If the table was deleted before the table recreating, so CatalogManager has 2 tables with the same name: one table (new) is in RUNNING state, the second table is in DELETED state.
The fix must skip DELETED tables to prevent CatalogManager::ImportSnapshot() failure with error: `Found 2 YSQL tables with the same name`.
Test Plan:
ybd --cxx-test yb-backup-test_ent --gtest_filter YBBackupTest.TestYSQLKeyspaceBackup
ybd --cxx-test yb-backup-test_ent --gtest_filter YBBackupTest.TestYSQLKeyspaceBackupWithDropTable
Reviewers: nicolas, bogdan
Reviewed By: bogdan
Subscribers: kannan, yql
Differential Revision: https://phabricator.dev.yugabyte.com/D9063
… was deleted before the restoration.
Summary:
Original fix: a32689f
YSQL table is restored via external tool `ysqlsh` run. CatalogManager::ImportSnapshot() is searching the recreated table by name.
The function must find only one such table.
If the table was deleted before the table recreating, so CatalogManager has 2 tables with the same name: one table (new) is in RUNNING state, the second table is in DELETED state.
The fix must skip DELETED tables to prevent CatalogManager::ImportSnapshot() failure with error: `Found 2 YSQL tables with the same name`.
Test Plan:
ybd --cxx-test yb-backup-test_ent --gtest_filter YBBackupTest.TestYSQLKeyspaceBackup
ybd --cxx-test yb-backup-test_ent --gtest_filter YBBackupTest.TestYSQLKeyspaceBackupWithDropTable
Jenkins: rebase: 2.2
Reviewers: nicolas, bogdan, alex
Reviewed By: alex
Subscribers: alex, yql, kannan
Differential Revision: https://phabricator.dev.yugabyte.com/D9163
The case:
ysql.yugabyte
(table T1)yugabyte
DB - successfully recreated T1ImportSnapshot failed due to 2 tables with the same name (1 table - new, second - deleted):
Unable to import snapshot meta file /tmp/yb_backup_wkcfvtmztglztbhd/SnapshotInfoPB: Found 2 YSQL tables with the same name: ttt - 000030a9000030008000000000004000, 000030a9000030008000000000004100: SNAPSHOT_FAILED (master error 23)
The command
yb-admin dump_masters_state console
shows 2 tables with the same name - one table is in DELETED state, and another one - RUNNING:The text was updated successfully, but these errors were encountered: