File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,19 @@ MtmTwoPhaseCommit(void)
469469
470470 AllowTempIn2PC = true;
471471 CommitTransactionCommand (); /* here we actually PrepareTransaction */
472+ /*
473+ * It is nice to be in a transaction for
474+ * SetPreparedTransactionState/FinishPreparedTransaction, so start it
475+ * or, in case of atx, suspend the parent and start a new one.
476+ * XXX: check the same xact block stuff in case of cleanup
477+ */
478+ #ifdef PGPRO_EE
479+ if (IsTransactionState ())
480+ SuspendTransaction ();
481+ else
482+ #endif
483+ StartTransactionCommand ();
484+
472485 mtm_commit_state .gtx -> prepared = true;
473486 ReleasePB (); /* don't hold generation switch anymore */
474487 /* end_lsn of PREPARE */
@@ -633,7 +646,6 @@ MtmTwoPhaseCommit(void)
633646
634647precommit_tour_done :
635648 /* we have majority precommits, commit */
636- StartTransactionCommand ();
637649 FinishPreparedTransaction (mtm_commit_state .gid , true, false);
638650 mtm_commit_state .gtx -> state .status = GTXCommitted ;
639651 mtm_log (MtmTxFinish , "%s committed" , mtm_commit_state .gid );
You can’t perform that action at this time.
0 commit comments