mirror of https://github.com/citusdata/citus.git
Do not call CheckRemoteTransactionsHealth from commit handler
parent
12a8c040ec
commit
79235c35fb
|
@ -43,7 +43,6 @@ static void StartRemoteTransactionSavepointRollback(MultiConnection *connection,
|
|||
static void FinishRemoteTransactionSavepointRollback(MultiConnection *connection,
|
||||
SubTransactionId subId);
|
||||
|
||||
static void CheckTransactionHealth(void);
|
||||
static void Assign2PCIdentifier(MultiConnection *connection);
|
||||
static void WarnAboutLeakedPreparedTransaction(MultiConnection *connection, bool commit);
|
||||
|
||||
|
@ -837,12 +836,6 @@ CoordinatedRemoteTransactionsCommit(void)
|
|||
List *connectionList = NIL;
|
||||
bool raiseInterrupts = false;
|
||||
|
||||
/*
|
||||
* Before starting to commit on any of the nodes - after which we can't
|
||||
* completely roll-back anymore - check that things are in a good state.
|
||||
*/
|
||||
CheckTransactionHealth();
|
||||
|
||||
/*
|
||||
* Issue appropriate transaction commands to remote nodes. If everything
|
||||
* went well that's going to be COMMIT or COMMIT PREPARED, if individual
|
||||
|
@ -1229,13 +1222,13 @@ FinishRemoteTransactionSavepointRollback(MultiConnection *connection, SubTransac
|
|||
|
||||
|
||||
/*
|
||||
* CheckTransactionHealth checks if any of the participating transactions in a
|
||||
* CheckRemoteTransactionsHealth checks if any of the participating transactions in a
|
||||
* coordinated transaction failed, and what consequence that should have.
|
||||
* This needs to be called before the coordinated transaction commits (but
|
||||
* after they've been PREPAREd if 2PC is in use).
|
||||
*/
|
||||
static void
|
||||
CheckTransactionHealth(void)
|
||||
void
|
||||
CheckRemoteTransactionsHealth(void)
|
||||
{
|
||||
dlist_iter iter;
|
||||
|
||||
|
|
|
@ -283,9 +283,17 @@ CoordinatedTransactionCallback(XactEvent event, void *arg)
|
|||
{
|
||||
CoordinatedRemoteTransactionsPrepare();
|
||||
CurrentCoordinatedTransactionState = COORD_TRANS_PREPARED;
|
||||
|
||||
/*
|
||||
* Make sure we did not have any failures on connections marked as
|
||||
* critical before committing.
|
||||
*/
|
||||
CheckRemoteTransactionsHealth();
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckRemoteTransactionsHealth();
|
||||
|
||||
/*
|
||||
* Have to commit remote transactions in PRE_COMMIT, to allow
|
||||
* us to mark failed placements as invalid. Better don't use
|
||||
|
|
|
@ -130,6 +130,7 @@ extern void ResetRemoteTransaction(struct MultiConnection *connection);
|
|||
extern void CoordinatedRemoteTransactionsPrepare(void);
|
||||
extern void CoordinatedRemoteTransactionsCommit(void);
|
||||
extern void CoordinatedRemoteTransactionsAbort(void);
|
||||
extern void CheckRemoteTransactionsHealth(void);
|
||||
|
||||
/* remote savepoint commands */
|
||||
extern void CoordinatedRemoteTransactionsSavepointBegin(SubTransactionId subId);
|
||||
|
|
Loading…
Reference in New Issue