From 1961add6f9fc43be46282486f6a8c16df809ee47 Mon Sep 17 00:00:00 2001 From: Brian Cloutier Date: Thu, 10 Aug 2017 12:13:40 +0300 Subject: [PATCH] Improve error message when there are no nodes for a placement --- src/backend/distributed/utils/metadata_cache.c | 5 ++--- src/test/regress/expected/multi_cluster_management.out | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/backend/distributed/utils/metadata_cache.c b/src/backend/distributed/utils/metadata_cache.c index b35606f1c..b7e0ba07a 100644 --- a/src/backend/distributed/utils/metadata_cache.c +++ b/src/backend/distributed/utils/metadata_cache.c @@ -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) diff --git a/src/test/regress/expected/multi_cluster_management.out b/src/test/regress/expected/multi_cluster_management.out index 0732a5773..4a3742748 100644 --- a/src/test/regress/expected/multi_cluster_management.out +++ b/src/test/regress/expected/multi_cluster_management.out @@ -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;