Improve error message when there are no nodes for a placement

pull/1547/head
Brian Cloutier 2017-08-10 12:13:40 +03:00 committed by Brian Cloutier
parent 4e8d07c672
commit 1961add6f9
2 changed files with 3 additions and 5 deletions

View File

@ -436,9 +436,8 @@ ResolveGroupShardPlacement(GroupShardPlacement *groupShardPlacement,
if (workerNode == NULL && !groupContainsNodes)
{
ereport(ERROR, (errmsg("the metadata is inconsistent"),
errdetail("there is a placement in group %u but "
"there are no nodes in that group", groupId)));
ereport(ERROR, (errmsg("there is a shard placement in node group %u but "
"there are no nodes in that group", groupId)));
}
if (workerNode == NULL && groupContainsNodes)

View File

@ -190,8 +190,7 @@ ERROR: node group 3 does not have a primary node
-- when there is no node at all in the group we should get a different error
DELETE FROM pg_dist_node WHERE nodeport=:worker_2_port;
SELECT * FROM cluster_management_test;
ERROR: the metadata is inconsistent
DETAIL: there is a placement in group 3 but there are no nodes in that group
ERROR: there is a shard placement in node group 3 but there are no nodes in that group
-- clean-up
SELECT groupid as new_group FROM master_add_node('localhost', :worker_2_port) \gset
UPDATE pg_dist_placement SET groupid = :new_group WHERE groupid = :worker_2_group;