mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
Sentinel: safer slave reconfig, master reported role should match.
This commit is contained in:
parent
ddaad9fe2d
commit
76a88f56e5
@ -1605,6 +1605,7 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
|
||||
/* Make sure the master is sane before reconfiguring this instance
|
||||
* into a slave. */
|
||||
if (ri->master->flags & SRI_MASTER &&
|
||||
ri->master->role_reported == SRI_MASTER &&
|
||||
(ri->master->flags & (SRI_S_DOWN|SRI_O_DOWN)) == 0 &&
|
||||
(mstime() - ri->master->info_refresh) < SENTINEL_INFO_PERIOD*2)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user