mirror of https://github.com/citusdata/citus.git
master_disable_node no longer crashes when given a non-existant node
parent
8229a64fe8
commit
37985de85e
|
@ -205,6 +205,10 @@ master_disable_node(PG_FUNCTION_ARGS)
|
||||||
CheckCitusVersion(ERROR);
|
CheckCitusVersion(ERROR);
|
||||||
|
|
||||||
workerNode = FindWorkerNode(nodeName, nodePort);
|
workerNode = FindWorkerNode(nodeName, nodePort);
|
||||||
|
if (workerNode == NULL)
|
||||||
|
{
|
||||||
|
ereport(ERROR, (errmsg("node at \"%s:%u\" does not exist", nodeName, nodePort)));
|
||||||
|
}
|
||||||
|
|
||||||
if (WorkerNodeIsPrimary(workerNode))
|
if (WorkerNodeIsPrimary(workerNode))
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,6 +136,9 @@ SELECT master_get_active_worker_nodes();
|
||||||
(localhost,57637)
|
(localhost,57637)
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
-- try to disable a node which does not exist and see that an error is thrown
|
||||||
|
SELECT master_disable_node('localhost.noexist', 2345);
|
||||||
|
ERROR: node at "localhost.noexist:2345" does not exist
|
||||||
-- restore the node for next tests
|
-- restore the node for next tests
|
||||||
SELECT master_activate_node('localhost', :worker_2_port);
|
SELECT master_activate_node('localhost', :worker_2_port);
|
||||||
master_activate_node
|
master_activate_node
|
||||||
|
|
|
@ -52,6 +52,9 @@ INSERT INTO test_reference_table VALUES (1, '1');
|
||||||
SELECT master_disable_node('localhost', :worker_2_port);
|
SELECT master_disable_node('localhost', :worker_2_port);
|
||||||
SELECT master_get_active_worker_nodes();
|
SELECT master_get_active_worker_nodes();
|
||||||
|
|
||||||
|
-- try to disable a node which does not exist and see that an error is thrown
|
||||||
|
SELECT master_disable_node('localhost.noexist', 2345);
|
||||||
|
|
||||||
-- restore the node for next tests
|
-- restore the node for next tests
|
||||||
SELECT master_activate_node('localhost', :worker_2_port);
|
SELECT master_activate_node('localhost', :worker_2_port);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue