Skip to content

Commit f2aea5a

Browse files
committed
[PGPRO-4887] Attempt to fix xact block stuff in case of atx.
1 parent 0fec9d3 commit f2aea5a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/commit.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff 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

634647
precommit_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);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy