mirror of https://github.com/citusdata/citus.git
Convert DropShardsFromWorker to the new connection API
parent
d7b68e5647
commit
173fe137af
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue