From 0582263bafa07b7f38dfcb5762d9c641557ae161 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 10 Jun 2011 14:47:12 +0200 Subject: [PATCH] Fixed bug in AOF rewrite not working because of integer overflow --- src/redis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redis.c b/src/redis.c index 263172259..dbc800fd4 100644 --- a/src/redis.c +++ b/src/redis.c @@ -697,9 +697,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { { int base = server.auto_aofrewrite_base_size ? server.auto_aofrewrite_base_size : 1; - int growth = (server.appendonly_current_size*100/base); + long long growth = (server.appendonly_current_size*100/base); if (growth >= server.auto_aofrewrite_perc) { - redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %d growth",growth); + redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %lld growth",growth); rewriteAppendOnlyFileBackground(); } }