From 0b17517c7c9f1f6b1c299346b7b4fa374e343fbc Mon Sep 17 00:00:00 2001 From: Hampus Wessman Date: Sun, 12 Jun 2011 07:27:01 +0200 Subject: [PATCH] Fix automatic rewrite starting too early. Slight adjustment in growth calculation. --- src/redis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 33cef0150..e7351b6ef 100644 --- a/src/redis.c +++ b/src/redis.c @@ -699,7 +699,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { { int base = server.auto_aofrewrite_base_size ? server.auto_aofrewrite_base_size : 1; - long long growth = (server.appendonly_current_size*100/base); + long long growth = (server.appendonly_current_size*100/base) - 100; if (growth >= server.auto_aofrewrite_perc) { redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %lld%% growth",growth); rewriteAppendOnlyFileBackground();