diff --git a/src/test/regress/expected/single_node.out b/src/test/regress/expected/single_node.out index 75a55e05f..9715232a2 100644 --- a/src/test/regress/expected/single_node.out +++ b/src/test/regress/expected/single_node.out @@ -136,13 +136,26 @@ SELECT groupid, nodename, nodeport, isactive, shouldhaveshards, hasmetadata, met 0 | localhost | 57636 | t | t | t | t (1 row) --- cannot add workers with specific IP as long as I have a placeholder coordinator record -SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); +BEGIN; + -- we should not enable MX for this temporary node just because + -- it'd spawn a bg worker targeting this node + -- and that changes the connection count specific tests + -- here + SET LOCAL citus.enable_metadata_sync_by_default TO OFF; + -- cannot add workers with specific IP as long as I have a placeholder coordinator record + SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); ERROR: cannot add a worker node when the coordinator hostname is set to localhost DETAIL: Worker nodes need to be able to connect to the coordinator to transfer data. HINT: Use SELECT citus_set_coordinator_host('') to configure the coordinator hostname --- adding localhost workers is ok -SELECT 1 FROM master_add_node('localhost', :worker_1_port); +COMMIT; +BEGIN; + -- we should not enable MX for this temporary node just because + -- it'd spawn a bg worker targeting this node + -- and that changes the connection count specific tests + -- here + SET LOCAL citus.enable_metadata_sync_by_default TO OFF; + -- adding localhost workers is ok + SELECT 1 FROM master_add_node('localhost', :worker_1_port); NOTICE: shards are still on the coordinator after adding the new node HINT: Use SELECT rebalance_table_shards(); to balance shards data between workers and coordinator or SELECT citus_drain_node('localhost',57636); to permanently move shards away from the coordinator. ?column? @@ -150,6 +163,8 @@ HINT: Use SELECT rebalance_table_shards(); to balance shards data between worke 1 (1 row) +COMMIT; +-- we don't need this node anymore SELECT 1 FROM master_remove_node('localhost', :worker_1_port); ?column? --------------------------------------------------------------------- @@ -163,8 +178,14 @@ SELECT 1 FROM citus_set_coordinator_host('127.0.0.1'); 1 (1 row) --- adding workers with specific IP is ok now -SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); +BEGIN; + -- we should not enable MX for this temporary node just because + -- it'd spawn a bg worker targeting this node + -- and that changes the connection count specific tests + -- here + SET LOCAL citus.enable_metadata_sync_by_default TO OFF; + -- adding workers with specific IP is ok now + SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); NOTICE: shards are still on the coordinator after adding the new node HINT: Use SELECT rebalance_table_shards(); to balance shards data between workers and coordinator or SELECT citus_drain_node('127.0.0.1',57636); to permanently move shards away from the coordinator. ?column? @@ -172,6 +193,8 @@ HINT: Use SELECT rebalance_table_shards(); to balance shards data between worke 1 (1 row) +COMMIT; +-- we don't need this node anymore SELECT 1 FROM master_remove_node('127.0.0.1', :worker_1_port); ?column? --------------------------------------------------------------------- diff --git a/src/test/regress/multi_1_schedule b/src/test/regress/multi_1_schedule index adebed4a2..8bd26bfcf 100644 --- a/src/test/regress/multi_1_schedule +++ b/src/test/regress/multi_1_schedule @@ -16,10 +16,8 @@ # Tests around schema changes, these are run first, so there's no preexisting objects. # --- test: multi_extension -test: turn_mx_off test: single_node test: single_node_truncate -test: turn_mx_on test: multi_test_helpers multi_test_helpers_superuser test: multi_cluster_management diff --git a/src/test/regress/sql/single_node.sql b/src/test/regress/sql/single_node.sql index 0305cbd48..c21066424 100644 --- a/src/test/regress/sql/single_node.sql +++ b/src/test/regress/sql/single_node.sql @@ -67,18 +67,43 @@ SELECT create_distributed_table('test','x'); SELECT groupid, nodename, nodeport, isactive, shouldhaveshards, hasmetadata, metadatasynced FROM pg_dist_node; --- cannot add workers with specific IP as long as I have a placeholder coordinator record -SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); +BEGIN; + -- we should not enable MX for this temporary node just because + -- it'd spawn a bg worker targeting this node + -- and that changes the connection count specific tests + -- here + SET LOCAL citus.enable_metadata_sync_by_default TO OFF; + -- cannot add workers with specific IP as long as I have a placeholder coordinator record + SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); +COMMIT; --- adding localhost workers is ok -SELECT 1 FROM master_add_node('localhost', :worker_1_port); +BEGIN; + -- we should not enable MX for this temporary node just because + -- it'd spawn a bg worker targeting this node + -- and that changes the connection count specific tests + -- here + SET LOCAL citus.enable_metadata_sync_by_default TO OFF; + -- adding localhost workers is ok + SELECT 1 FROM master_add_node('localhost', :worker_1_port); +COMMIT; + +-- we don't need this node anymore SELECT 1 FROM master_remove_node('localhost', :worker_1_port); -- set the coordinator host to something different than localhost SELECT 1 FROM citus_set_coordinator_host('127.0.0.1'); --- adding workers with specific IP is ok now -SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); +BEGIN; + -- we should not enable MX for this temporary node just because + -- it'd spawn a bg worker targeting this node + -- and that changes the connection count specific tests + -- here + SET LOCAL citus.enable_metadata_sync_by_default TO OFF; + -- adding workers with specific IP is ok now + SELECT 1 FROM master_add_node('127.0.0.1', :worker_1_port); +COMMIT; + +-- we don't need this node anymore SELECT 1 FROM master_remove_node('127.0.0.1', :worker_1_port); -- set the coordinator host back to localhost for the remainder of tests