Skip to content

[BUG?] EXEC commands succeeds when one of the queued commands uses a WATCHed expired key #9068

@oranagra

Description

@oranagra

It ins't the typical use case for WATCH-EXEC, but consider this scenario:

WATCH key
MULTI
INCR key
... time passes and key expires logically
... but not deleted yet (other clients and active expire don't hit it)
EXEC

EXEC successfully runs, the queued INCR deletes the key and creates a new one, that's non-volatile.

we could in theory actively check the expiration time of all watched keys before executing EXEC, if any are logically expired, delete them and fail the EXEC, if not proceed with EXEC, and also freeze time during EXEC so that the logical time of EXEC will not change for all commands it executes.

issue raised by @tzongw in #7920

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions