Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f80cf736
Commit
f80cf736
authored
Dec 02, 2013
by
antirez
Browse files
Sentinel: don't write HZ when flushing config.
See issue #1419.
parent
dffebbc9
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
f80cf736
...
@@ -1472,15 +1472,19 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
...
@@ -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;
redisLog(REDIS_WARNING,"WARNING: Senitnel was not able to save the new configuration on disk!!!: %s", strerror(errno));
if (rewriteConfig(server.configfile) != -1) {
return;
/* Rewrite succeded, fsync it. */
}
if ((fd = open(server.configfile,O_RDONLY)) != -1) {
if ((fd = open(server.configfile,O_RDONLY)) != -1) {
fsync(fd);
fsync(fd);
close(fd);
close(fd);
}
}
} else {
redisLog(REDIS_WARNING,"WARNING: Senitnel was not able to save the new configuration on disk!!!: %s", strerror(errno));
}
server.hz = saved_hz;
return;
return;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment