Convert DropShardsFromWorker to the new connection API

pull/1454/head
velioglu 2017-06-14 17:52:11 +03:00
parent d7b68e5647
commit 173fe137af
1 changed files with 9 additions and 1 deletions

View File

@ -15,12 +15,15 @@
#include "postgres.h" #include "postgres.h"
#include "funcapi.h" #include "funcapi.h"
#include "libpq-fe.h"
#include "catalog/pg_class.h" #include "catalog/pg_class.h"
#include "distributed/connection_management.h"
#include "distributed/master_protocol.h" #include "distributed/master_protocol.h"
#include "distributed/metadata_cache.h" #include "distributed/metadata_cache.h"
#include "distributed/multi_join_order.h" #include "distributed/multi_join_order.h"
#include "distributed/pg_dist_shard.h" #include "distributed/pg_dist_shard.h"
#include "distributed/remote_commands.h"
#include "distributed/worker_manager.h" #include "distributed/worker_manager.h"
#include "distributed/worker_protocol.h" #include "distributed/worker_protocol.h"
#include "utils/builtins.h" #include "utils/builtins.h"
@ -154,6 +157,9 @@ DropShardsFromWorker(WorkerNode *workerNode, Oid relationId, List *shardInterval
StringInfo workerCommand = makeStringInfo(); StringInfo workerCommand = makeStringInfo();
StringInfo shardNames = makeStringInfo(); StringInfo shardNames = makeStringInfo();
ListCell *shardIntervalCell = NULL; ListCell *shardIntervalCell = NULL;
MultiConnection *connection = NULL;
int connectionFlag = FORCE_NEW_CONNECTION;
PGresult *result = NULL;
if (shardIntervalList == NIL) if (shardIntervalList == NIL)
{ {
@ -191,5 +197,7 @@ DropShardsFromWorker(WorkerNode *workerNode, Oid relationId, List *shardInterval
errmsg("expire target is not a regular or foreign table"))); errmsg("expire target is not a regular or foreign table")));
} }
ExecuteRemoteCommand(workerNode->workerName, workerNode->workerPort, workerCommand); connection = GetNodeConnection(connectionFlag, workerNode->workerName,
workerNode->workerPort);
ExecuteOptionalRemoteCommand(connection, workerCommand->data, &result);
} }