From 903489c76331693f9cf2c1e774c71225fb467ead Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Mon, 19 Jul 2021 14:38:52 +0200 Subject: [PATCH] Improve wording of an error message --- src/backend/distributed/metadata/metadata_sync.c | 4 ++-- src/test/regress/expected/metadata_sync_helpers.out | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/distributed/metadata/metadata_sync.c b/src/backend/distributed/metadata/metadata_sync.c index 28e54b33b..82f4fdf61 100644 --- a/src/backend/distributed/metadata/metadata_sync.c +++ b/src/backend/distributed/metadata/metadata_sync.c @@ -2256,8 +2256,8 @@ EnsureCoordinatorInitiatedOperation(void) GetLocalGroupId() == COORDINATOR_GROUP_ID) { ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("This is an internal function that only Citus " - "requires to use in a distributed transaction"))); + errmsg("This is an internal Citus function can only be " + "used in a distributed transaction"))); } } diff --git a/src/test/regress/expected/metadata_sync_helpers.out b/src/test/regress/expected/metadata_sync_helpers.out index a22a596c4..ff3594c77 100644 --- a/src/test/regress/expected/metadata_sync_helpers.out +++ b/src/test/regress/expected/metadata_sync_helpers.out @@ -13,7 +13,7 @@ SET search_path TO metadata_sync_helpers; CREATE TABLE test(col_1 int); -- not in a distributed transaction SELECT citus_internal_add_partition_metadata ('test'::regclass, 'h', 'col_1', 0, 's'); -ERROR: This is an internal function that only Citus requires to use in a distributed transaction +ERROR: This is an internal Citus function can only be used in a distributed transaction -- in a distributed transaction, but the application name is not Citus BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; SELECT assign_distributed_transaction_id(0, 8, '2021-07-09 15:41:55.542377+02'); @@ -23,7 +23,7 @@ BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; (1 row) SELECT citus_internal_add_partition_metadata ('test'::regclass, 'h', 'col_1', 0, 's'); -ERROR: This is an internal function that only Citus requires to use in a distributed transaction +ERROR: This is an internal Citus function can only be used in a distributed transaction ROLLBACK; -- in a distributed transaction and the application name is Citus -- but we are on the coordinator, so still not allowed @@ -36,7 +36,7 @@ BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; SET application_name to 'citus'; SELECT citus_internal_add_partition_metadata ('test'::regclass, 'h', 'col_1', 0, 's'); -ERROR: This is an internal function that only Citus requires to use in a distributed transaction +ERROR: This is an internal Citus function can only be used in a distributed transaction ROLLBACK; -- connect back as super user, and then connect to the worker -- with the superuser to make sure we can ingest metadata with @@ -908,7 +908,7 @@ BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; WITH shard_data(shardid) AS (VALUES (1420007)) SELECT citus_internal_delete_shard_metadata(shardid) FROM shard_data; -ERROR: This is an internal function that only Citus requires to use in a distributed transaction +ERROR: This is an internal Citus function can only be used in a distributed transaction ROLLBACK; -- the user cannot delete non-existing shards BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;