mirror of https://github.com/citusdata/citus.git
Rename CoordinatedTransactionShouldUse2PC (#4995)
parent
8b8f0161c3
commit
a4944a2102
|
@ -2228,7 +2228,7 @@ CitusCopyDestReceiverStartup(DestReceiver *dest, int operation,
|
||||||
if (cacheEntry->replicationModel == REPLICATION_MODEL_2PC ||
|
if (cacheEntry->replicationModel == REPLICATION_MODEL_2PC ||
|
||||||
MultiShardCommitProtocol == COMMIT_PROTOCOL_2PC)
|
MultiShardCommitProtocol == COMMIT_PROTOCOL_2PC)
|
||||||
{
|
{
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* define how tuples will be serialised */
|
/* define how tuples will be serialised */
|
||||||
|
|
|
@ -1255,7 +1255,7 @@ StartDistributedExecution(DistributedExecution *execution)
|
||||||
|
|
||||||
if (xactProperties->requires2PC)
|
if (xactProperties->requires2PC)
|
||||||
{
|
{
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3542,7 +3542,7 @@ Activate2PCIfModifyingTransactionExpandsToNewNode(WorkerSession *session)
|
||||||
* just opened, which means we're now going to make modifications
|
* just opened, which means we're now going to make modifications
|
||||||
* over multiple connections. Activate 2PC!
|
* over multiple connections. Activate 2PC!
|
||||||
*/
|
*/
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ ExecuteLocalTaskListExtended(List *taskList,
|
||||||
* queries are also ReadOnly, our 2PC logic is smart enough to skip sending
|
* queries are also ReadOnly, our 2PC logic is smart enough to skip sending
|
||||||
* PREPARE to those connections.
|
* PREPARE to those connections.
|
||||||
*/
|
*/
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
LogLocalCommand(task);
|
LogLocalCommand(task);
|
||||||
|
|
|
@ -325,7 +325,7 @@ DropShards(Oid relationId, char *schemaName, char *relationName,
|
||||||
*/
|
*/
|
||||||
if (MultiShardCommitProtocol == COMMIT_PROTOCOL_2PC)
|
if (MultiShardCommitProtocol == COMMIT_PROTOCOL_2PC)
|
||||||
{
|
{
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
List *dropTaskList = DropTaskList(relationId, schemaName, relationName,
|
List *dropTaskList = DropTaskList(relationId, schemaName, relationName,
|
||||||
|
|
|
@ -101,7 +101,7 @@ MemoryContext CommitContext = NULL;
|
||||||
* do 2PC on the remote connections that did a modification.
|
* do 2PC on the remote connections that did a modification.
|
||||||
*
|
*
|
||||||
* As a variable name ShouldCoordinatedTransactionUse2PC could
|
* As a variable name ShouldCoordinatedTransactionUse2PC could
|
||||||
* be improved. We use CoordinatedTransactionShouldUse2PC() as the
|
* be improved. We use Use2PCForCoordinatedTransaction() as the
|
||||||
* public API function, hence couldn't come up with a better name
|
* public API function, hence couldn't come up with a better name
|
||||||
* for the underlying variable at the moment.
|
* for the underlying variable at the moment.
|
||||||
*/
|
*/
|
||||||
|
@ -190,14 +190,14 @@ InCoordinatedTransaction(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CoordinatedTransactionShouldUse2PC() signals that the current coordinated
|
* Use2PCForCoordinatedTransaction() signals that the current coordinated
|
||||||
* transaction should use 2PC to commit.
|
* transaction should use 2PC to commit.
|
||||||
*
|
*
|
||||||
* Note that even if 2PC is enabled, it is only used for connections that make
|
* Note that even if 2PC is enabled, it is only used for connections that make
|
||||||
* modification (DML or DDL).
|
* modification (DML or DDL).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CoordinatedTransactionShouldUse2PC(void)
|
Use2PCForCoordinatedTransaction(void)
|
||||||
{
|
{
|
||||||
Assert(InCoordinatedTransaction());
|
Assert(InCoordinatedTransaction());
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ SendCommandToWorkerAsUser(const char *nodeName, int32 nodePort, const char *node
|
||||||
uint32 connectionFlags = 0;
|
uint32 connectionFlags = 0;
|
||||||
|
|
||||||
UseCoordinatedTransaction();
|
UseCoordinatedTransaction();
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
|
|
||||||
MultiConnection *transactionConnection = GetNodeUserDatabaseConnection(
|
MultiConnection *transactionConnection = GetNodeUserDatabaseConnection(
|
||||||
connectionFlags, nodeName,
|
connectionFlags, nodeName,
|
||||||
|
@ -404,7 +404,7 @@ SendCommandToWorkersParamsInternal(TargetWorkerSet targetWorkerSet, const char *
|
||||||
List *workerNodeList = TargetWorkerSetNodeList(targetWorkerSet, ShareLock);
|
List *workerNodeList = TargetWorkerSetNodeList(targetWorkerSet, ShareLock);
|
||||||
|
|
||||||
UseCoordinatedTransaction();
|
UseCoordinatedTransaction();
|
||||||
CoordinatedTransactionShouldUse2PC();
|
Use2PCForCoordinatedTransaction();
|
||||||
|
|
||||||
/* open connections in parallel */
|
/* open connections in parallel */
|
||||||
WorkerNode *workerNode = NULL;
|
WorkerNode *workerNode = NULL;
|
||||||
|
|
|
@ -111,7 +111,7 @@ extern bool TransactionModifiedNodeMetadata;
|
||||||
*/
|
*/
|
||||||
extern void UseCoordinatedTransaction(void);
|
extern void UseCoordinatedTransaction(void);
|
||||||
extern bool InCoordinatedTransaction(void);
|
extern bool InCoordinatedTransaction(void);
|
||||||
extern void CoordinatedTransactionShouldUse2PC(void);
|
extern void Use2PCForCoordinatedTransaction(void);
|
||||||
extern bool GetCoordinatedTransactionShouldUse2PC(void);
|
extern bool GetCoordinatedTransactionShouldUse2PC(void);
|
||||||
extern bool IsMultiStatementTransaction(void);
|
extern bool IsMultiStatementTransaction(void);
|
||||||
extern void EnsureDistributedTransactionId(void);
|
extern void EnsureDistributedTransactionId(void);
|
||||||
|
|
Loading…
Reference in New Issue