• Ronen Kalish's avatar
    Hfe serialization listpack (#13243) · 323be4d6
    Ronen Kalish authored
    Add RDB de/serialization for HFE
    
    This PR adds two new RDB types: `RDB_TYPE_HASH_METADATA` and
    `RDB_TYPE_HASH_LISTPACK_TTL` to save HFE data.
    When the hash RAM encoding is dict, it will be saved in the former, and
    when it is listpack it will be saved in the latter.
    Both formats just add the TTL value for each field after the data that
    was previously saved, i.e HASH_METADATA will save the number of entries
    and, for each entry, key, value and TTL, whereas listpack is saved as a
    blob.
    On read, the usual dict <--> listpack conversion takes place if
    required.
    In addition, when reading a hash that was saved as a dict fields are
    actively expired if expiry is due. Currently this slao holds for
    listpack encoding, but it is supposed to be removed.
    
    TODO:
    Remove active expiry on load when loading from listpack format (unless
    we'll decide to keep it)
    323be4d6
cluster.c 55.3 KB