Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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.
  • Loading branch information...
commit 91654a40e7aa11f6cfadc209ac82e2587f7401f1 1 parent 6191741
@hampus hampus authored committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/db.c
View
5 src/db.c
@@ -467,6 +467,9 @@ int expireIfNeeded(redisDb *db, robj *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:
* the slave key expiration is controlled by the master that will
* send us synthesized DEL operations for expired keys.
@@ -504,7 +507,7 @@ void expireGenericCommand(redisClient *c, robj *key, robj *param, long offset) {
addReply(c,shared.czero);
return;
}
- if (seconds <= 0) {
+ if (seconds <= 0 && !server.loading) {
if (dbDelete(c->db,key)) server.dirty++;
addReply(c, shared.cone);
touchWatchedKey(c->db,key);
Please sign in to comment.
Something went wrong with that request. Please try again.