From 3673e7e3ec68973a4dc2c63414701509a4243655 Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Sun, 5 Apr 2026 13:15:04 +0300 Subject: [PATCH 1/8] fix bug #8470 citus_activate_node with secondary nodes is not activate --- .../distributed/metadata/node_metadata.c | 68 +++++++++++++++ .../check_activate_secondary_node.out | 84 +++++++++++++++++++ src/test/regress/multi_follower_schedule | 1 + .../sql/check_activate_secondary_node.sql | 44 ++++++++++ 4 files changed, 197 insertions(+) create mode 100644 src/test/regress/expected/check_activate_secondary_node.out create mode 100644 src/test/regress/sql/check_activate_secondary_node.sql diff --git a/src/backend/distributed/metadata/node_metadata.c b/src/backend/distributed/metadata/node_metadata.c index e662dca8d3a..566415b188a 100644 --- a/src/backend/distributed/metadata/node_metadata.c +++ b/src/backend/distributed/metadata/node_metadata.c @@ -147,6 +147,7 @@ static BackgroundWorkerHandle * LockPlacementsWithBackgroundWorkersInPrimaryNode static int32 CitusAddCloneNode(WorkerNode *primaryWorkerNode, char *cloneHostname, int32 clonePort); static void RemoveCloneNode(WorkerNode *cloneNode); +static void ActivateNode(WorkerNode *acivateNode); /* Function definitions go here */ @@ -787,6 +788,11 @@ citus_activate_node(PG_FUNCTION_ARGS) if (NodeIsSecondary(workerNode)) { EnsureTransactionalMetadataSyncMode(); + + ActivateNode(workerNode); + TransactionModifiedNodeMetadata = true; + + PG_RETURN_INT32(workerNode->nodeId); } /* @@ -3720,3 +3726,65 @@ SyncNodeMetadata(MetadataSyncContext *context) */ SendOrCollectCommandListToActivatedNodes(context, recreateNodeSnapshotCommandList); } + + +/* + * ActivateNode It sets the node's isactive value to active with transactional + * mode. + */ +static void +ActivateNode(WorkerNode *acivateNode) +{ + const bool indexOK = true; + + Relation pgDistNode = table_open(DistNodeRelationId(), RowExclusiveLock); + TupleDesc tupleDescriptor = RelationGetDescr(pgDistNode); + + ScanKeyData scanKey[1]; + + + Datum *values = palloc0(tupleDescriptor->natts * sizeof(Datum)); + bool *isnull = palloc0(tupleDescriptor->natts * sizeof(bool)); + bool *replace = palloc0(tupleDescriptor->natts * sizeof(bool)); + + ScanKeyInit(&scanKey[0], Anum_pg_dist_node_nodeid, + BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(acivateNode->nodeId)); + + SysScanDesc scanDescriptor = systable_beginscan(pgDistNode, DistNodeNodeIdIndexId(), + indexOK, + NULL, 1, scanKey); + + HeapTuple heapTuple = systable_getnext(scanDescriptor); + if (!HeapTupleIsValid(heapTuple)) + { + ereport(ERROR, (errmsg("could not find valid entry for node \"%s:%d\"", + acivateNode->workerName, acivateNode->workerPort))); + } + + values[Anum_pg_dist_node_isactive - 1] = BoolGetDatum(true); + isnull[Anum_pg_dist_node_isactive - 1] = false; + replace[Anum_pg_dist_node_isactive - 1] = true; + + + heapTuple = heap_modify_tuple(heapTuple, tupleDescriptor, values, isnull, replace); + + CatalogTupleUpdate(pgDistNode, &heapTuple->t_self, heapTuple); + + CitusInvalidateRelcacheByRelid(DistNodeRelationId()); + + CommandCounterIncrement(); + + if (EnableMetadataSync) + { + /* send the update command to all primary nodes with metadata */ + char *nodeUpdateCommand = NodeStateUpdateCommand(acivateNode->nodeId, true); + SendCommandToWorkersWithMetadata(nodeUpdateCommand); + } + + systable_endscan(scanDescriptor); + table_close(pgDistNode, NoLock); + + pfree(values); + pfree(isnull); + pfree(replace); +} diff --git a/src/test/regress/expected/check_activate_secondary_node.out b/src/test/regress/expected/check_activate_secondary_node.out new file mode 100644 index 00000000000..5c03b8c4c74 --- /dev/null +++ b/src/test/regress/expected/check_activate_secondary_node.out @@ -0,0 +1,84 @@ +\c - - - :master_port +-- prepare testing +SELECT citus_set_coordinator_host('localhost', :master_port); + citus_set_coordinator_host +--------------------------------------------------------------------- + +(1 row) + +SET citus.metadata_sync_mode TO 'transactional'; +-- add inactive secondary node +SELECT 1 FROM citus_add_secondary_node('localhost', :follower_worker_2_port, 'localhost', :worker_2_port); + ?column? +--------------------------------------------------------------------- + 1 +(1 row) + +SELECT 1 FROM citus_disable_node('localhost', :follower_worker_2_port); + ?column? +--------------------------------------------------------------------- + 1 +(1 row) + +-- check inactive node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND NOT isactive; + count +--------------------------------------------------------------------- + 1 +(1 row) + +SELECT start_metadata_sync_to_all_nodes(); + start_metadata_sync_to_all_nodes +--------------------------------------------------------------------- + t +(1 row) + +\c - - - :worker_2_port +-- check inactive node on worker +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND NOT isactive; + count +--------------------------------------------------------------------- + 1 +(1 row) + +\c - - - :master_port +-- main test: activate secondary node +SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); + ?column? +--------------------------------------------------------------------- + 1 +(1 row) + +-- check is active node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND isactive; + count +--------------------------------------------------------------------- + 1 +(1 row) + +\c - - - :worker_2_port +-- check is active node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND isactive; + count +--------------------------------------------------------------------- + 1 +(1 row) + +\c - - - :worker_1_port +-- check active node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND isactive; + count +--------------------------------------------------------------------- + 1 +(1 row) + +\c - - - :master_port +SET citus.metadata_sync_mode TO 'nontransactional'; +-- error this operation cannot be completed in nontransactional metadata sync mode if the GUC citus.metadata_sync_mode set to 'nontransactional' +SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); +ERROR: this operation cannot be completed in nontransactional metadata sync mode +HINT: SET citus.metadata_sync_mode to 'transactional' +SET citus.metadata_sync_mode TO 'transactional'; +-- error because the node does not exist +SELECT 1 FROM citus_activate_node('localhost', 7777); +ERROR: node at "localhost:xxxxx" does not exist diff --git a/src/test/regress/multi_follower_schedule b/src/test/regress/multi_follower_schedule index 3b7ea622524..51c47d9ea5a 100644 --- a/src/test/regress/multi_follower_schedule +++ b/src/test/regress/multi_follower_schedule @@ -8,3 +8,4 @@ test: multi_add_node_from_backup_sync_replica # test that no tests leaked intermediate results. This should always be last test: ensure_no_intermediate_data_leak test: check_mx +test: check_activate_secondary_node diff --git a/src/test/regress/sql/check_activate_secondary_node.sql b/src/test/regress/sql/check_activate_secondary_node.sql new file mode 100644 index 00000000000..d90b094ae46 --- /dev/null +++ b/src/test/regress/sql/check_activate_secondary_node.sql @@ -0,0 +1,44 @@ +\c - - - :master_port +-- prepare testing +SELECT citus_set_coordinator_host('localhost', :master_port); +SET citus.metadata_sync_mode TO 'transactional'; + +-- add inactive secondary node +SELECT 1 FROM citus_add_secondary_node('localhost', :follower_worker_2_port, 'localhost', :worker_2_port); +SELECT 1 FROM citus_disable_node('localhost', :follower_worker_2_port); + +-- check inactive node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND NOT isactive; +SELECT start_metadata_sync_to_all_nodes(); + + +\c - - - :worker_2_port +-- check inactive node on worker +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND NOT isactive; + +\c - - - :master_port + +-- main test: activate secondary node +SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); + + +-- check is active node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND isactive; + +\c - - - :worker_2_port +-- check is active node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND isactive; + +\c - - - :worker_1_port +-- check active node +SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND isactive; + +\c - - - :master_port +SET citus.metadata_sync_mode TO 'nontransactional'; + +-- error this operation cannot be completed in nontransactional metadata sync mode if the GUC citus.metadata_sync_mode set to 'nontransactional' +SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); + +SET citus.metadata_sync_mode TO 'transactional'; +-- error because the node does not exist +SELECT 1 FROM citus_activate_node('localhost', 7777); From e96b13d06f4b4db1bd794eabc96eb112750823e4 Mon Sep 17 00:00:00 2001 From: Kalendarev Alexandre Date: Mon, 6 Apr 2026 17:14:56 +0300 Subject: [PATCH 2/8] codestyle --- src/backend/distributed/metadata/node_metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/distributed/metadata/node_metadata.c b/src/backend/distributed/metadata/node_metadata.c index 566415b188a..4f3bbc3a1fd 100644 --- a/src/backend/distributed/metadata/node_metadata.c +++ b/src/backend/distributed/metadata/node_metadata.c @@ -3776,7 +3776,7 @@ ActivateNode(WorkerNode *acivateNode) if (EnableMetadataSync) { - /* send the update command to all primary nodes with metadata */ + /* Send the update command to all primary nodes with metadata */ char *nodeUpdateCommand = NodeStateUpdateCommand(acivateNode->nodeId, true); SendCommandToWorkersWithMetadata(nodeUpdateCommand); } From fd60e7c30ae26aa907b1cee58b6a6d0aa1f87799 Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Mon, 6 Apr 2026 22:44:19 +0300 Subject: [PATCH 3/8] fix codestyle --- src/backend/distributed/metadata/node_metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/distributed/metadata/node_metadata.c b/src/backend/distributed/metadata/node_metadata.c index 4f3bbc3a1fd..2a4f4ba3c3a 100644 --- a/src/backend/distributed/metadata/node_metadata.c +++ b/src/backend/distributed/metadata/node_metadata.c @@ -3729,7 +3729,7 @@ SyncNodeMetadata(MetadataSyncContext *context) /* - * ActivateNode It sets the node's isactive value to active with transactional + * ActivateNode It sets the node's isactive value to active with transactional * mode. */ static void From d43b4d344af8824332a88d73c70a85b0a1d75a53 Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Mon, 6 Apr 2026 23:00:33 +0300 Subject: [PATCH 4/8] codestyle --- src/test/regress/sql/check_activate_secondary_node.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/regress/sql/check_activate_secondary_node.sql b/src/test/regress/sql/check_activate_secondary_node.sql index d90b094ae46..97850fb6fd5 100644 --- a/src/test/regress/sql/check_activate_secondary_node.sql +++ b/src/test/regress/sql/check_activate_secondary_node.sql @@ -40,5 +40,6 @@ SET citus.metadata_sync_mode TO 'nontransactional'; SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); SET citus.metadata_sync_mode TO 'transactional'; --- error because the node does not exist + +-- error because the node does not exist SELECT 1 FROM citus_activate_node('localhost', 7777); From a19ce5246e078938d8f33e5ef2298f39ced81b18 Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Wed, 8 Apr 2026 20:13:40 +0300 Subject: [PATCH 5/8] codestyle --- src/test/regress/sql/check_activate_secondary_node.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/regress/sql/check_activate_secondary_node.sql b/src/test/regress/sql/check_activate_secondary_node.sql index 97850fb6fd5..6818d6d730f 100644 --- a/src/test/regress/sql/check_activate_secondary_node.sql +++ b/src/test/regress/sql/check_activate_secondary_node.sql @@ -1,6 +1,7 @@ \c - - - :master_port -- prepare testing SELECT citus_set_coordinator_host('localhost', :master_port); + SET citus.metadata_sync_mode TO 'transactional'; -- add inactive secondary node From 2115d83247a8e050de3683bb90f9c7c3b4b1038e Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Wed, 8 Apr 2026 20:37:39 +0300 Subject: [PATCH 6/8] codestyle --- src/test/regress/expected/check_activate_secondary_node.out | 3 ++- src/test/regress/sql/check_activate_secondary_node.sql | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/regress/expected/check_activate_secondary_node.out b/src/test/regress/expected/check_activate_secondary_node.out index 5c03b8c4c74..7f12a33772c 100644 --- a/src/test/regress/expected/check_activate_secondary_node.out +++ b/src/test/regress/expected/check_activate_secondary_node.out @@ -74,7 +74,8 @@ SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nod \c - - - :master_port SET citus.metadata_sync_mode TO 'nontransactional'; --- error this operation cannot be completed in nontransactional metadata sync mode if the GUC citus.metadata_sync_mode set to 'nontransactional' +-- error this operation cannot be completed in nontransactional metadata sync mode +-- if the GUC citus.metadata_sync_mode set to 'nontransactional' SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); ERROR: this operation cannot be completed in nontransactional metadata sync mode HINT: SET citus.metadata_sync_mode to 'transactional' diff --git a/src/test/regress/sql/check_activate_secondary_node.sql b/src/test/regress/sql/check_activate_secondary_node.sql index 6818d6d730f..76448c4d9bc 100644 --- a/src/test/regress/sql/check_activate_secondary_node.sql +++ b/src/test/regress/sql/check_activate_secondary_node.sql @@ -37,7 +37,8 @@ SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nod \c - - - :master_port SET citus.metadata_sync_mode TO 'nontransactional'; --- error this operation cannot be completed in nontransactional metadata sync mode if the GUC citus.metadata_sync_mode set to 'nontransactional' +-- error this operation cannot be completed in nontransactional metadata sync mode +-- if the GUC citus.metadata_sync_mode set to 'nontransactional' SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); SET citus.metadata_sync_mode TO 'transactional'; From 0ce4ac5b837a8c1527c7484fed04232772bb4dc8 Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Wed, 8 Apr 2026 20:43:23 +0300 Subject: [PATCH 7/8] codestyle --- .../regress/expected/check_activate_secondary_node.out | 7 +++---- src/test/regress/sql/check_activate_secondary_node.sql | 8 +++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/test/regress/expected/check_activate_secondary_node.out b/src/test/regress/expected/check_activate_secondary_node.out index 7f12a33772c..4a93f0b6827 100644 --- a/src/test/regress/expected/check_activate_secondary_node.out +++ b/src/test/regress/expected/check_activate_secondary_node.out @@ -33,6 +33,9 @@ SELECT start_metadata_sync_to_all_nodes(); t (1 row) +-- error because the node does not exist +SELECT 1 FROM citus_activate_node('localhost', 7777); +ERROR: node at "localhost:xxxxx" does not exist \c - - - :worker_2_port -- check inactive node on worker SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND NOT isactive; @@ -79,7 +82,3 @@ SET citus.metadata_sync_mode TO 'nontransactional'; SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); ERROR: this operation cannot be completed in nontransactional metadata sync mode HINT: SET citus.metadata_sync_mode to 'transactional' -SET citus.metadata_sync_mode TO 'transactional'; --- error because the node does not exist -SELECT 1 FROM citus_activate_node('localhost', 7777); -ERROR: node at "localhost:xxxxx" does not exist diff --git a/src/test/regress/sql/check_activate_secondary_node.sql b/src/test/regress/sql/check_activate_secondary_node.sql index 76448c4d9bc..826049d9218 100644 --- a/src/test/regress/sql/check_activate_secondary_node.sql +++ b/src/test/regress/sql/check_activate_secondary_node.sql @@ -12,6 +12,9 @@ SELECT 1 FROM citus_disable_node('localhost', :follower_worker_2_port); SELECT count(*) FROM pg_dist_node WHERE nodeport=:follower_worker_2_port AND nodename='localhost' AND NOT isactive; SELECT start_metadata_sync_to_all_nodes(); +-- error because the node does not exist +SELECT 1 FROM citus_activate_node('localhost', 7777); + \c - - - :worker_2_port -- check inactive node on worker @@ -40,8 +43,3 @@ SET citus.metadata_sync_mode TO 'nontransactional'; -- error this operation cannot be completed in nontransactional metadata sync mode -- if the GUC citus.metadata_sync_mode set to 'nontransactional' SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); - -SET citus.metadata_sync_mode TO 'transactional'; - --- error because the node does not exist -SELECT 1 FROM citus_activate_node('localhost', 7777); From dc6545ca7b10aea792f1c5249fd3067bd5025a70 Mon Sep 17 00:00:00 2001 From: Alexandre Kalendarev Date: Wed, 15 Apr 2026 20:00:26 +0300 Subject: [PATCH 8/8] fixed the code and tests --- .../distributed/metadata/node_metadata.c | 66 +------------------ .../check_activate_secondary_node.out | 14 ++++ src/test/regress/multi_follower_schedule | 2 +- .../sql/check_activate_secondary_node.sql | 7 ++ 4 files changed, 24 insertions(+), 65 deletions(-) diff --git a/src/backend/distributed/metadata/node_metadata.c b/src/backend/distributed/metadata/node_metadata.c index 2a4f4ba3c3a..eaec1857801 100644 --- a/src/backend/distributed/metadata/node_metadata.c +++ b/src/backend/distributed/metadata/node_metadata.c @@ -147,7 +147,6 @@ static BackgroundWorkerHandle * LockPlacementsWithBackgroundWorkersInPrimaryNode static int32 CitusAddCloneNode(WorkerNode *primaryWorkerNode, char *cloneHostname, int32 clonePort); static void RemoveCloneNode(WorkerNode *cloneNode); -static void ActivateNode(WorkerNode *acivateNode); /* Function definitions go here */ @@ -789,7 +788,8 @@ citus_activate_node(PG_FUNCTION_ARGS) { EnsureTransactionalMetadataSyncMode(); - ActivateNode(workerNode); + SetWorkerColumn(workerNode, Anum_pg_dist_node_isactive, BoolGetDatum(true)); + TransactionModifiedNodeMetadata = true; PG_RETURN_INT32(workerNode->nodeId); @@ -3726,65 +3726,3 @@ SyncNodeMetadata(MetadataSyncContext *context) */ SendOrCollectCommandListToActivatedNodes(context, recreateNodeSnapshotCommandList); } - - -/* - * ActivateNode It sets the node's isactive value to active with transactional - * mode. - */ -static void -ActivateNode(WorkerNode *acivateNode) -{ - const bool indexOK = true; - - Relation pgDistNode = table_open(DistNodeRelationId(), RowExclusiveLock); - TupleDesc tupleDescriptor = RelationGetDescr(pgDistNode); - - ScanKeyData scanKey[1]; - - - Datum *values = palloc0(tupleDescriptor->natts * sizeof(Datum)); - bool *isnull = palloc0(tupleDescriptor->natts * sizeof(bool)); - bool *replace = palloc0(tupleDescriptor->natts * sizeof(bool)); - - ScanKeyInit(&scanKey[0], Anum_pg_dist_node_nodeid, - BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(acivateNode->nodeId)); - - SysScanDesc scanDescriptor = systable_beginscan(pgDistNode, DistNodeNodeIdIndexId(), - indexOK, - NULL, 1, scanKey); - - HeapTuple heapTuple = systable_getnext(scanDescriptor); - if (!HeapTupleIsValid(heapTuple)) - { - ereport(ERROR, (errmsg("could not find valid entry for node \"%s:%d\"", - acivateNode->workerName, acivateNode->workerPort))); - } - - values[Anum_pg_dist_node_isactive - 1] = BoolGetDatum(true); - isnull[Anum_pg_dist_node_isactive - 1] = false; - replace[Anum_pg_dist_node_isactive - 1] = true; - - - heapTuple = heap_modify_tuple(heapTuple, tupleDescriptor, values, isnull, replace); - - CatalogTupleUpdate(pgDistNode, &heapTuple->t_self, heapTuple); - - CitusInvalidateRelcacheByRelid(DistNodeRelationId()); - - CommandCounterIncrement(); - - if (EnableMetadataSync) - { - /* Send the update command to all primary nodes with metadata */ - char *nodeUpdateCommand = NodeStateUpdateCommand(acivateNode->nodeId, true); - SendCommandToWorkersWithMetadata(nodeUpdateCommand); - } - - systable_endscan(scanDescriptor); - table_close(pgDistNode, NoLock); - - pfree(values); - pfree(isnull); - pfree(replace); -} diff --git a/src/test/regress/expected/check_activate_secondary_node.out b/src/test/regress/expected/check_activate_secondary_node.out index 4a93f0b6827..7849e3adc8c 100644 --- a/src/test/regress/expected/check_activate_secondary_node.out +++ b/src/test/regress/expected/check_activate_secondary_node.out @@ -82,3 +82,17 @@ SET citus.metadata_sync_mode TO 'nontransactional'; SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); ERROR: this operation cannot be completed in nontransactional metadata sync mode HINT: SET citus.metadata_sync_mode to 'transactional' +-- remove checked nodes +SET citus.metadata_sync_mode TO 'transactional'; +SELECT citus_remove_node('localhost', :follower_worker_2_port); + citus_remove_node +--------------------------------------------------------------------- + +(1 row) + +SELECT citus_remove_node('localhost', :master_port); + citus_remove_node +--------------------------------------------------------------------- + +(1 row) + diff --git a/src/test/regress/multi_follower_schedule b/src/test/regress/multi_follower_schedule index 51c47d9ea5a..92ac689a5cc 100644 --- a/src/test/regress/multi_follower_schedule +++ b/src/test/regress/multi_follower_schedule @@ -4,8 +4,8 @@ test: multi_follower_select_statements test: multi_follower_dml test: multi_follower_configure_followers test: multi_add_node_from_backup_sync_replica +test: check_activate_secondary_node # test that no tests leaked intermediate results. This should always be last test: ensure_no_intermediate_data_leak test: check_mx -test: check_activate_secondary_node diff --git a/src/test/regress/sql/check_activate_secondary_node.sql b/src/test/regress/sql/check_activate_secondary_node.sql index 826049d9218..93062c09aaf 100644 --- a/src/test/regress/sql/check_activate_secondary_node.sql +++ b/src/test/regress/sql/check_activate_secondary_node.sql @@ -1,4 +1,5 @@ \c - - - :master_port + -- prepare testing SELECT citus_set_coordinator_host('localhost', :master_port); @@ -43,3 +44,9 @@ SET citus.metadata_sync_mode TO 'nontransactional'; -- error this operation cannot be completed in nontransactional metadata sync mode -- if the GUC citus.metadata_sync_mode set to 'nontransactional' SELECT 1 FROM citus_activate_node('localhost', :follower_worker_2_port); + + +-- remove checked nodes +SET citus.metadata_sync_mode TO 'transactional'; +SELECT citus_remove_node('localhost', :follower_worker_2_port); +SELECT citus_remove_node('localhost', :master_port);