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

Commitdb23ecf

Browse files
committed
Wakeup hanged 2PC transactions
1 parentbfc9f9a commitdb23ecf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎contrib/mmts/multimaster.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
836836
MtmUnlock();
837837
MtmResetTransaction(x);
838838
}else {
839-
time_ttransTimeout=Max(MSEC_TO_USEC(Mtm2PCMinTimeout), (ts->csn-ts->snapshot)*Mtm2PCPrepareRatio/100);/* usec->msec and percents */
839+
time_ttransTimeout=Max(MSEC_TO_USEC(Mtm2PCMinTimeout), (ts->csn-ts->snapshot)*Mtm2PCPrepareRatio/100);
840840
intresult=0;
841841
intnConfigChanges=Mtm->nConfigChanges;
842842

@@ -1344,6 +1344,7 @@ bool MtmRefreshClusterStatus(bool nowait)
13441344
nodemask_tmask,clique;
13451345
nodemask_tmatrix[MAX_NODES];
13461346
intclique_size;
1347+
MtmTransState*ts;
13471348
inti;
13481349

13491350
if (!MtmUseRaftable|| !MtmBuildConnectivityMatrix(matrix,nowait)) {
@@ -1379,6 +1380,16 @@ bool MtmRefreshClusterStatus(bool nowait)
13791380
}
13801381
}
13811382
MtmCheckQuorum();
1383+
/* Interrupt voting for active transaction and abort them */
1384+
for (ts=Mtm->transListHead;ts!=NULL;ts=ts->next) {
1385+
if (!ts->votingCompleted) {
1386+
if (ts->status!=TRANSACTION_STATUS_ABORTED) {
1387+
MTM_LOG1("Rollback active transaction %d:%d",ts->gtid.node,ts->gtid.xid);
1388+
MtmAbortTransaction(ts);
1389+
}
1390+
MtmWakeUpBackend(ts);
1391+
}
1392+
}
13821393
MtmUnlock();
13831394
if (BIT_CHECK(Mtm->disabledNodeMask,MtmNodeId-1)) {
13841395
if (Mtm->status==MTM_ONLINE) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp