Skip to content

Commit 0e9e9ca

Browse files
knizhnikkelvich
authored andcommitted
Avoid call raftable with infinite timeout
1 parent c3eb6bf commit 0e9e9ca

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

multimaster.c

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

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

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

14411441
MtmSleep(MSEC_TO_USEC(MtmRaftPollDelay));
14421442

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

14631466
void MtmOnNodeConnect(int nodeId)
@@ -1467,7 +1470,7 @@ void MtmOnNodeConnect(int nodeId)
14671470
MtmUnlock();
14681471

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

14731476

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