Commit 4ccf807a authored by antirez's avatar antirez
Browse files

Sentinel: safer slave reconfig, master reported role should match.

parent e98d82c6
......@@ -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)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment