• Binbin's avatar
    Add KVSTORE_FREE_EMPTY_DICTS to cluster mode keys / expires kvstore (#13072) · 3b3d16f7
    Binbin authored
    
    
    Currently (following #11695, and #12822), keys kvstore and expires
    kvstore both flag with ON_DEMAND, it means that a cluster node will
    only allocate a dict when the slot is assigned to it and populated,
    but on the other hand, when the slot is unassigned, the dict will
    remain allocated.
    
    We considered releasing the dict when the slot is unassigned, but it
    causes complications on replicas. On the other hand, from benchmarks
    we conducted, it looks like the performance impact of releasing the
    dict when it becomes empty and re-allocate it when a key is added
    again, isn't huge.
    
    This PR add KVSTORE_FREE_EMPTY_DICTS to cluster mode keys / expires
    kvstore.
    
    The impact is about about 2% performance drop, for this hopefully
    uncommon scenario.
    
    ---------
    Co-authored-by: default avatarOran Agra <oran@redislabs.com>
    3b3d16f7
server.c 288 KB