mirror of https://github.com/citusdata/citus.git
refactor CoordinatedTransactionCallback (#3571)
parent
6e6763678c
commit
a75436a54b
|
@ -110,6 +110,7 @@ static void PushSubXact(SubTransactionId subId);
|
|||
static void PopSubXact(SubTransactionId subId);
|
||||
static void SwallowErrors(void (*func)());
|
||||
static bool MaybeExecutingUDF(void);
|
||||
static void ResetGlobalVariables(void);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -248,13 +249,7 @@ CoordinatedTransactionCallback(XactEvent event, void *arg)
|
|||
AfterXactConnectionHandling(true);
|
||||
}
|
||||
|
||||
CurrentCoordinatedTransactionState = COORD_TRANS_NONE;
|
||||
XactModificationLevel = XACT_MODIFICATION_NONE;
|
||||
TransactionAccessedLocalPlacement = false;
|
||||
TransactionConnectedToLocalGroup = false;
|
||||
dlist_init(&InProgressTransactions);
|
||||
activeSetStmts = NULL;
|
||||
CoordinatedTransactionUses2PC = false;
|
||||
ResetGlobalVariables();
|
||||
|
||||
UnSetDistributedTransactionId();
|
||||
|
||||
|
@ -303,13 +298,7 @@ CoordinatedTransactionCallback(XactEvent event, void *arg)
|
|||
AfterXactConnectionHandling(false);
|
||||
}
|
||||
|
||||
CurrentCoordinatedTransactionState = COORD_TRANS_NONE;
|
||||
XactModificationLevel = XACT_MODIFICATION_NONE;
|
||||
TransactionAccessedLocalPlacement = false;
|
||||
TransactionConnectedToLocalGroup = false;
|
||||
dlist_init(&InProgressTransactions);
|
||||
activeSetStmts = NULL;
|
||||
CoordinatedTransactionUses2PC = false;
|
||||
ResetGlobalVariables();
|
||||
|
||||
/*
|
||||
* Getting here without ExecutorLevel 0 is a bug, however it is such a big
|
||||
|
@ -446,6 +435,23 @@ CoordinatedTransactionCallback(XactEvent event, void *arg)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* ResetGlobalVariables resets global variables that
|
||||
* might be changed during the execution of queries.
|
||||
*/
|
||||
static void
|
||||
ResetGlobalVariables()
|
||||
{
|
||||
CurrentCoordinatedTransactionState = COORD_TRANS_NONE;
|
||||
XactModificationLevel = XACT_MODIFICATION_NONE;
|
||||
TransactionAccessedLocalPlacement = false;
|
||||
TransactionConnectedToLocalGroup = false;
|
||||
dlist_init(&InProgressTransactions);
|
||||
activeSetStmts = NULL;
|
||||
CoordinatedTransactionUses2PC = false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ResetShardPlacementTransactionState performs cleanup after the end of a
|
||||
* transaction.
|
||||
|
|
Loading…
Reference in New Issue