Commit aeacaa57 authored by antirez's avatar antirez
Browse files

Cluster: code to process messages moved in the right if-else chain.

parent 35f05c66
...@@ -872,17 +872,6 @@ int clusterProcessPacket(clusterLink *link) { ...@@ -872,17 +872,6 @@ int clusterProcessPacket(clusterLink *link) {
* status... */ * status... */
return 0; return 0;
} }
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST) {
if (!sender) return 0; /* We don't know that node. */
/* If we are not a master, ignore that message at all. */
if (!(server.cluster->myself->flags & REDIS_NODE_MASTER)) return 0;
clusterSendFailoverAuthIfNeeded(sender);
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK) {
if (!sender) return 0; /* We don't know that node. */
/* If this is a master, increment the number of acknowledges
* we received so far. */
if (sender->flags & REDIS_NODE_MASTER)
server.cluster->failover_auth_count++;
} }
/* Update our info about the node */ /* Update our info about the node */
...@@ -976,6 +965,17 @@ int clusterProcessPacket(clusterLink *link) { ...@@ -976,6 +965,17 @@ int clusterProcessPacket(clusterLink *link) {
decrRefCount(channel); decrRefCount(channel);
decrRefCount(message); decrRefCount(message);
} }
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST) {
if (!sender) return 0; /* We don't know that node. */
/* If we are not a master, ignore that message at all. */
if (!(server.cluster->myself->flags & REDIS_NODE_MASTER)) return 0;
clusterSendFailoverAuthIfNeeded(sender);
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK) {
if (!sender) return 0; /* We don't know that node. */
/* If this is a master, increment the number of acknowledges
* we received so far. */
if (sender->flags & REDIS_NODE_MASTER)
server.cluster->failover_auth_count++;
} else { } else {
redisLog(REDIS_WARNING,"Received unknown packet type: %d", type); redisLog(REDIS_WARNING,"Received unknown packet type: %d", type);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment