-
Notifications
You must be signed in to change notification settings - Fork 45
Description
We use nodeNext to monotor all the master in redis cluster . Every several seconds execute code
nodeIterator ni;
redisClusterNode *node;
initNodeIterator(&ni, this->_redisClusterAsyncContext->cc);
while ((node = nodeNext(&ni)) != NULL )
{
redisClusterAsyncCommandToNode(this->_redisClusterAsyncContext, node, onClusterHeartBeat, &pingCallbackRespTab[i], "PING");
}
normally it work fine and sends PING to master in each shard and when there is master failover it starts sending PING to new master.
But on larger cluster with 7 shards and large number of updates. We see that nodeNext does not return all nodes or returns slave nodes instead of master.
I would expect this to happen once or twice when routing table is updated is but after master fail over this strange behavior of nodeNext continue until we will not refresh _redisClusterAsyncContext. We call initNodeIterator before each try so its should have correct number of nodes but somehow data returned by nodeNext does not match the list of node returned by CLUSTER NODES command in redis-cli