• antirez's avatar
    LRU: Make cross-database choices for eviction. · e423f76e
    antirez authored
    The LRU eviction code used to make local choices: for each DB visited it
    selected the best key to evict. This was repeated for each DB. However
    this means that there could be DBs with very frequently accessed keys
    that are targeted by the LRU algorithm while there were other DBs with
    many better candidates to expire.
    
    This commit attempts to fix this problem for the LRU policy. However the
    TTL policy is still not fixed by this commit. The TTL policy will be
    fixed in a successive commit.
    
    This is an initial (partial because of TTL policy) fix for issue #2647.
    e423f76e
evict.c 17.7 KB