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 PopSubXact(SubTransactionId subId);
|
||||||
static void SwallowErrors(void (*func)());
|
static void SwallowErrors(void (*func)());
|
||||||
static bool MaybeExecutingUDF(void);
|
static bool MaybeExecutingUDF(void);
|
||||||
|
static void ResetGlobalVariables(void);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -248,13 +249,7 @@ CoordinatedTransactionCallback(XactEvent event, void *arg)
|
||||||
AfterXactConnectionHandling(true);
|
AfterXactConnectionHandling(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentCoordinatedTransactionState = COORD_TRANS_NONE;
|
ResetGlobalVariables();
|
||||||
XactModificationLevel = XACT_MODIFICATION_NONE;
|
|
||||||
TransactionAccessedLocalPlacement = false;
|
|
||||||
TransactionConnectedToLocalGroup = false;
|
|
||||||
dlist_init(&InProgressTransactions);
|
|
||||||
activeSetStmts = NULL;
|
|
||||||
CoordinatedTransactionUses2PC = false;
|
|
||||||
|
|
||||||
UnSetDistributedTransactionId();
|
UnSetDistributedTransactionId();
|
||||||
|
|
||||||
|
@ -303,13 +298,7 @@ CoordinatedTransactionCallback(XactEvent event, void *arg)
|
||||||
AfterXactConnectionHandling(false);
|
AfterXactConnectionHandling(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentCoordinatedTransactionState = COORD_TRANS_NONE;
|
ResetGlobalVariables();
|
||||||
XactModificationLevel = XACT_MODIFICATION_NONE;
|
|
||||||
TransactionAccessedLocalPlacement = false;
|
|
||||||
TransactionConnectedToLocalGroup = false;
|
|
||||||
dlist_init(&InProgressTransactions);
|
|
||||||
activeSetStmts = NULL;
|
|
||||||
CoordinatedTransactionUses2PC = false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Getting here without ExecutorLevel 0 is a bug, however it is such a big
|
* 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
|
* ResetShardPlacementTransactionState performs cleanup after the end of a
|
||||||
* transaction.
|
* transaction.
|
||||||
|
|
Loading…
Reference in New Issue