Cluster: set node role on successful handshake.

This commit is contained in:
antirez 2013-03-25 13:03:01 +01:00
parent cda0cdfb70
commit 34c1871e9f

View File

@ -855,6 +855,7 @@ int clusterProcessPacket(clusterLink *link) {
redisLog(REDIS_DEBUG,"Handshake with node %.40s completed.", redisLog(REDIS_DEBUG,"Handshake with node %.40s completed.",
link->node->name); link->node->name);
link->node->flags &= ~REDIS_NODE_HANDSHAKE; link->node->flags &= ~REDIS_NODE_HANDSHAKE;
link->node->flags |= flags&(REDIS_NODE_MASTER|REDIS_NODE_SLAVE);
update_config = 1; update_config = 1;
} else if (memcmp(link->node->name,hdr->sender, } else if (memcmp(link->node->name,hdr->sender,
REDIS_CLUSTER_NAMELEN) != 0) REDIS_CLUSTER_NAMELEN) != 0)