You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NEW] XNACK - Release an entry back to the Pending Entries List (PEL)Β #4561
When a consumer knows it will not be able to process an entry in a stream (due to failure, timeout or graceful consumer shutdown), there is no way to put the entry back into the Pending Entries List (PEL). As far as I can tell, the only current idiomatic solution is to use min-idle-time in XCLAIM/XAUTOCLAIM to only re-claim entries that have been idle for more than min-idle-time. This causes a needless delay for entry re-processing. It's needless because the consumer that owns the entry already knows it will not process it, and time can be saved by letting that consumer courteously put it back into the PEL.
Description of the feature
The XNACK command releases an entry back to the Pending Entries List (PEL) from a consumer, allowing another consumer to immediately pick it up for re-processing.
Alternatives you've considered
One could completely delete the entry and add an identical one in a transaction. That's technically possible, but it adds an overhead, and makes streams slower in situations where you have a lot of entries failing. Another issue is that it's unclear how one would preserve the entry retry-counter.
Probably the best alternative: using XCLAIM to set the idle value to something large, allowing other consumers to claim it. This would however make the entry look idle, it may or may not be an issue depending on how the consumer is designed.
I was checking this out yesterday actually and have the core flow setup with modes [SILENT | FAIL | FATAL] and tests. I have to still add support the trailing options [RETRYCOUNT count] [FORCE] and add tests for edge cases.
One big question I still have to look into is what happens around replication. For XACKDEL & XDELEX it was possible to achieve the same effect on pre-9.2 replicas by only replicating XACK and XDEL instead of the new commands. But, I haven't had a chance yet to look into how that might be possible here.
Replicate XNACK as XNACK. I suppose there is no other way.
The contract is that if the user wants to add old version replicas (to do a rolling downgrade after a rolling upgrade), they can't use any of the new commands that some replicas can't handle. It's not supported; if they do that, we don't guarantee that it will work.
Activity
zuiderkwast commentedon Sep 14, 2026
We talked about it in the core team meeting (@valkey-io/core-team) and we're positive.
If it's implemented and reviewed within the next few weeks, we can probably include it in Valkey 9.2.
hpatro commentedon Sep 15, 2026
Hello @nickiaq,
Would you be interested in implementing this?
nickiaq commentedon Sep 15, 2026
Absolutely, I'm interested.
I was checking this out yesterday actually and have the core flow setup with modes
[SILENT | FAIL | FATAL]and tests. I have to still add support the trailing options[RETRYCOUNT count] [FORCE]and add tests for edge cases.One big question I still have to look into is what happens around replication. For
XACKDEL&XDELEXit was possible to achieve the same effect on pre-9.2 replicas by only replicatingXACKandXDELinstead of the new commands. But, I haven't had a chance yet to look into how that might be possible here.I'll put up a PR later this week.
zuiderkwast commentedon Sep 15, 2026
Replicate XNACK as XNACK. I suppose there is no other way.
The contract is that if the user wants to add old version replicas (to do a rolling downgrade after a rolling upgrade), they can't use any of the new commands that some replicas can't handle. It's not supported; if they do that, we don't guarantee that it will work.