From beaf692c43392328673d94c35fdbdcb07d49be3c Mon Sep 17 00:00:00 2001 From: EmelSimsek Date: Wed, 7 Jun 2023 04:44:16 +0300 Subject: [PATCH] Fix tests --- .../regress/expected/background_rebalance.out | 30 ++++++++----------- src/test/regress/sql/background_rebalance.sql | 9 ++---- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/test/regress/expected/background_rebalance.out b/src/test/regress/expected/background_rebalance.out index c10b43f78..c7db3d77a 100644 --- a/src/test/regress/expected/background_rebalance.out +++ b/src/test/regress/expected/background_rebalance.out @@ -313,7 +313,13 @@ SELECT create_reference_table('ref_table'); (1 row) -- add a new node to trigger replicate_reference_tables task -SELECT 1 FROM citus_add_node('localhost', :worker_3_port); +SELECT 1 FROM citus_set_coordinator_host('localhost'); + ?column? +--------------------------------------------------------------------- + 1 +(1 row) + +SELECT 1 FROM master_set_node_property('localhost', :master_port, 'shouldhaveshards', true); ?column? --------------------------------------------------------------------- 1 @@ -343,22 +349,12 @@ SELECT state, details from citus_rebalance_status(); (1 row) RESET ROLE; --- reset the the number of nodes by removing the previously added node -SELECT 1 FROM citus_drain_node('localhost', :worker_3_port); -NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ... - ?column? ---------------------------------------------------------------------- - 1 -(1 row) - -CALL citus_cleanup_orphaned_resources(); -NOTICE: cleaned up 1 orphaned resources -SELECT 1 FROM citus_remove_node('localhost', :worker_3_port); - ?column? ---------------------------------------------------------------------- - 1 -(1 row) - SET client_min_messages TO WARNING; DROP SCHEMA background_rebalance CASCADE; DROP USER non_super_user_rebalance; +SELECT 1 FROM citus_remove_node('localhost', :master_port); + ?column? +--------------------------------------------------------------------- + 1 +(1 row) + diff --git a/src/test/regress/sql/background_rebalance.sql b/src/test/regress/sql/background_rebalance.sql index eb38deee9..c0827b299 100644 --- a/src/test/regress/sql/background_rebalance.sql +++ b/src/test/regress/sql/background_rebalance.sql @@ -113,7 +113,8 @@ CREATE TABLE ref_table(a int primary key); SELECT create_reference_table('ref_table'); -- add a new node to trigger replicate_reference_tables task -SELECT 1 FROM citus_add_node('localhost', :worker_3_port); +SELECT 1 FROM citus_set_coordinator_host('localhost'); +SELECT 1 FROM master_set_node_property('localhost', :master_port, 'shouldhaveshards', true); SET ROLE non_super_user_rebalance; SELECT 1 FROM citus_rebalance_start(shard_transfer_mode := 'force_logical'); @@ -124,11 +125,7 @@ SELECT state, details from citus_rebalance_status(); RESET ROLE; --- reset the the number of nodes by removing the previously added node -SELECT 1 FROM citus_drain_node('localhost', :worker_3_port); -CALL citus_cleanup_orphaned_resources(); -SELECT 1 FROM citus_remove_node('localhost', :worker_3_port); - SET client_min_messages TO WARNING; DROP SCHEMA background_rebalance CASCADE; DROP USER non_super_user_rebalance; +SELECT 1 FROM citus_remove_node('localhost', :master_port);