Merge pull request #1115 from citusdata/fix_remove_node

Fix CloseNodeConnections to actually close connections
pull/1112/head
Önder Kalacı 2017-01-11 01:21:21 +02:00 committed by GitHub
commit 8624ef5ac4
3 changed files with 6 additions and 6 deletions

View File

@ -333,12 +333,7 @@ CloseNodeConnections(char *nodeName, int nodePort)
MultiConnection *connection =
dlist_container(MultiConnection, connectionNode, currentNode);
/* same for transaction state */
CloseRemoteTransaction(connection);
CloseShardPlacementAssociation(connection);
/* we leave the per-host entry alive */
pfree(connection);
CloseConnection(connection);
}
}
}

View File

@ -121,6 +121,8 @@ SELECT master_get_active_worker_nodes();
(localhost,57637)
(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
-- observe that a notification is displayed
SELECT master_disable_node('localhost', :worker_2_port);

View File

@ -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_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
-- observe that a notification is displayed
SELECT master_disable_node('localhost', :worker_2_port);