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.
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.queueScoreis-priority * 1e13 + enqueueMicros. A one-level priority difference is only10^13microseconds, so age eventually overwhelms priority.Acceptance criteria
(priority DESC, id)for the complete supported priority and timestamp range.