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
b84570de
Commit
b84570de
authored
Apr 09, 2013
by
antirez
Browse files
Cluster: reconfigure additonal slaves on failover.
parent
d1aee359
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
b84570de
...
@@ -912,6 +912,18 @@ int clusterProcessPacket(clusterLink *link) {
...
@@ -912,6 +912,18 @@ int clusterProcessPacket(clusterLink *link) {
clusterSetMaster(sender);
clusterSetMaster(sender);
}
}
/* If we are a slave, and this node used to be a slave
* of our master, and now has the PROMOTED flag set, we
* need to switch our replication setup over it. */
if (flags & REDIS_NODE_PROMOTED &&
server.cluster->myself->flags & REDIS_NODE_SLAVE &&
server.cluster->myself->slaveof == oldmaster)
{
redisLog(REDIS_WARNING,"One of the slaves failed over my master. Reconfiguring myself as a replica of %.40s", sender->name);
clusterDelNodeSlots(server.cluster->myself);
clusterSetMaster(sender);
}
/* Update config and state. */
/* Update config and state. */
update_state = 1;
update_state = 1;
update_config = 1;
update_config = 1;
...
...
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