1
0
mirror of https://github.com/fluencelabs/redis synced 2025-03-18 00:20:50 +00:00

Sentinel: don't write HZ when flushing config.

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

@ -1472,15 +1472,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;
} }