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

Commita2aecff

Browse files
knizhnikkelvich
authored andcommitted
Fix 2pc commit of transaction updating temporary table
1 parentf0039f2 commita2aecff

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

‎contrib/mmts/multimaster.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
11331133
MTM_TXTRACE(x,"recovery? 5");
11341134
MtmResetTransaction();
11351135
MTM_TXTRACE(x,"recovery? 6");
1136-
}else {
1136+
}elseif (!ts->isLocal){
11371137
MTM_TXTRACE(x,"not recovery?");
11381138
Mtm2PCVoting(x,ts);
11391139
MtmUnlock();
@@ -1170,18 +1170,19 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
11701170
ts=tm->state;
11711171

11721172
Assert(MtmIsCoordinator(ts));
1173+
if (!ts->isLocal) {
1174+
ts->votingCompleted= false;
1175+
ts->votedMask=0;
1176+
ts->procno=MyProc->pgprocno;
1177+
MTM_LOG2("Coordinator of transaction %s sends MSG_PRECOMMIT",ts->gid);
1178+
Assert(replorigin_session_origin==InvalidRepOriginId);
1179+
MtmUnlock();
1180+
SetPreparedTransactionState(ts->gid,MULTIMASTER_PRECOMMITTED);
1181+
//MtmSend2PCMessage(ts, MSG_PRECOMMIT);
1182+
MtmLock(LW_EXCLUSIVE);
11731183

1174-
ts->votingCompleted= false;
1175-
ts->votedMask=0;
1176-
ts->procno=MyProc->pgprocno;
1177-
MTM_LOG2("Coordinator of transaction %s sends MSG_PRECOMMIT",ts->gid);
1178-
Assert(replorigin_session_origin==InvalidRepOriginId);
1179-
MtmUnlock();
1180-
SetPreparedTransactionState(ts->gid,MULTIMASTER_PRECOMMITTED);
1181-
//MtmSend2PCMessage(ts, MSG_PRECOMMIT);
1182-
MtmLock(LW_EXCLUSIVE);
1183-
1184-
Mtm2PCVoting(x,ts);
1184+
Mtm2PCVoting(x,ts);
1185+
}
11851186

11861187
x->xid=ts->xid;
11871188
x->csn=ts->csn;

‎contrib/mmts/tests2/test_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setUpClass(self):
1515
@classmethod
1616
deftearDownClass(self):
1717
print('tearDown')
18-
subprocess.check_call(['docker-compose','down'])
18+
# subprocess.check_call(['docker-compose','down'])
1919

2020
deftest_regression(self):
2121
# XXX: make smth clever here

‎src/backend/access/transam/subtrans.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ SubTransGetParent(TransactionId xid)
112112
TransactionIdparent;
113113

114114
/* Can't ask about stuff that might not be around anymore */
115-
Assert(TransactionIdFollowsOrEquals(xid,TransactionXmin));
115+
//Assert(TransactionIdFollowsOrEquals(xid, TransactionXmin));
116116

117117
/* Bootstrap and frozen XIDs have no parent */
118118
if (!TransactionIdIsNormal(xid))
@@ -150,7 +150,10 @@ SubTransGetTopmostTransaction(TransactionId xid)
150150
previousXid=xid;
151151

152152
/* Can't ask about stuff that might not be around anymore */
153-
Assert(TransactionIdFollowsOrEquals(xid,TransactionXmin));
153+
if (!TransactionIdFollowsOrEquals(xid,TransactionXmin))
154+
{
155+
returnxid;
156+
}
154157

155158
while (TransactionIdIsValid(parentXid))
156159
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp