From 9dc6273b88c6800d369a48a5057ad17b6f5fa238 Mon Sep 17 00:00:00 2001 From: Marco Slot Date: Tue, 23 Aug 2022 23:11:15 +0200 Subject: [PATCH] Set application_name to citus_rebalancer when copying reference tables --- src/backend/distributed/utils/reference_table_utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backend/distributed/utils/reference_table_utils.c b/src/backend/distributed/utils/reference_table_utils.c index ead51c786..1411915f3 100644 --- a/src/backend/distributed/utils/reference_table_utils.c +++ b/src/backend/distributed/utils/reference_table_utils.c @@ -244,6 +244,16 @@ EnsureReferenceTablesExistOnAllNodesExtended(char transferMode) CopyShardPlacementToWorkerNodeQuery(sourceShardPlacement, newWorkerNode, transferMode); + + /* + * The placement copy command uses distributed execution to create + * indexes. This is allowed when indicating that the backend is a + * rebalancer backend. + */ + ExecuteCriticalRemoteCommand(connection, + "SET LOCAL application_name TO " + CITUS_REBALANCER_NAME); + ExecuteCriticalRemoteCommand(connection, placementCopyCommand->data); RemoteTransactionCommit(connection); }