diff options
author | antirez <antirez@gmail.com> | 2014-02-07 11:22:24 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-02-07 11:22:24 +0100 |
commit | 2d6eb6899319276c0071b922b9458caa909040e1 (patch) | |
tree | 940e355bb083ddcbe0706ee5afdd71f18b78ea3b /src/db.c | |
parent | 970de3e9c0f4e4b0ac56d1710e3b66f4a0cd06a5 (diff) | |
download | redis-2d6eb6899319276c0071b922b9458caa909040e1.tar.gz |
Sentinel: allow SHUTDOWN command in Sentinel mode.
Diffstat (limited to 'src/db.c')
-rw-r--r-- | src/db.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -605,11 +605,13 @@ void shutdownCommand(redisClient *c) { return; } } - /* SHUTDOWN can be called even while the server is in "loading" state. - * When this happens we need to make sure no attempt is performed to save + /* When SHUTDOWN is called while the server is loading a dataset in + * memory we need to make sure no attempt is performed to save * the dataset on shutdown (otherwise it could overwrite the current DB - * with half-read data). */ - if (server.loading) + * with half-read data). + * + * Also when in Sentinel mode clear the SAVE flag and force NOSAVE. */ + if (server.loading || server.sentinel_mode) flags = (flags & ~REDIS_SHUTDOWN_SAVE) | REDIS_SHUTDOWN_NOSAVE; if (prepareForShutdown(flags) == REDIS_OK) exit(0); addReplyError(c,"Errors trying to SHUTDOWN. Check logs."); |