• Viktor Söderqvist's avatar
    Remove the bucket-cb from dictScan and move dictEntry defrag to dictScanDefrag · b60d33c9
    Viktor Söderqvist authored
    This change deletes the dictGetNext and dictGetNextRef functions, so the
    dict API doesn't expose the next field at all.
    
    The bucket function in dictScan is deleted. A separate dictScanDefrag function
    is added which takes a defrag alloc function to defrag-reallocate the dict entries.
    
    "Dirty" code accessing the dict internals in active defrag is removed.
    
    An 'afterReplaceEntry' is added to dictType, which allows the dict user
    to keep the dictEntry metadata up to date after reallocation/defrag/move.
    
    Additionally, for updating the cluster slot-to-key mapping, after a dictEntry
    has been reallocated, we need to know which db a dict belongs to, so we store
    a pointer to the db in a new metadata section in the dict struct, which is
    a new mechanism similar to dictEntry metadata. This adds some complexity but
    provides better isolation.
    b60d33c9
cluster.c 292 KB