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
dd0ac4ac
Commit
dd0ac4ac
authored
Dec 02, 2013
by
antirez
Browse files
Sentinel: don't write HZ when flushing config.
See issue #1419.
parent
75347ada
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
dd0ac4ac
...
...
@@ -1474,15 +1474,19 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
* On failure the function logs a warning on the Redis log. */
void
sentinelFlushConfig
(
void
)
{
int
fd
;
if
(
rewriteConfig
(
server
.
configfile
)
==
-
1
)
{
int
saved_hz
=
server
.
hz
;
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
;
}
...
...
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