From 15290bc43b8ed98a48bae8ff7636dc2085f1de68 Mon Sep 17 00:00:00 2001 From: SaitTalhaNisanci Date: Fri, 10 Jul 2020 13:45:55 +0300 Subject: [PATCH] remove unused worker methods (#4017) --- .../transaction/worker_transaction.c | 68 ------------------- src/include/distributed/worker_transaction.h | 3 - 2 files changed, 71 deletions(-) diff --git a/src/backend/distributed/transaction/worker_transaction.c b/src/backend/distributed/transaction/worker_transaction.c index 0c0dad87d..1415e1d4a 100644 --- a/src/backend/distributed/transaction/worker_transaction.c +++ b/src/backend/distributed/transaction/worker_transaction.c @@ -43,8 +43,6 @@ static void SendCommandToWorkersParamsInternal(TargetWorkerSet targetWorkerSet, const Oid *parameterTypes, const char *const *parameterValues); static void ErrorIfAnyMetadataNodeOutOfSync(List *metadataNodeList); -static void SendCommandListToAllWorkersInternal(List *commandList, bool failOnError, - const char *superuser); static List * OpenConnectionsToWorkersInParallel(TargetWorkerSet targetWorkerSet, const char *user); static void GetConnectionsResults(List *connectionList, bool failOnError); @@ -125,72 +123,6 @@ SendCommandToWorkersWithMetadata(const char *command) } -/* - * SendCommandToAllWorkers sends the given command to - * all workers as a superuser. - */ -void -SendCommandToAllWorkers(const char *command, const char *superuser) -{ - SendCommandListToAllWorkers(list_make1((char *) command), superuser); -} - - -/* - * SendCommandListToAllWorkers sends the given command to all workers in - * a single transaction. - */ -void -SendCommandListToAllWorkers(List *commandList, const char *superuser) -{ - SendCommandListToAllWorkersInternal(commandList, true, superuser); -} - - -/* - * SendCommandListToAllWorkersInternal sends the given command to all workers in a single - * transaction as a superuser. If failOnError is false, then it continues sending the commandList to other - * workers even if it fails in one of them. - */ -static void -SendCommandListToAllWorkersInternal(List *commandList, bool failOnError, const - char *superuser) -{ - List *workerNodeList = ActivePrimaryNonCoordinatorNodeList(NoLock); - - WorkerNode *workerNode = NULL; - foreach_ptr(workerNode, workerNodeList) - { - if (failOnError) - { - SendCommandListToWorkerInSingleTransaction(workerNode->workerName, - workerNode->workerPort, - superuser, - commandList); - } - else - { - SendOptionalCommandListToWorkerInTransaction(workerNode->workerName, - workerNode->workerPort, - superuser, - commandList); - } - } -} - - -/* - * SendOptionalCommandListToAllWorkers sends the given command to all works in - * a single transaction as a superuser. If there is an error during the command, it is ignored - * so this method doesnt return any error. - */ -void -SendOptionalCommandListToAllWorkers(List *commandList, const char *superuser) -{ - SendCommandListToAllWorkersInternal(commandList, false, superuser); -} - - /* * TargetWorkerSetNodeList returns a list of WorkerNode's that satisfies the * TargetWorkerSet. diff --git a/src/include/distributed/worker_transaction.h b/src/include/distributed/worker_transaction.h index e3018a599..7ea24fd97 100644 --- a/src/include/distributed/worker_transaction.h +++ b/src/include/distributed/worker_transaction.h @@ -42,9 +42,6 @@ extern void SendBareCommandListToMetadataWorkers(List *commandList); extern int SendBareOptionalCommandListToAllWorkersAsUser(List *commandList, const char *user); extern void EnsureNoModificationsHaveBeenDone(void); -extern void SendCommandListToAllWorkers(List *commandList, const char *superuser); -extern void SendOptionalCommandListToAllWorkers(List *commandList, const char *superuser); -extern void SendCommandToAllWorkers(const char *command, const char *superuser); extern void SendCommandListToWorkerInSingleTransaction(const char *nodeName, int32 nodePort, const char *nodeUser,