Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
aeacaa57
Commit
aeacaa57
authored
Mar 14, 2013
by
antirez
Browse files
Cluster: code to process messages moved in the right if-else chain.
parent
35f05c66
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
aeacaa57
...
@@ -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);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment