mirror of https://github.com/citusdata/citus.git
Fix CloseNodeConnections to actually close connections
CloseNodeConnections() is supposed to close connections to a given node. However, before this commit it lacks to actually call PQFinish() on the connections. Using CloseConnection() handles closing and all other necessary actions.pull/1115/head
parent
2435cdb5d1
commit
cd8e41bb79
|
@ -333,12 +333,7 @@ CloseNodeConnections(char *nodeName, int nodePort)
|
||||||
MultiConnection *connection =
|
MultiConnection *connection =
|
||||||
dlist_container(MultiConnection, connectionNode, currentNode);
|
dlist_container(MultiConnection, connectionNode, currentNode);
|
||||||
|
|
||||||
/* same for transaction state */
|
CloseConnection(connection);
|
||||||
CloseRemoteTransaction(connection);
|
|
||||||
CloseShardPlacementAssociation(connection);
|
|
||||||
|
|
||||||
/* we leave the per-host entry alive */
|
|
||||||
pfree(connection);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,8 @@ SELECT master_get_active_worker_nodes();
|
||||||
(localhost,57637)
|
(localhost,57637)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
|
-- insert a row so that master_disable_node() exercises closing connections
|
||||||
|
INSERT INTO test_reference_table VALUES (1, '1');
|
||||||
-- 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);
|
||||||
|
|
|
@ -45,6 +45,9 @@ SELECT shardid, shardstate, nodename, nodeport FROM pg_dist_shard_placement WHER
|
||||||
SELECT master_remove_node('localhost', :worker_2_port);
|
SELECT master_remove_node('localhost', :worker_2_port);
|
||||||
SELECT master_get_active_worker_nodes();
|
SELECT master_get_active_worker_nodes();
|
||||||
|
|
||||||
|
-- insert a row so that master_disable_node() exercises closing connections
|
||||||
|
INSERT INTO test_reference_table VALUES (1, '1');
|
||||||
|
|
||||||
-- 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