mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 08:00:49 +00:00
SHUTDOWN now does the right thing when append only is on, that is, fsync instead to save the snapshot.
This commit is contained in:
parent
fdcaae84d3
commit
ac945e2dcf
2
TODO
2
TODO
@ -75,7 +75,7 @@ it's not a guarantee they'll ever get implemented ;)
|
||||
* Pattern-matching replication.
|
||||
* Don't save empty lists / sets / zsets on disk with snapshotting.
|
||||
* Remove keys when a list / set / zset reaches length of 0.
|
||||
* Add an option to relax the delete-expiring-keys-on-write semantic *denying* replication and AOF when this is on? Can be handy sometimes, when using Redis for non persistent state.
|
||||
* Add an option to relax the delete-expiring-keys-on-write semantic *denying* replication and AOF when this is on? Can be handy sometimes, when using Redis for non persistent state, but can create problems. For instance should rename and move also "move" the timeouts? How does this affect other commands?
|
||||
|
||||
DOCUMENTATION WISHLIST
|
||||
======================
|
||||
|
32
redis.c
32
redis.c
@ -3320,20 +3320,26 @@ static void shutdownCommand(redisClient *c) {
|
||||
kill(server.bgsavechildpid,SIGKILL);
|
||||
rdbRemoveTempFile(server.bgsavechildpid);
|
||||
}
|
||||
/* SYNC SAVE */
|
||||
if (rdbSave(server.dbfilename) == REDIS_OK) {
|
||||
if (server.daemonize)
|
||||
unlink(server.pidfile);
|
||||
redisLog(REDIS_WARNING,"%zu bytes used at exit",zmalloc_used_memory());
|
||||
redisLog(REDIS_WARNING,"Server exit now, bye bye...");
|
||||
exit(1);
|
||||
if (server.appendonly) {
|
||||
/* Append only file: fsync() the AOF and exit */
|
||||
fsync(server.appendfd);
|
||||
exit(0);
|
||||
} else {
|
||||
/* Ooops.. error saving! The best we can do is to continue operating.
|
||||
* Note that if there was a background saving process, in the next
|
||||
* cron() Redis will be notified that the background saving aborted,
|
||||
* handling special stuff like slaves pending for synchronization... */
|
||||
redisLog(REDIS_WARNING,"Error trying to save the DB, can't exit");
|
||||
addReplySds(c,sdsnew("-ERR can't quit, problems saving the DB\r\n"));
|
||||
/* Snapshotting. Perform a SYNC SAVE and exit */
|
||||
if (rdbSave(server.dbfilename) == REDIS_OK) {
|
||||
if (server.daemonize)
|
||||
unlink(server.pidfile);
|
||||
redisLog(REDIS_WARNING,"%zu bytes used at exit",zmalloc_used_memory());
|
||||
redisLog(REDIS_WARNING,"Server exit now, bye bye...");
|
||||
exit(0);
|
||||
} else {
|
||||
/* Ooops.. error saving! The best we can do is to continue operating.
|
||||
* Note that if there was a background saving process, in the next
|
||||
* cron() Redis will be notified that the background saving aborted,
|
||||
* handling special stuff like slaves pending for synchronization... */
|
||||
redisLog(REDIS_WARNING,"Error trying to save the DB, can't exit");
|
||||
addReplySds(c,sdsnew("-ERR can't quit, problems saving the DB\r\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1184,7 +1184,11 @@ proc main {server port} {
|
||||
set _ $err
|
||||
} {}
|
||||
|
||||
test {ZRANGE and ZREVRANGE} {
|
||||
test {ZRANGE and ZREVRANGE basics} {
|
||||
list [$r zrange ztmp 0 -1] [$r zrevrange ztmp 0 -1]
|
||||
} {{y x z} {z x y}}
|
||||
|
||||
test {ZRANGE and ZREVRANGE stress testing} {
|
||||
list [$r zrange ztmp 0 -1] [$r zrevrange ztmp 0 -1]
|
||||
} {{y x z} {z x y}}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user