diff --git a/src/backend/distributed/operations/worker_node_manager.c b/src/backend/distributed/operations/worker_node_manager.c index 9bab18c96..0979f52d1 100644 --- a/src/backend/distributed/operations/worker_node_manager.c +++ b/src/backend/distributed/operations/worker_node_manager.c @@ -267,8 +267,11 @@ ErrorIfCoordinatorNotAddedAsWorkerNode() return; } - ereport(ERROR, (errmsg("could not find the coordinator node in " - "metadata as it is not added as a worker"))); + ereport(ERROR, (errmsg("operation is not allowed when coordinator " + "is not added into metadata"), + errhint("Use \"SELECT citus_set_coordinator_host('" + "', '')\" to configure the " + "coordinator hostname and port"))); } diff --git a/src/test/regress/expected/citus_local_tables.out b/src/test/regress/expected/citus_local_tables.out index f2177948c..71ed1eb23 100644 --- a/src/test/regress/expected/citus_local_tables.out +++ b/src/test/regress/expected/citus_local_tables.out @@ -40,7 +40,13 @@ SELECT 1 FROM master_remove_node('localhost', :master_port); CREATE TABLE citus_local_table_1 (a int primary key); -- this should fail as coordinator is removed from pg_dist_node SELECT citus_add_local_table_to_metadata('citus_local_table_1'); -ERROR: could not find the coordinator node in metadata as it is not added as a worker +ERROR: operation is not allowed when coordinator is not added into metadata +-- This should also fail as coordinator is removed from pg_dist_node. +-- +-- This is not a great place to test this but is one of those places that we +-- have workers in metadata but not the coordinator. +SELECT create_distributed_table_concurrently('citus_local_table_1', 'a'); +ERROR: operation is not allowed when coordinator is not added into metadata -- let coordinator have citus local tables again for next tests set client_min_messages to ERROR; SELECT 1 FROM master_add_node('localhost', :master_port, groupId => 0); diff --git a/src/test/regress/expected/isolation_create_citus_local_table.out b/src/test/regress/expected/isolation_create_citus_local_table.out index a7c2c8445..b673cc5b3 100644 --- a/src/test/regress/expected/isolation_create_citus_local_table.out +++ b/src/test/regress/expected/isolation_create_citus_local_table.out @@ -239,7 +239,7 @@ master_remove_node step s2-create-citus-local-table-1: SELECT citus_add_local_table_to_metadata('citus_local_table_1'); step s1-commit: COMMIT; step s2-create-citus-local-table-1: <... completed> -ERROR: could not find the coordinator node in metadata as it is not added as a worker +ERROR: operation is not allowed when coordinator is not added into metadata step s2-commit: COMMIT; master_remove_node --------------------------------------------------------------------- diff --git a/src/test/regress/sql/citus_local_tables.sql b/src/test/regress/sql/citus_local_tables.sql index 8505734e5..00bd0bc7b 100644 --- a/src/test/regress/sql/citus_local_tables.sql +++ b/src/test/regress/sql/citus_local_tables.sql @@ -35,6 +35,12 @@ CREATE TABLE citus_local_table_1 (a int primary key); -- this should fail as coordinator is removed from pg_dist_node SELECT citus_add_local_table_to_metadata('citus_local_table_1'); +-- This should also fail as coordinator is removed from pg_dist_node. +-- +-- This is not a great place to test this but is one of those places that we +-- have workers in metadata but not the coordinator. +SELECT create_distributed_table_concurrently('citus_local_table_1', 'a'); + -- let coordinator have citus local tables again for next tests set client_min_messages to ERROR; SELECT 1 FROM master_add_node('localhost', :master_port, groupId => 0);