Revert "Remove unused SendCommandToWorker"

This reverts commit c8c308c109.
pull/1185/head
Jason Petersen 2017-03-13 15:48:51 -06:00
parent 1599e943e7
commit 6f4886cd11
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
2 changed files with 24 additions and 0 deletions

View File

@ -32,6 +32,29 @@
#include "utils/memutils.h" #include "utils/memutils.h"
/*
* SendCommandToWorker sends a command to a particular worker as part of the
* 2PC.
*/
void
SendCommandToWorker(char *nodeName, int32 nodePort, char *command)
{
MultiConnection *transactionConnection = NULL;
char *nodeUser = CitusExtensionOwnerName();
int connectionFlags = 0;
BeginOrContinueCoordinatedTransaction();
CoordinatedTransactionUse2PC();
transactionConnection = GetNodeUserDatabaseConnection(connectionFlags, nodeName,
nodePort, nodeUser, NULL);
MarkRemoteTransactionCritical(transactionConnection);
RemoteTransactionBeginIfNecessary(transactionConnection);
ExecuteCriticalRemoteCommand(transactionConnection, command);
}
/* /*
* SendCommandToWorkers sends a command to all workers in * SendCommandToWorkers sends a command to all workers in
* parallel. Commands are committed on the workers when the local * parallel. Commands are committed on the workers when the local

View File

@ -28,6 +28,7 @@ typedef enum TargetWorkerSet
/* Functions declarations for worker transactions */ /* Functions declarations for worker transactions */
extern List * GetWorkerTransactions(void); extern List * GetWorkerTransactions(void);
extern void SendCommandToWorker(char *nodeName, int32 nodePort, char *command);
extern void SendCommandToWorkers(TargetWorkerSet targetWorkerSet, char *command); extern void SendCommandToWorkers(TargetWorkerSet targetWorkerSet, char *command);
extern void SendCommandToWorkersParams(TargetWorkerSet targetWorkerSet, char *command, extern void SendCommandToWorkersParams(TargetWorkerSet targetWorkerSet, char *command,
int parameterCount, const Oid *parameterTypes, int parameterCount, const Oid *parameterTypes,