Sentinel: don't write HZ when flushing config.

See issue #1419.
This commit is contained in:
antirez 2013-12-02 15:55:19 +01:00
parent dffebbc904
commit f80cf7363a

View File

@ -1472,15 +1472,19 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
* On failure the function logs a warning on the Redis log. */
void sentinelFlushConfig(void) {
int fd;
int saved_hz = server.hz;
if (rewriteConfig(server.configfile) == -1) {
server.hz = REDIS_DEFAULT_HZ;
if (rewriteConfig(server.configfile) != -1) {
/* Rewrite succeded, fsync it. */
if ((fd = open(server.configfile,O_RDONLY)) != -1) {
fsync(fd);
close(fd);
}
} else {
redisLog(REDIS_WARNING,"WARNING: Senitnel was not able to save the new configuration on disk!!!: %s", strerror(errno));
return;
}
if ((fd = open(server.configfile,O_RDONLY)) != -1) {
fsync(fd);
close(fd);
}
server.hz = saved_hz;
return;
}