Skip to content

Redis priority ordering breaks for backlogs older than 115 days #91

Description

@hemju

Impact

Redis does not preserve strict priority ordering once an ENQUEUED backlog spans more than about 115.74 days. An old lower-priority job can sort ahead of a newer higher-priority job, unlike memory and PostgreSQL.

Root cause

RedisKeys.queueScore is -priority * 1e13 + enqueueMicros. A one-level priority difference is only 10^13 microseconds, so age eventually overwhelms priority.

Acceptance criteria

  • Redis ordering exactly matches (priority DESC, id) for the complete supported priority and timestamp range.
  • Preserve deterministic FIFO/tie behavior using the UUID member or an equivalent representation.
  • Add a fixed-clock regression with jobs separated by more than 116 days.
  • Update key-layout documentation and Lua/index consistency tests as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions