File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,19 @@ MtmTwoPhaseCommit(void)
469
469
470
470
AllowTempIn2PC = true;
471
471
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
+
472
485
mtm_commit_state .gtx -> prepared = true;
473
486
ReleasePB (); /* don't hold generation switch anymore */
474
487
/* end_lsn of PREPARE */
@@ -633,7 +646,6 @@ MtmTwoPhaseCommit(void)
633
646
634
647
precommit_tour_done :
635
648
/* we have majority precommits, commit */
636
- StartTransactionCommand ();
637
649
FinishPreparedTransaction (mtm_commit_state .gid , true, false);
638
650
mtm_commit_state .gtx -> state .status = GTXCommitted ;
639
651
mtm_log (MtmTxFinish , "%s committed" , mtm_commit_state .gid );
You can’t perform that action at this time.
0 commit comments