﻿# Delete a Redis consumer only after reconciling its pending work

XGROUP DELCONSUMER can make its pending messages unclaimable. Reconcile delivery ownership before removing an apparently inactive consumer from the group.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/redis-delconsumer-pending-recovery-loss/
Language: en

## An inactive name still owns recovery obligations

A worker deployment changes consumer names. An administrator removes old names to tidy the group, assuming inactivity means those consumers have nothing left to protect. Pending messages attached to the removed consumer can then lose their normal claim-based recovery path.

The [DELCONSUMER reference](https://redis.io/docs/latest/commands/xgroup-delconsumer/) explicitly warns that its pending messages become unclaimable after deletion. It recommends claiming or acknowledging them beforehand. Consumer removal is consequently a change to recovery state, not merely cosmetic inventory cleanup.

## Inventory the departing owner

Use [XPENDING](https://redis.io/docs/latest/commands/xpending/) to distinguish the group's total pending work from entries owned by the specific consumer. Preserve IDs, owner, idle information and delivery history before changing membership.

Inactivity alone does not show that the external business effects finished. A lost network connection, paused worker or abandoned process can leave ambiguous outcomes. The inventory should therefore connect delivery identity to application records rather than infer completion from an old consumer name.

## Choose a legitimate disposition

Acknowledgement is appropriate only when the service's required outcome has been established. Acknowledging uncertain work merely to make the cleanup safe for administration can erase the recovery obligation without producing that outcome.

Alternatively, transfer eligible pending ownership to a live recovery consumer. The [XAUTOCLAIM contract](https://redis.io/docs/latest/commands/xautoclaim/) describes idle eligibility and cursor traversal. Use its actual continuation result; an empty intermediate claim batch does not prove that the departing consumer's relevant work has all been reconciled.

## Control concurrent ownership changes

Coordinate the old worker's ability to continue receiving or executing work with the handoff. A recovery claim does not remotely cancel a previously started external operation. If both workers can still act, use the operation's duplicate-safe outcome contract.

Keep cleanup separate from stream retention. A payload that remains in the stream is not evidence that its old pending obligation can still be claimed after consumer deletion. Availability of content and availability of the recovery ownership path are different properties.

## Accept the handoff before deleting

For a bounded fixture, leave identifiable pending messages on a departing consumer. Reconcile each into a justified acknowledgement, a verified new owner or an explicitly unresolved exception. Only then exercise consumer removal in the isolated setup.

[Duplicate-safe outcome tracking](/journal/provider-post-retry-idempotency-ledger/) helps resolve ambiguous effects. [Ownership of outstanding work](/journal/frontier-swarm-external-tool-backpressure/) explains why retirement must include pending obligations rather than just stop accepting new requests.

## Preserve evidence beyond the cleanup response

The deletion response reports how much pending work the consumer had; it is not a certificate that those messages were processed. Keep the pre-change inventory and disposition evidence in the incident record. An accepted cleanup leaves no unexplained obligation dependent on the deleted owner. Where uncertainty remains, retain an explicit recovery decision instead of presenting a tidy consumer list as a completed workload.
