• antirez's avatar
    RDB: Ability to save LFU/LRU info. · d7a5c0eb
    antirez authored
    This is a big win for caching use cases, since on reloading Redis will
    still have some idea about what is worth to evict and what not.
    However this only solves part of the problem because the information is
    only partially propagated to slaves (on write operations). Reads will
    not affect slaves LFU and LRU counters, so after a failover the eviction
    decisions are kinda random until keys start to collect some aging/freq info.
    
    However since new slaves are initially populated via RDB file transfer,
    this means that if we spin up a new slave from a master, and perform an
    immediate manual failover (for instance in order to upgrade the master),
    the slave will have eviction informations to use for some time.
    
    The LFU/LRU info is persisted only if the maxmemory policy is set to one
    of the relevant type, even if no actual "maxmemory"  memory limit is
    set.
    d7a5c0eb
rdb.h 6.82 KB