Commit 4f948300 authored by antirez's avatar antirez
Browse files

Fixed bug in AOF rewrite not working because of integer overflow

parent 73b9e8ae
...@@ -697,9 +697,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { ...@@ -697,9 +697,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
{ {
int base = server.auto_aofrewrite_base_size ? int base = server.auto_aofrewrite_base_size ?
server.auto_aofrewrite_base_size : 1; 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) { 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(); rewriteAppendOnlyFileBackground();
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment