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
76a88f56
Commit
76a88f56
authored
Nov 13, 2013
by
antirez
Browse files
Sentinel: safer slave reconfig, master reported role should match.
parent
ddaad9fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
76a88f56
...
@@ -1605,6 +1605,7 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
...
@@ -1605,6 +1605,7 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
/* Make sure the master is sane before reconfiguring this instance
/* Make sure the master is sane before reconfiguring this instance
* into a slave. */
* into a slave. */
if (ri->master->flags & SRI_MASTER &&
if (ri->master->flags & SRI_MASTER &&
ri->master->role_reported == SRI_MASTER &&
(ri->master->flags & (SRI_S_DOWN|SRI_O_DOWN)) == 0 &&
(ri->master->flags & (SRI_S_DOWN|SRI_O_DOWN)) == 0 &&
(mstime() - ri->master->info_refresh) < SENTINEL_INFO_PERIOD*2)
(mstime() - ri->master->info_refresh) < SENTINEL_INFO_PERIOD*2)
{
{
...
...
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