提交 4ccf807a 编写于 作者: A antirez

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

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册