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
089cbe64
Commit
089cbe64
authored
Jan 31, 2013
by
antirez
Browse files
Sentinel: advertise the promoted slave address only after successful setup.
parent
aca005c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
089cbe64
...
@@ -2035,8 +2035,16 @@ void sentinelCommand(redisClient *c) {
...
@@ -2035,8 +2035,16 @@ void sentinelCommand(redisClient *c) {
} else {
} else {
sentinelAddr *addr = ri->addr;
sentinelAddr *addr = ri->addr;
if
((
ri
->
flags
&
SRI_FAILOVER_IN_PROGRESS
)
&&
ri
->
promoted_slave
)
/* If we are in the middle of a failover, and the slave was
* already successfully switched to master role, we can advertise
* the new address as slave in order to allow clients to talk
* with the new master ASAP. */
if ((ri->flags & SRI_FAILOVER_IN_PROGRESS) &&
ri->promoted_slave &&
ri->failover_state >= SENTINEL_FAILOVER_STATE_RECONF_SLAVES)
{
addr = ri->promoted_slave->addr;
addr = ri->promoted_slave->addr;
}
addReplyMultiBulkLen(c,2);
addReplyMultiBulkLen(c,2);
addReplyBulkCString(c,addr->ip);
addReplyBulkCString(c,addr->ip);
addReplyBulkLongLong(c,addr->port);
addReplyBulkLongLong(c,addr->port);
...
...
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