Cluster: code to process messages moved in the right if-else chain.
This commit is contained in:
parent
35f05c66b6
commit
aeacaa57e6
@ -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) {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user