mirror of
https://github.com/fluencelabs/redis
synced 2025-05-29 02:01:19 +00:00
Sentinel: safer slave reconfig, master reported role should match.
This commit is contained in:
parent
e98d82c639
commit
4ccf807abc
@ -1607,6 +1607,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