mirror of
https://github.com/redis/redis.git
synced 2026-05-14 03:01:49 -04:00
Sentinel: safer slave reconfig, master reported role should match.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user