redisAssert(server.cluster.myself != NULL);
redisLog(REDIS_NOTICE,"Node configuration loaded, I'm %.40s",
server.cluster.myself->name);
+ clusterUpdateState();
return REDIS_OK;
fmterr:
clusterNode *failing;
failing = clusterLookupNode(hdr->data.fail.about.nodename);
- if (failing && !(failing->flags & REDIS_NODE_FAIL)) {
+ if (failing && !(failing->flags & (REDIS_NODE_FAIL|REDIS_NODE_MYSELF)))
+ {
redisLog(REDIS_NOTICE,
"FAIL message received from %.40s about %.40s",
hdr->sender, hdr->data.fail.about.nodename);
node->flags &= ~REDIS_NODE_PFAIL;
} else if (node->flags & REDIS_NODE_FAIL && !node->numslaves) {
node->flags &= ~REDIS_NODE_FAIL;
+ clusterUpdateState();
}
} else {
/* Timeout reached. Set the noad se possibly failing if it is
* an error and REDIS_ERR is returned. */
int clusterAddSlot(clusterNode *n, int slot) {
redisAssert(clusterNodeSetSlotBit(n,slot) == 0);
- server.cluster.slots[slot] = server.cluster.myself;
+ server.cluster.slots[slot] = n;
printf("SLOT %d added to %.40s\n", slot, n->name);
return REDIS_OK;
}