Commit 99c93f34 authored by antirez's avatar antirez
Browse files

Sentinel: remove useless sentinelFlushConfig() call

To rewrite the config in the loop that adds slaves back after a master
reset, in order to handle switching to another master, is useless: it
just adds latency since there is an fsync call in the inner loop,
without providing any additional guarantee, but the contrary, since if
after the first loop iteration the server crashes we end with just a
single slave entry losing all the other informations.

It is wiser to rewrite the config at the end when the full new
state is configured.
parent 22d00d80
...@@ -1271,10 +1271,7 @@ int sentinelResetMasterAndChangeAddress(sentinelRedisInstance *master, char *ip, ...@@ -1271,10 +1271,7 @@ int sentinelResetMasterAndChangeAddress(sentinelRedisInstance *master, char *ip,
slave = createSentinelRedisInstance(NULL,SRI_SLAVE,slaves[j]->ip, slave = createSentinelRedisInstance(NULL,SRI_SLAVE,slaves[j]->ip,
slaves[j]->port, master->quorum, master); slaves[j]->port, master->quorum, master);
releaseSentinelAddr(slaves[j]); releaseSentinelAddr(slaves[j]);
if (slave) { if (slave) sentinelEvent(REDIS_NOTICE,"+slave",slave,"%@");
sentinelEvent(REDIS_NOTICE,"+slave",slave,"%@");
sentinelFlushConfig();
}
} }
zfree(slaves); zfree(slaves);
......
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