Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac34bd8

Browse files
knizhnikkelvich
authored andcommitted
Replace assert in EndTransaction with reporting error
1 parent9b896e6 commitac34bd8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎multimaster.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,14 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
11091109
}
11101110
if (ts!=NULL) {
11111111
if (commit) {
1112-
/* Assert(ts->status == TRANSACTION_STATUS_UNKNOWN); */
1113-
Assert(ts->status==TRANSACTION_STATUS_UNKNOWN
1114-
|| (ts->status==TRANSACTION_STATUS_IN_PROGRESS&&Mtm->status==MTM_RECOVERY));/* ??? Why there is commit without prepare */
1112+
if (!(ts->status==TRANSACTION_STATUS_UNKNOWN
1113+
|| (ts->status==TRANSACTION_STATUS_IN_PROGRESS&&Mtm->status==MTM_RECOVERY)))
1114+
{
1115+
elog(ERROR,"Attempt to commit %s transaction %d (%s)",
1116+
ts->status==TRANSACTION_STATUS_ABORTED ?"aborted"
1117+
:ts->status==TRANSACTION_STATUS_COMMITTED ?"committed" :"not prepared",
1118+
ts->xid,ts->gid);
1119+
}
11151120
if (x->csn>ts->csn||Mtm->status==MTM_RECOVERY) {
11161121
ts->csn=x->csn;
11171122
MtmSyncClock(ts->csn);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp