Commit dd0ac4ac authored by antirez's avatar antirez
Browse files

Sentinel: don't write HZ when flushing config.

See issue #1419.
parent 75347ada
...@@ -1474,15 +1474,19 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) { ...@@ -1474,15 +1474,19 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
* On failure the function logs a warning on the Redis log. */ * On failure the function logs a warning on the Redis log. */
void sentinelFlushConfig(void) { void sentinelFlushConfig(void) {
int fd; 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)); 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; return;
} }
......
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