mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Cluster: update cluster state on PFAIL flag set/cleared on nodes.
This commit is contained in:
parent
299b8f76c2
commit
f0b807cd47
@ -1250,7 +1250,7 @@ void clusterPropagatePublish(robj *channel, robj *message) {
|
|||||||
void clusterCron(void) {
|
void clusterCron(void) {
|
||||||
dictIterator *di;
|
dictIterator *di;
|
||||||
dictEntry *de;
|
dictEntry *de;
|
||||||
int j;
|
int j, update_state = 0;
|
||||||
time_t min_ping_sent = 0;
|
time_t min_ping_sent = 0;
|
||||||
clusterNode *min_ping_node = NULL;
|
clusterNode *min_ping_node = NULL;
|
||||||
|
|
||||||
@ -1348,6 +1348,7 @@ void clusterCron(void) {
|
|||||||
* conditions detected by clearNodeFailureIfNeeded(). */
|
* conditions detected by clearNodeFailureIfNeeded(). */
|
||||||
if (node->flags & REDIS_NODE_PFAIL) {
|
if (node->flags & REDIS_NODE_PFAIL) {
|
||||||
node->flags &= ~REDIS_NODE_PFAIL;
|
node->flags &= ~REDIS_NODE_PFAIL;
|
||||||
|
update_state = 1;
|
||||||
} else if (node->flags & REDIS_NODE_FAIL) {
|
} else if (node->flags & REDIS_NODE_FAIL) {
|
||||||
clearNodeFailureIfNeeded(node);
|
clearNodeFailureIfNeeded(node);
|
||||||
}
|
}
|
||||||
@ -1358,6 +1359,7 @@ void clusterCron(void) {
|
|||||||
redisLog(REDIS_DEBUG,"*** NODE %.40s possibly failing",
|
redisLog(REDIS_DEBUG,"*** NODE %.40s possibly failing",
|
||||||
node->name);
|
node->name);
|
||||||
node->flags |= REDIS_NODE_PFAIL;
|
node->flags |= REDIS_NODE_PFAIL;
|
||||||
|
update_state = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1374,6 +1376,8 @@ void clusterCron(void) {
|
|||||||
replicationSetMaster(server.cluster->myself->slaveof->ip,
|
replicationSetMaster(server.cluster->myself->slaveof->ip,
|
||||||
server.cluster->myself->slaveof->port);
|
server.cluster->myself->slaveof->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (update_state) clusterUpdateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user