Address feedback

pull/1092/head
Murat Tuncer 2017-01-06 12:01:04 +03:00
parent 205f6563fa
commit e35f4c836d
1 changed files with 15 additions and 12 deletions

View File

@ -121,19 +121,22 @@ master_remove_node(PG_FUNCTION_ARGS)
EnsureSuperUser();
hasShardPlacements = NodeHasActiveShardPlacements(nodeNameString, nodePort);
if (hasShardPlacements && force)
if (hasShardPlacements)
{
ereport(NOTICE, (errmsg("Node %s:%d has active shard placements. Some "
"queries may fail after this operation. Use "
"select master_add_node('%s', %d) to add this "
"node back.",
nodeNameString, nodePort, nodeNameString,
nodePort)));
}
else if (hasShardPlacements)
{
ereport(ERROR, (errmsg("you cannot remove a node which has active "
"shard placements")));
if (force)
{
ereport(NOTICE, (errmsg("Node %s:%d has active shard placements. Some "
"queries may fail after this operation. Use "
"select master_add_node('%s', %d) to add this "
"node back.",
nodeNameString, nodePort, nodeNameString,
nodePort)));
}
else
{
ereport(ERROR, (errmsg("you cannot remove a node which has active "
"shard placements")));
}
}
workerNode = FindWorkerNode(nodeNameString, nodePort);