-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[xCluster] Setup does not work with tables with the same names but in different schemas #11691
Comments
Note: yugabyte-db/ent/src/yb/master/catalog_manager_ent.cc Lines 3231 to 3233 in 098fd69
yugabyte-db/ent/src/yb/master/catalog_manager_ent.cc Lines 3243 to 3244 in 098fd69
|
…er replication Summary: #11691 Resolved the previous issue where if tables test1.example, test2.example are created on both producer and consumer, a replication setup for either of these two tables will fail. Added unit test. Test Plan: Verify locally that the problem described in the Github issue no longer exists. Verify that the unit test runs without error: ``` ./yb_build.sh --cxx-test integration-tests_twodc_ysql-test --gtest_filter "*SetupSameNameDifferentSchemaUniverseReplication/*" -n 4 ``` Also did some manual testings: - Ensured that without the change, the above unit test failed - Ensured that the backfill succeeded by manually removing the check condition under CatalogManager::GetTableSchemaInternal Reviewers: jhe Reviewed By: jhe Subscribers: ybase, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D17099
…nd for YSQL tables Summary: This is a fix for an issue introduced by the previous diff https://phabricator.dev.yugabyte.com/D17099 Issue: https://yugabyte.slack.com/archives/C03G3F2H4AU/p1654647033631909 It appears that it is possible that some YSQL tables' schema names can not be found even in pg system tables. Previously, an error was raised in this case. The fix is to change the error to a warning message. Test Plan: Manually let all non-system YSQL tables passing the two if-clauses in the following block in `CatalogManager::GetTableSchemaInternal`: ``` if (!table->is_system() && l->table_type() == TableType::PGSQL_TABLE_TYPE && !resp->schema().has_pgschema_name()) { SharedLock lock(mutex_); TRACE("Acquired catalog manager lock for schema name lookup"); auto pgschema_name = GetPgSchemaName(table); if (!pgschema_name.ok() || pgschema_name->empty()) { LOG(WARNING) << Format( "Unable to find schema name for YSQL table $0.$1 due to error: $2", table->namespace_name(), table->name(), pgschema_name.ToString()); } else { resp->mutable_schema()->set_pgschema_name(*pgschema_name); } } ``` Verify that no error is returned. Reviewers: jhe Reviewed By: jhe Subscribers: ybase, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D17563
…hema name not found for YSQL tables Summary: Original commit: 3427342 / D17563 This is a fix for an issue introduced by the previous diff https://phabricator.dev.yugabyte.com/D17099 Issue: https://yugabyte.slack.com/archives/C03G3F2H4AU/p1654647033631909 It appears that it is possible that some YSQL tables' schema names can not be found even in pg system tables. Previously, an error was raised in this case. The fix is to change the error to a warning message. Test Plan: Manually let all non-system YSQL tables passing the two if-clauses in the following block in `CatalogManager::GetTableSchemaInternal`: ``` if (!table->is_system() && l->table_type() == TableType::PGSQL_TABLE_TYPE && !resp->schema().has_pgschema_name()) { SharedLock lock(mutex_); TRACE("Acquired catalog manager lock for schema name lookup"); auto pgschema_name = GetPgSchemaName(table); if (!pgschema_name.ok() || pgschema_name->empty()) { LOG(WARNING) << Format( "Unable to find schema name for YSQL table $0.$1 due to error: $2", table->namespace_name(), table->name(), pgschema_name.ToString()); } else { resp->mutable_schema()->set_pgschema_name(*pgschema_name); } } ``` Verify that no error is returned. Reviewers: jhe Reviewed By: jhe Subscribers: bogdan, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D17656
…en setup xcluster replication Summary: Original commit: 9737277 / D17099 #11691 Resolved the previous issue where if tables test1.example, test2.example are created on both producer and consumer, a replication setup for either of these two tables will fail. Added unit test. Test Plan: Verify locally that the problem described in the Github issue no longer exists. Verify that the unit test runs without error: ``` ./yb_build.sh --cxx-test integration-tests_twodc_ysql-test --gtest_filter "*SetupSameNameDifferentSchemaUniverseReplication/*" -n 4 ``` Also did some manual testings: - Ensured that without the change, the above unit test failed - Ensured that the backfill succeeded by manually removing the check condition under CatalogManager::GetTableSchemaInternal Reviewers: slingam Reviewed By: slingam Subscribers: bogdan, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D19609
…ma name not found for YSQL tables Summary: Original commit: 3427342 / D17563 This is a fix for an issue introduced by the previous diff https://phabricator.dev.yugabyte.com/D17099 Issue: https://yugabyte.slack.com/archives/C03G3F2H4AU/p1654647033631909 It appears that it is possible that some YSQL tables' schema names can not be found even in pg system tables. Previously, an error was raised in this case. The fix is to change the error to a warning message. Test Plan: Manually let all non-system YSQL tables passing the two if-clauses in the following block in `CatalogManager::GetTableSchemaInternal`: ``` if (!table->is_system() && l->table_type() == TableType::PGSQL_TABLE_TYPE && !resp->schema().has_pgschema_name()) { SharedLock lock(mutex_); TRACE("Acquired catalog manager lock for schema name lookup"); auto pgschema_name = GetPgSchemaName(table); if (!pgschema_name.ok() || pgschema_name->empty()) { LOG(WARNING) << Format( "Unable to find schema name for YSQL table $0.$1 due to error: $2", table->namespace_name(), table->name(), pgschema_name.ToString()); } else { resp->mutable_schema()->set_pgschema_name(*pgschema_name); } } ``` Verify that no error is returned. Reviewers: nicolas, rahuldesirazu Reviewed By: rahuldesirazu Subscribers: yguan, bogdan, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D21789
Jira Link: DB-806
Description
Perform on both source and target:
Try to setup replication on
test2.example
, and we'll get an error of the form:This happens since we currently just match tables on the target side by looking for a table with the same dbname and same table name. We need to also check for schema name here.
The text was updated successfully, but these errors were encountered: