mirror of https://github.com/citusdata/citus.git
use remote nodes instead
parent
4f4cdff9ee
commit
4c46d4b265
|
@ -508,14 +508,18 @@ PreprocessCreateDatabaseStmt(Node *node, const char *queryString,
|
||||||
char *tempDatabaseName = psprintf(TEMP_DATABASE_NAME_FMT,
|
char *tempDatabaseName = psprintf(TEMP_DATABASE_NAME_FMT,
|
||||||
operationId, GetLocalGroupId());
|
operationId, GetLocalGroupId());
|
||||||
|
|
||||||
List *allNodes = TargetWorkerSetNodeList(ALL_SHARD_NODES, RowShareLock);
|
/*
|
||||||
WorkerNode *workerNode = NULL;
|
* Temporary database creation on local node would anyway rollback
|
||||||
foreach_ptr(workerNode, allNodes)
|
* in case of a failure, so only insert the records for remote nodes.
|
||||||
|
*/
|
||||||
|
List *remoteNodes = TargetWorkerSetNodeList(REMOTE_NODES, RowShareLock);
|
||||||
|
WorkerNode *remoteNode = NULL;
|
||||||
|
foreach_ptr(remoteNode, remoteNodes)
|
||||||
{
|
{
|
||||||
InsertCleanupRecordOutsideTransaction(
|
InsertCleanupRecordOutsideTransaction(
|
||||||
CLEANUP_OBJECT_DATABASE,
|
CLEANUP_OBJECT_DATABASE,
|
||||||
pstrdup(quote_identifier(tempDatabaseName)),
|
pstrdup(quote_identifier(tempDatabaseName)),
|
||||||
workerNode->groupId,
|
remoteNode->groupId,
|
||||||
CLEANUP_ON_FAILURE
|
CLEANUP_ON_FAILURE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue