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

Commit7c42a86

Browse files
committed
Handle PREPARE message for aborted transactions at slaves
1 parentc00a592 commit7c42a86

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

‎contrib/mmts/arbiter.c‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -904,11 +904,15 @@ static void MtmTransReceiver(Datum arg)
904904
}else {
905905
switch (msg->code) {
906906
caseMSG_PREPARE:
907-
Assert(ts->status==TRANSACTION_STATUS_IN_PROGRESS);
908-
ts->status=TRANSACTION_STATUS_UNKNOWN;
909-
ts->csn=MtmAssignCSN();
910-
MtmAdjustSubtransactions(ts);
911-
MtmSendNotificationMessage(ts,MSG_PREPARED);
907+
if (ts->status==TRANSACTION_STATUS_IN_PROGRESS) {
908+
ts->status=TRANSACTION_STATUS_UNKNOWN;
909+
ts->csn=MtmAssignCSN();
910+
MtmAdjustSubtransactions(ts);
911+
MtmSendNotificationMessage(ts,MSG_PREPARED);
912+
}else {
913+
Assert(ts->status==TRANSACTION_STATUS_ABORTED);
914+
MtmSendNotificationMessage(ts,MSG_ABORTED);
915+
}
912916
break;
913917
default:
914918
Assert(false);

‎contrib/mmts/multimaster.c‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ int MtmReplicationNodeId;
196196
intMtmArbiterPort;
197197
intMtmConnectTimeout;
198198
intMtmReconnectTimeout;
199-
intMtmRaftPollDelay;
200199
intMtmNodeDisableDelay;
201200
intMtmTransSpillThreshold;
202201
intMtmMaxNodes;
@@ -737,7 +736,7 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
737736

738737
if (Mtm->disabledNodeMask!=0) {
739738
timestamp_tnow=MtmGetSystemTime();
740-
if (Mtm->lastClusterStatusUpdate+MSEC_TO_USEC(MtmRaftPollDelay)<now) {
739+
if (Mtm->lastClusterStatusUpdate+MSEC_TO_USEC(MtmHeartbeatRecvTimeout)<now) {
741740
Mtm->lastClusterStatusUpdate=now;
742741
MtmRefreshClusterStatus(true);
743742
}
@@ -1439,7 +1438,7 @@ void MtmOnNodeDisconnect(int nodeId)
14391438

14401439
RaftableSet(psprintf("node-mask-%d",MtmNodeId),&Mtm->connectivityMask,sizeofMtm->connectivityMask, true);/* false); -- TODO: raftable is hanged with nowait=true */
14411440

1442-
MtmSleep(MSEC_TO_USEC(MtmRaftPollDelay));
1441+
MtmSleep(MSEC_TO_USEC(MtmHeartbeatSendTimeout));
14431442

14441443
if (!MtmUseRaftable)
14451444
{
@@ -2060,22 +2059,6 @@ _PG_init(void)
20602059
NULL
20612060
);
20622061

2063-
DefineCustomIntVariable(
2064-
"multimaster.raft_poll_delay",
2065-
"Multimaster delay of polling cluster state from Raftable after updating local node status",
2066-
"Timeout in milliseconds before polling state of nodes",
2067-
&MtmRaftPollDelay,
2068-
1000,
2069-
1,
2070-
INT_MAX,
2071-
PGC_BACKEND,
2072-
0,
2073-
NULL,
2074-
NULL,
2075-
NULL
2076-
);
2077-
2078-
20792062
MtmSplitConnStrs();
20802063
MtmStartReceivers();
20812064

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp