server.appendonly = appendonly;
stopLoading();
aofUpdateCurrentSize();
+ server.auto_aofrewrite_base_size = server.appendonly_current_size;
return REDIS_OK;
readerr:
redisDb *db = server.db+j;
dict *d = db->dict;
if (dictSize(d) == 0) continue;
- di = dictGetIterator(d);
+ di = dictGetSafeIterator(d);
if (!di) {
fclose(fp);
return REDIS_ERR;
long long start;
if (server.bgrewritechildpid != -1) return REDIS_ERR;
- if (server.ds_enabled != 0) {
- redisLog(REDIS_WARNING,"BGREWRITEAOF called with diskstore enabled: AOF is not supported when diskstore is enabled. Operation not performed.");
- return REDIS_ERR;
- }
start = ustime();
if ((childpid = fork()) == 0) {
char tmpfile[256];
addReplyError(c,"Background append only file rewriting already in progress");
} else if (server.bgsavechildpid != -1) {
server.aofrewrite_scheduled = 1;
- addReplyStatus(c,"Background append only file rewriting started");
+ addReplyStatus(c,"Background append only file rewriting scheduled");
} else if (rewriteAppendOnlyFileBackground() == REDIS_OK) {
addReplyStatus(c,"Background append only file rewriting started");
} else {
server.appendseldb = -1; /* Make sure it will issue SELECT */
redisLog(REDIS_NOTICE,"The new append only file was selected for future appends.");
aofUpdateCurrentSize();
+ server.auto_aofrewrite_base_size = server.appendonly_current_size;
} else {
/* If append only is disabled we just generate a dump in this
* format. Why not? */