From b065f4441be122c707e6109eee37d61e91b1c244 Mon Sep 17 00:00:00 2001 From: therealbill Date: Thu, 23 Apr 2015 11:56:15 -0500 Subject: [PATCH] Making sentinel flush config on +slave Originally, only the +slave event which occurs when a slave is reconfigured during sentinelResetMasterAndChangeAddress triggers a flush of the config to disk. However, newly discovered slaves don't apparently trigger this flush but do trigger the +slave event issuance. So if you start up a sentinel, add a master, then add a slave to the master (as a way to reproduce it) you'll see the +slave event issued, but the sentinel config won't be updated with the known-slave entry. This change makes sentinel do the flush of the config if a new slave is deteted in sentinelRefreshInstanceInfo. --- src/sentinel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sentinel.c b/src/sentinel.c index dfd901bc..85ae7c37 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -1842,6 +1842,7 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) { atoi(port), ri->quorum, ri)) != NULL) { sentinelEvent(REDIS_NOTICE,"+slave",slave,"%@"); + sentinelFlushConfig(); } } }