Skip to content

Commit c00a592

Browse files
committed
Avoid call raftable with infinite timeout
1 parent be2865e commit c00a592

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

contrib/mmts/multimaster.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ bool MtmRefreshClusterStatus(bool nowait)
13481348
int clique_size;
13491349
int i;
13501350

1351-
if (!MtmUseRaftable || !MtmBuildConnectivityMatrix(matrix, nowait)) {
1351+
if (!MtmBuildConnectivityMatrix(matrix, nowait)) {
13521352
/* RAFT is not available */
13531353
return false;
13541354
}
@@ -1437,11 +1437,12 @@ void MtmOnNodeDisconnect(int nodeId)
14371437
BIT_SET(Mtm->reconnectMask, nodeId-1);
14381438
MtmUnlock();
14391439

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

14421442
MtmSleep(MSEC_TO_USEC(MtmRaftPollDelay));
14431443

1444-
if (!MtmRefreshClusterStatus(false)) {
1444+
if (!MtmUseRaftable)
1445+
{
14451446
MtmLock(LW_EXCLUSIVE);
14461447
if (!BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)) {
14471448
MtmDisableNode(nodeId);
@@ -1458,7 +1459,9 @@ void MtmOnNodeDisconnect(int nodeId)
14581459
}
14591460
}
14601461
MtmUnlock();
1461-
}
1462+
} else {
1463+
MtmRefreshClusterStatus(true); /* false); -- TODO: raftable can handg in nowait=true */
1464+
}
14621465
}
14631466

14641467
void MtmOnNodeConnect(int nodeId)
@@ -1468,7 +1471,7 @@ void MtmOnNodeConnect(int nodeId)
14681471
MtmUnlock();
14691472

14701473
MTM_LOG1("Reconnect node %d", nodeId);
1471-
RaftableSet(psprintf("node-mask-%d", MtmNodeId), &Mtm->connectivityMask, sizeof Mtm->connectivityMask, false);
1474+
RaftableSet(psprintf("node-mask-%d", MtmNodeId), &Mtm->connectivityMask, sizeof Mtm->connectivityMask, true); /* false); -- TODO: raftable is hanged with nowait=true */
14721475
}
14731476

14741477

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy