Skip to content

Commit 6a3ebc6

Browse files
knizhnikkelvich
authored andcommitted
Fix bug in explicit 2pc commit
1 parent 10f7b9e commit 6a3ebc6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

multimaster.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,7 @@ void MtmFinishPreparedTransaction(MtmTransState* ts, bool commit)
34123412
MtmTx.isActive = true;
34133413
FinishPreparedTransaction(ts->gid, commit);
34143414
if (commit) {
3415-
MTM_LOG2("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld", ts->gid, (long64)ts->xid, MtmGetCurrentTime(), (long64)GetXLogInsertRecPtr());
3415+
MTM_LOG1("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld", ts->gid, (long64)ts->xid, MtmGetCurrentTime(), (long64)GetXLogInsertRecPtr());
34163416
}
34173417
if (!insideTransaction) {
34183418
CommitTransactionCommand();
@@ -4600,7 +4600,7 @@ static bool MtmTwoPhaseCommit(MtmCurrentTrans* x)
46004600
MTM_ELOG(ERROR, "Transaction %s (%llu) is aborted by DTM", x->gid, (long64)x->xid);
46014601
} else {
46024602
FinishPreparedTransaction(x->gid, true);
4603-
MTM_LOG2("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld", x->gid, (long64)x->xid, MtmGetCurrentTime(), (long64)GetXLogInsertRecPtr());
4603+
MTM_LOG1("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld", x->gid, (long64)x->xid, MtmGetCurrentTime(), (long64)GetXLogInsertRecPtr());
46044604
}
46054605
}
46064606
}
@@ -4864,12 +4864,11 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
48644864
MtmTx.isTwoPhase = true;
48654865
strcpy(MtmTx.gid, stmt->gid);
48664866
break;
4867-
/* nobreak */
48684867
case TRANS_STMT_COMMIT_PREPARED:
48694868
case TRANS_STMT_ROLLBACK_PREPARED:
48704869
Assert(!MtmTx.isTwoPhase);
48714870
strcpy(MtmTx.gid, stmt->gid);
4872-
MtmTx.isTwoPhase = true;
4871+
//MtmTx.isTwoPhase = true;
48734872
break;
48744873
default:
48754874
break;

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