Redis 8.4 introduces a new CLAIM option for XREADGROUP that collapses the traditional multi-command reliable consumer loop (XPENDING + XCLAIM/XAUTOCLAIM + XREADGROUP) into a single round trip. The command first reclaims idle pending entries exceeding a specified min-idle-time threshold, then reads new messages, sharing a single COUNT budget. Benchmarks show up to 22.5x lower latency compared to XAUTOCLAIM on workloads with large PELs and few idle entries. Internally, a time-ordered index was implemented first as a rax tree (O(log n + k) lookups) and then optimized to a doubly-linked list embedded in each streamNACK struct, achieving O(k) idle-entry queries and O(1) delivery-time updates — yielding an additional 28% throughput improvement and reduced memory overhead. The feature is fully backward compatible.
Table of contents
A quick primer on the Pending Entries ListThe reliable consumer loop, before Redis 8.4Introducing the CLAIM optionPerformance impactUnder the hoodCompatibilityWrapping upSort: