]> git.saurik.com Git - redis.git/commitdiff
Do not update the LRU info on key lookup when we have a saving child. With this trivi...
authorantirez <antirez@gmail.com>
Tue, 2 Nov 2010 17:59:48 +0000 (18:59 +0100)
committerantirez <antirez@gmail.com>
Tue, 2 Nov 2010 17:59:48 +0000 (18:59 +0100)
src/db.c

index a39a03bbfea676b4aaef8dbe43ab53140a376c7c..f2a0c09ee09658823ad783ca4446b6c85e787c99 100644 (file)
--- a/src/db.c
+++ b/src/db.c
@@ -11,8 +11,11 @@ robj *lookupKey(redisDb *db, robj *key) {
     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 ||