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

Commit35e1163

Browse files
knizhnikkelvich
authored andcommitted
Wakeup hanged 2PC transactions
1 parentaac8d16 commit35e1163

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎multimaster.c

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

@@ -1343,6 +1343,7 @@ bool MtmRefreshClusterStatus(bool nowait)
13431343
nodemask_tmask,clique;
13441344
nodemask_tmatrix[MAX_NODES];
13451345
intclique_size;
1346+
MtmTransState*ts;
13461347
inti;
13471348

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp