mirror of https://github.com/citusdata/citus.git
rename REMOTE_TRANS_INVALID to REMOTE_TRANS_NOT_STARTED
parent
fecf61ef1f
commit
d10f97998c
|
@ -781,7 +781,7 @@ ConnectionModifiedPlacement(MultiConnection *connection)
|
|||
{
|
||||
dlist_iter placementIter;
|
||||
|
||||
if (connection->remoteTransaction.transactionState == REMOTE_TRANS_INVALID)
|
||||
if (connection->remoteTransaction.transactionState == REMOTE_TRANS_NOT_STARTED)
|
||||
{
|
||||
/*
|
||||
* When StartPlacementListConnection() is called, we set the
|
||||
|
|
|
@ -1365,7 +1365,7 @@ CleanUpSessions(DistributedExecution *execution)
|
|||
|
||||
ClearResults(connection, false);
|
||||
}
|
||||
else if (!(transactionState == REMOTE_TRANS_INVALID ||
|
||||
else if (!(transactionState == REMOTE_TRANS_NOT_STARTED ||
|
||||
transactionState == REMOTE_TRANS_STARTED))
|
||||
{
|
||||
/*
|
||||
|
@ -2467,7 +2467,7 @@ ConnectionStateMachine(WorkerSession *session)
|
|||
if (!connection->remoteTransaction.beginSent)
|
||||
{
|
||||
connection->remoteTransaction.transactionState =
|
||||
REMOTE_TRANS_INVALID;
|
||||
REMOTE_TRANS_NOT_STARTED;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -2581,7 +2581,7 @@ TransactionStateMachine(WorkerSession *session)
|
|||
|
||||
switch (currentState)
|
||||
{
|
||||
case REMOTE_TRANS_INVALID:
|
||||
case REMOTE_TRANS_NOT_STARTED:
|
||||
{
|
||||
if (execution->isTransaction)
|
||||
{
|
||||
|
@ -2677,7 +2677,7 @@ TransactionStateMachine(WorkerSession *session)
|
|||
}
|
||||
else
|
||||
{
|
||||
transaction->transactionState = REMOTE_TRANS_INVALID;
|
||||
transaction->transactionState = REMOTE_TRANS_NOT_STARTED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -3433,7 +3433,7 @@ PlacementExecutionReady(TaskPlacementExecution *placementExecution)
|
|||
&placementExecution->sessionReadyQueueNode);
|
||||
}
|
||||
|
||||
if (transactionState == REMOTE_TRANS_INVALID ||
|
||||
if (transactionState == REMOTE_TRANS_NOT_STARTED ||
|
||||
transactionState == REMOTE_TRANS_STARTED)
|
||||
{
|
||||
/*
|
||||
|
@ -3467,7 +3467,7 @@ PlacementExecutionReady(TaskPlacementExecution *placementExecution)
|
|||
RemoteTransaction *transaction = &(connection->remoteTransaction);
|
||||
RemoteTransactionState transactionState = transaction->transactionState;
|
||||
|
||||
if (transactionState == REMOTE_TRANS_INVALID ||
|
||||
if (transactionState == REMOTE_TRANS_NOT_STARTED ||
|
||||
transactionState == REMOTE_TRANS_STARTED)
|
||||
{
|
||||
UpdateConnectionWaitFlags(session,
|
||||
|
|
|
@ -61,7 +61,7 @@ StartRemoteTransactionBegin(struct MultiConnection *connection)
|
|||
StringInfo beginAndSetDistributedTransactionId = makeStringInfo();
|
||||
ListCell *subIdCell = NULL;
|
||||
|
||||
Assert(transaction->transactionState == REMOTE_TRANS_INVALID);
|
||||
Assert(transaction->transactionState == REMOTE_TRANS_NOT_STARTED);
|
||||
|
||||
/* remember transaction as being in-progress */
|
||||
dlist_push_tail(&InProgressTransactions, &connection->transactionNode);
|
||||
|
@ -206,7 +206,7 @@ StartRemoteTransactionCommit(MultiConnection *connection)
|
|||
const bool isCommit = true;
|
||||
|
||||
/* can only commit if transaction is in progress */
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_INVALID);
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_NOT_STARTED);
|
||||
|
||||
/* can't commit if we already started to commit or abort */
|
||||
Assert(transaction->transactionState < REMOTE_TRANS_1PC_ABORTING);
|
||||
|
@ -348,7 +348,7 @@ StartRemoteTransactionAbort(MultiConnection *connection)
|
|||
const bool raiseErrors = false;
|
||||
const bool isNotCommit = false;
|
||||
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_INVALID);
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_NOT_STARTED);
|
||||
|
||||
/*
|
||||
* Clear previous results, so we have a better chance to send ROLLBACK
|
||||
|
@ -474,7 +474,7 @@ StartRemoteTransactionPrepare(struct MultiConnection *connection)
|
|||
const bool raiseErrors = true;
|
||||
|
||||
/* can't prepare a nonexistant transaction */
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_INVALID);
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_NOT_STARTED);
|
||||
|
||||
/* can't prepare in a failed transaction */
|
||||
Assert(!transaction->transactionFailed);
|
||||
|
@ -615,7 +615,7 @@ RemoteTransactionsBeginIfNecessary(List *connectionList)
|
|||
* don't start it again. That's quite normal if a piece of code allows
|
||||
* cached connections.
|
||||
*/
|
||||
if (transaction->transactionState != REMOTE_TRANS_INVALID)
|
||||
if (transaction->transactionState != REMOTE_TRANS_NOT_STARTED)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ CloseRemoteTransaction(struct MultiConnection *connection)
|
|||
RemoteTransaction *transaction = &connection->remoteTransaction;
|
||||
|
||||
/* unlink from list of open transactions, if necessary */
|
||||
if (transaction->transactionState != REMOTE_TRANS_INVALID)
|
||||
if (transaction->transactionState != REMOTE_TRANS_NOT_STARTED)
|
||||
{
|
||||
/* XXX: Should we error out for a critical transaction? */
|
||||
|
||||
|
@ -802,7 +802,7 @@ CoordinatedRemoteTransactionsPrepare(void)
|
|||
iter.cur);
|
||||
RemoteTransaction *transaction = &connection->remoteTransaction;
|
||||
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_INVALID);
|
||||
Assert(transaction->transactionState != REMOTE_TRANS_NOT_STARTED);
|
||||
|
||||
/* can't PREPARE a transaction that failed */
|
||||
if (transaction->transactionFailed)
|
||||
|
@ -863,7 +863,7 @@ CoordinatedRemoteTransactionsCommit(void)
|
|||
iter.cur);
|
||||
RemoteTransaction *transaction = &connection->remoteTransaction;
|
||||
|
||||
if (transaction->transactionState == REMOTE_TRANS_INVALID ||
|
||||
if (transaction->transactionState == REMOTE_TRANS_NOT_STARTED ||
|
||||
transaction->transactionState == REMOTE_TRANS_1PC_COMMITTING ||
|
||||
transaction->transactionState == REMOTE_TRANS_2PC_COMMITTING ||
|
||||
transaction->transactionState == REMOTE_TRANS_COMMITTED ||
|
||||
|
@ -920,7 +920,7 @@ CoordinatedRemoteTransactionsAbort(void)
|
|||
iter.cur);
|
||||
RemoteTransaction *transaction = &connection->remoteTransaction;
|
||||
|
||||
if (transaction->transactionState == REMOTE_TRANS_INVALID ||
|
||||
if (transaction->transactionState == REMOTE_TRANS_NOT_STARTED ||
|
||||
transaction->transactionState == REMOTE_TRANS_1PC_ABORTING ||
|
||||
transaction->transactionState == REMOTE_TRANS_2PC_ABORTING ||
|
||||
transaction->transactionState == REMOTE_TRANS_ABORTED)
|
||||
|
|
|
@ -26,7 +26,7 @@ struct MultiConnection;
|
|||
typedef enum
|
||||
{
|
||||
/* no transaction active */
|
||||
REMOTE_TRANS_INVALID = 0,
|
||||
REMOTE_TRANS_NOT_STARTED = 0,
|
||||
|
||||
/* transaction start */
|
||||
REMOTE_TRANS_STARTING,
|
||||
|
|
Loading…
Reference in New Issue