Fix automatic rewrite starting too early.

Slight adjustment in growth calculation.
This commit is contained in:
Hampus Wessman
2011-06-12 07:27:01 +02:00
committed by antirez
parent 61751a4dc4
commit b90c72c86a

View File

@ -635,7 +635,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();