Skip to content
Browse files

Changed the reply of BGSAVE and BGREWRITEAOF from +OK to a more meani…

…ngful message that makes the user aware of an operation that just started and is not yet finished.
  • Loading branch information...
1 parent 179b395 commit 49b99ab43e8160feb8478ebb09db0e0db942afcf @antirez committed Dec 13, 2009
Showing with 7 additions and 2 deletions.
  1. +4 −2 redis.c
  2. +3 −0 redis.conf
View
6 redis.c
@@ -3295,7 +3295,8 @@ static void bgsaveCommand(redisClient *c) {
return;
}
if (rdbSaveBackground(server.dbfilename) == REDIS_OK) {
- addReply(c,shared.ok);
+ char *status = "+Background saving started\r\n";
+ addReplySds(c,sdsnew(status));
} else {
addReply(c,shared.err);
}
@@ -6082,7 +6083,8 @@ static void bgrewriteaofCommand(redisClient *c) {
return;
}
if (rewriteAppendOnlyFileBackground() == REDIS_OK) {
- addReply(c,shared.ok);
+ char *status = "+Background append only file rewriting started\r\n";
+ addReplySds(c,sdsnew(status));
} else {
addReply(c,shared.err);
}
View
3 redis.conf
@@ -130,6 +130,9 @@ databases 16
# log file at startup ignoring the dump.rdb file.
#
# The name of the append only file is "appendonly.log"
+#
+# IMPORTANT: Check the BGREWRITEAOF to check how to rewrite the append
+# log file in background when it gets too big.
appendonly no

1 comment on commit 49b99ab

@erichocean

An EPOCH call would be helpful to me:

EPOCH -> returns an integer id representing the current epoch; incremented whenever a save completes, whether automatic or via a SAVE or BGSAVE call.

In this way, multiple Redis clients can "wait" for the EPOCH to change before replying to clients, while only a single client needs to send SAVE calls to Redis for the whole group. In addition, it would provide a way to detect when a BGSAVE completed.

Please sign in to comment.
Something went wrong with that request. Please try again.