Skip to content

Sort out mess around propagation and lazy-expiration #11792

@soloestoy

Description

@soloestoy

Redis uses lazy-expiration to delete stale keys, that is when a command touches a expired key, it should delete the key and propagate the deletion at first.

But there are many bugs in past, present and maybe future... time is a too flexible variable.

  1. delete expired keys in EVAL may cause data inconsistency after replication, discussed in EVAL replicated + conditionals about key existence = replication bug. #1525, fixed
  2. time's change breaks command's atomicity and cause server crash in some commands like SPOP and BRPOPLPUSH, discussed in Made brpoplpush and spop with count atomic when replicating #6152, fixed in Wrap also propagate as multi #6615 by introduce time snapshot
  3. wrapping expire-dels in a transaction to propagate but leads to CROSSSLOT replication in SCAN and RANDOMKEY, introduced in Sort out mess around propagation and MULTI/EXEC #9890 and fixed in SCAN/RANDOMKEY and lazy-expire #11788
  4. wrapping write command and expire-dels in a transaction to propagate, introduced in Sort out mess around propagation and MULTI/EXEC #9890, not fixed
  5. SCAN in MULTI/EXEC triggers expire-dels and expire-dels wrapped in a transaction to propagate, leads to CROSSSLOT replication, not fixed
  6. Modules + notifications may cause unwanted propagation [BUG] Modules + notifications may cause unwanted propagation #10014 not fixed
  7. maybe some other cases around scripts and module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions