if (de) {
robj *val = dictGetEntryVal(de);
- /* Update the access time for the aging algorithm. */
- val->lru = server.lruclock;
+ /* Update the access time for the aging algorithm.
+ * Don't do it if we have a saving child, as this will trigger
+ * a copy on write madness. */
+ if (server.bgsavechildpid == -1 && server.bgrewritechildpid == -1)
+ val->lru = server.lruclock;
if (server.vm_enabled) {
if (val->storage == REDIS_VM_MEMORY ||
if (notify) handleClientsBlockedOnSwappedKey(db,key);
}
}
+ server.stat_keyspace_hits++;
return val;
} else {
+ server.stat_keyspace_misses++;
return NULL;
}
}
/* Delete the key */
server.stat_expiredkeys++;
- server.dirty++;
propagateExpire(db,key);
return dbDelete(db,key);
}