Commit 040b0ade authored by Hampus Wessman's avatar Hampus Wessman Committed by antirez
Browse files

Don't expire keys while loading AOF.

They will be expired (and a DEL will be logged) after the loading is done
instead.
parent 72bae0cc
...@@ -476,6 +476,9 @@ int expireIfNeeded(redisDb *db, robj *key) { ...@@ -476,6 +476,9 @@ int expireIfNeeded(redisDb *db, robj *key) {
if (when < 0) return 0; /* No expire for this key */ if (when < 0) return 0; /* No expire for this key */
/* Don't expire anything while loading. It will be done later. */
if (server.loading) return 0;
/* If we are running in the context of a slave, return ASAP: /* If we are running in the context of a slave, return ASAP:
* the slave key expiration is controlled by the master that will * the slave key expiration is controlled by the master that will
* send us synthesized DEL operations for expired keys. * send us synthesized DEL operations for expired keys.
...@@ -513,7 +516,7 @@ void expireGenericCommand(redisClient *c, robj *key, robj *param, long offset) { ...@@ -513,7 +516,7 @@ void expireGenericCommand(redisClient *c, robj *key, robj *param, long offset) {
addReply(c,shared.czero); addReply(c,shared.czero);
return; return;
} }
if (seconds <= 0) { if (seconds <= 0 && !server.loading) {
if (dbDelete(c->db,key)) server.dirty++; if (dbDelete(c->db,key)) server.dirty++;
addReply(c, shared.cone); addReply(c, shared.cone);
signalModifiedKey(c->db,key); signalModifiedKey(c->db,key);
......
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