mirror of https://github.com/citusdata/citus.git
Only warn about reference tables when removing last node
parent
056005db4d
commit
c03729ad03
|
@ -1292,7 +1292,7 @@ RemoveNodeFromCluster(char *nodeName, int32 nodePort)
|
||||||
}
|
}
|
||||||
if (NodeGroupHasLivePlacements(workerNode->groupId))
|
if (NodeGroupHasLivePlacements(workerNode->groupId))
|
||||||
{
|
{
|
||||||
if (ClusterHasReferenceTable())
|
if (ActivePrimaryNodeCount() == 1 && ClusterHasReferenceTable())
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg(
|
ereport(ERROR, (errmsg(
|
||||||
"cannot remove the last worker node because there are reference "
|
"cannot remove the last worker node because there are reference "
|
||||||
|
|
|
@ -136,6 +136,10 @@ SELECT create_reference_table('test_reference_table');
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
INSERT INTO test_reference_table VALUES (1, '1');
|
INSERT INTO test_reference_table VALUES (1, '1');
|
||||||
|
-- try to remove a node with active placements and reference tables
|
||||||
|
SELECT citus_remove_node('localhost', :worker_2_port);
|
||||||
|
ERROR: cannot remove the primary node of a node group which has shard placements
|
||||||
|
HINT: To proceed, either drop the distributed tables or use undistribute_table() function to convert them to local tables
|
||||||
-- try to disable a node with active placements see that node is removed
|
-- try to disable a node with active placements see that node is removed
|
||||||
-- observe that a notification is displayed
|
-- observe that a notification is displayed
|
||||||
SELECT master_disable_node('localhost', :worker_2_port);
|
SELECT master_disable_node('localhost', :worker_2_port);
|
||||||
|
|
|
@ -54,6 +54,9 @@ CREATE TABLE test_reference_table (y int primary key, name text);
|
||||||
SELECT create_reference_table('test_reference_table');
|
SELECT create_reference_table('test_reference_table');
|
||||||
INSERT INTO test_reference_table VALUES (1, '1');
|
INSERT INTO test_reference_table VALUES (1, '1');
|
||||||
|
|
||||||
|
-- try to remove a node with active placements and reference tables
|
||||||
|
SELECT citus_remove_node('localhost', :worker_2_port);
|
||||||
|
|
||||||
-- try to disable a node with active placements see that node is removed
|
-- try to disable a node with active placements see that node is removed
|
||||||
-- observe that a notification is displayed
|
-- observe that a notification is displayed
|
||||||
SELECT master_disable_node('localhost', :worker_2_port);
|
SELECT master_disable_node('localhost', :worker_2_port);
|
||||||
|
|
Loading…
Reference in New Issue