TECHNOLOGY

An empty XAUTOCLAIM batch does not finish Redis recovery

In this article
THE QUICK TAKE

Advance the returned cursor, classify missing payloads and repeat eligibility passes instead of stopping on an empty claimed list.

Recovery stops while pending work remains

A recovering service calls XAUTOCLAIM, receives no claimed messages and concludes that no abandoned work exists. That conclusion confuses the result of an eligibility filter with completion of the pending-entry scan.

The command reference describes cursor-like traversal of the consumer group’s pending entries. Each call can inspect entries that are not yet idle long enough to claim. A small or empty returned batch therefore does not independently establish that the scan reached its end.

Follow the returned cursor

Keep the returned continuation ID separately from the claimed-message list. Feed that ID into the subsequent call. The documented terminal cursor is 0-0; stopping solely because the list is empty can repeatedly overlook eligible work later in the pending list.

COUNT bounds attempted claiming, not a promise to return that many messages. The server also bounds scanning effort. Increasing COUNT changes effort and response shape, but it does not remove the need to interpret the cursor correctly.

Treat eligibility as time-dependent

A pending message that fails the idle threshold during a pass can become eligible later. Even a completed pass is therefore a statement about that traversal and its timing, not a permanent proof that recovery has finished for all future time.

Claiming resets idle time and transfers ownership. This reduces simultaneous successful claims at an instant; it does not establish that the previous worker stopped executing an external effect. Recovery still requires coordination or duplicate-safe business operations when a supposedly abandoned worker remains alive.

Separate missing entries from recoverable payloads

The current reference describes reporting pending IDs whose underlying stream entries were deleted or trimmed, while removing those IDs from the pending list. Those results are not successfully recovered messages with empty content.

Preserve the missing-ID category and inspect the deployed version’s reply shape. Reconcile it against stream retention policy and the XPENDING inventory. A smaller pending count can reflect removed recovery references rather than completed application work.

Exercise sparse eligibility

Build an isolated fixture containing recent pending entries, older eligible entries and a deliberately removed stream entry. Traverse using each returned cursor, recording claimed IDs and missing IDs separately. Check that an empty intermediate batch does not prevent later eligible work from being visited.

Outstanding-work ownership provides the admission context. Duplicate-safe operation records explains why taking over delivery ownership does not prove a new business effect is safe.

Define what the recovery report proves

A useful report states the scan boundary, eligibility rule, claimed work, missing payloads and final application outcomes. Do not call cursor completion business completion. Do not erase missing payloads from the incident simply because their pending references were cleaned up. The accepted recovery loop preserves these distinctions while allowing later passes to revisit entries that become eligible after the earlier scan.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles