Adds support for the new Idempotent Producers feature in Redis 8.6#3926
Merged
petyaslavova merged 9 commits intoredis:masterfrom Feb 4, 2026
Merged
Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for Redis 8.6's new Idempotent Producers feature, which ensures exactly-once message delivery semantics for Redis Streams by preventing duplicate entries.
Changes:
- Added
idmpautoandidmpparameters to theXADDcommand for automatic and explicit idempotent ID handling - Implemented new
XCFGSETcommand to configure idempotency parameters (duration and maxsize) for stream IDMP maps - Added comprehensive test coverage for the new idempotent features in both sync and async test suites
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| redis/commands/core.py | Added idempotent parameters to xadd method with validation, implemented xcfgset command, reordered command argument construction |
| tests/test_commands.py | Added comprehensive tests for XINFO STREAM idempotent fields, XADD with idmpauto/idmp, and XCFGSET configuration |
| tests/test_asyncio/test_commands.py | Added async versions of all idempotent producer tests, mirroring sync test coverage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com> Small cleanups after Copilot review Signed-off-by: Elena Kolevska <elena@kolevska.com> One more linter fix Signed-off-by: Elena Kolevska <elena@kolevska.com> Reformat Signed-off-by: Elena Kolevska <elena@kolevska.com>
4f3f28a to
759e72b
Compare
petyaslavova
reviewed
Feb 2, 2026
… image Signed-off-by: Elena Kolevska <elena@kolevska.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
Adds support for the new Idempotent Producers feature in Redis 8.6
Idempotent Producers ensures exactly-once message delivery semantics for Redis Streams. It prevents duplicate entries from being added to a stream by tracking idempotent IDs (iids) per producer ID (pid). When a duplicate is detected, Redis returns the existing entry ID instead of creating a new entry.
Changes
XADDCommand - New Idempotent Parameters ()XCFGSETCommand - Configures the idempotency parameters for a stream's IDMP mapSets how long Redis remembers each idempotent ID (iid) and the maximum
number of iids to track. This command clears the existing IDMP map
(Redis forgets all previously stored iids), but only if the configuration
value actually changes.
New fields were added in the response of
XINFO STREAMidmp-duration(int) - Configured duration for the stream's IDMP mapidmp-maxsize(int) - Configured maxsize for the stream's IDMP mappids-tracked(int) - Number of producer IDs currently trackediids-tracked(int) - Number of idempotent IDs currently tracked (active, not expired/evicted)iids-added(int) - Cumulative counter of all idempotent entries added during stream lifetimeiids-duplicates(int) - Cumulative counter of all duplicate iids detected during stream lifetimePull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.