propagate key eviction to slaves and AOF, like for expires, so that replicas and AOFs are always consistent even in maxmemory mode.

This commit is contained in:
antirez 2011-01-27 16:52:37 +01:00
parent be86082be4
commit 452229b6fb

View File

@ -1564,6 +1564,7 @@ void freeMemoryIfNeeded(void) {
/* Finally remove the selected key. */
if (bestkey) {
robj *keyobj = createStringObject(bestkey,sdslen(bestkey));
propagateExpire(db,keyobj);
dbDelete(db,keyobj);
server.stat_evictedkeys++;
decrRefCount(keyobj);