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
ed705f47
Commit
ed705f47
authored
Jun 21, 2014
by
Matt Stancliff
Committed by
antirez
Jun 23, 2014
Browse files
Cancel SHUTDOWN if initial AOF is being written
Fixes #1826 (and many other reports of the same problem)
parent
9a5408f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
ed705f47
...
...
@@ -2152,6 +2152,12 @@ int prepareForShutdown(int flags) {
/* Kill the AOF saving child as the AOF we already have may be longer
* but contains the full dataset anyway. */
if
(
server
.
aof_child_pid
!=
-
1
)
{
/* If we have AOF enabled but haven't written the AOF yet, don't
* shutdown or else the dataset will be lost. */
if
(
server
.
aof_state
==
REDIS_AOF_WAIT_REWRITE
)
{
redisLog
(
REDIS_WARNING
,
"Writing initial AOF, can't exit."
);
return
REDIS_ERR
;
}
redisLog
(
REDIS_WARNING
,
"There is a child rewriting the AOF. Killing it!"
);
kill
(
server
.
aof_child_pid
,
SIGUSR1
);
...
...
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