-
Notifications
You must be signed in to change notification settings - Fork 298
DEV: (cmds+) updates for streams idempotent production #2637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dwdougherty
wants to merge
3
commits into
feat-ros-8.6
Choose a base branch
from
DOC-6151
base: feat-ros-8.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| --- | ||
| acl_categories: | ||
| - STREAM | ||
| arguments: | ||
| - key_spec_index: 0 | ||
| name: key | ||
| type: key | ||
| - arguments: | ||
| - name: duration-token | ||
| token: IDMP-DURATION | ||
| type: pure-token | ||
| - name: duration | ||
| type: integer | ||
| name: duration-block | ||
| optional: true | ||
| type: block | ||
| - arguments: | ||
| - name: maxsize-token | ||
| token: IDMP-MAXSIZE | ||
| type: pure-token | ||
| - name: maxsize | ||
| type: integer | ||
| name: maxsize-block | ||
| optional: true | ||
| type: block | ||
| arity: -2 | ||
| categories: | ||
| - docs | ||
| - develop | ||
| - stack | ||
| - oss | ||
| - rs | ||
| - rc | ||
| - oss | ||
| - kubernetes | ||
| - clients | ||
| command_flags: | ||
| - WRITE | ||
| - FAST | ||
| complexity: O(1) | ||
| description: Sets the IDMP configuration parameters for a stream. | ||
| function: xcfgsetCommand | ||
| group: stream | ||
| hidden: false | ||
| key_specs: | ||
| - begin_search: | ||
| index: | ||
| pos: 1 | ||
| find_keys: | ||
| range: | ||
| lastkey: 0 | ||
| limit: 0 | ||
| step: 1 | ||
| flags: | ||
| - RW | ||
| - UPDATE | ||
| linkTitle: XCFGSET | ||
| reply_schema: | ||
| const: OK | ||
| since: 8.6.0 | ||
| summary: Sets the IDMP configuration parameters for a stream. | ||
| syntax_fmt: XCFGSET key [IDMP-DURATION duration] [IDMP-MAXSIZE maxsize] | ||
| title: XCFGSET | ||
| --- | ||
| Sets the IDMP (Idempotent Message Processing) configuration parameters for a stream. This command configures how long idempotent IDs are retained and the maximum number of idempotent IDs tracked per producer. | ||
|
|
||
| ## Required arguments | ||
|
|
||
| <details open><summary><code>key</code></summary> | ||
|
|
||
| The name of the stream key. The stream must already exist. | ||
|
|
||
| </details> | ||
|
|
||
| ## Optional arguments | ||
|
|
||
| <details open><summary><code>IDMP-DURATION duration</code></summary> | ||
|
|
||
| Sets the duration in seconds that each idempotent ID (iid) is kept in the stream's IDMP map. Valid range: 1-86,400 seconds. Default: 100 seconds. | ||
|
|
||
| When an idempotent ID expires, it can be reused for new messages. This provides an operational guarantee that Redis will not forget an idempotency ID before the duration elapses (unless capacity is reached). | ||
|
|
||
| </details> | ||
|
|
||
| <details open><summary><code>IDMP-MAXSIZE maxsize</code></summary> | ||
|
|
||
| Sets the maximum number of most recent idempotent IDs kept for each producer in the stream's IDMP map. Valid range: 1-10,000 entries. Default: 100 entries. | ||
|
|
||
| When the capacity is reached, the oldest idempotent IDs for that producer are evicted regardless of remaining duration. This prevents unbounded memory growth. | ||
|
|
||
| </details> | ||
|
|
||
| ## Behavior | ||
|
|
||
| - Calling `XCFGSET` clears all existing producer IDMP maps for the stream. | ||
| - At least one of `IDMP-DURATION` or `IDMP-MAXSIZE` must be specified. | ||
| - The stream must exist before calling this command. | ||
| - Configuration changes apply immediately to all future IDMP operations. | ||
|
|
||
| ## Examples | ||
|
|
||
| ```redis-cli | ||
| XADD mystream * field value | ||
| XCFGSET mystream IDMP-DURATION 300 | ||
| XCFGSET mystream IDMP-MAXSIZE 1000 | ||
| XCFGSET mystream IDMP-DURATION 600 IDMP-MAXSIZE 500 | ||
| ``` | ||
|
|
||
| ## Return information | ||
|
|
||
| {{< multitabs id="return-info" | ||
| tab1="RESP2" | ||
| tab2="RESP3" >}} | ||
|
|
||
| [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` if the configuration was set successfully. | ||
|
|
||
| -tab-sep- | ||
|
|
||
| [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` if the configuration was set successfully. | ||
|
|
||
| {{< /multitabs >}} | ||
|
|
||
| ## Error conditions | ||
|
|
||
| The command returns an error in the following cases: | ||
|
|
||
| - **WRONGTYPE**: The key exists but is not a stream | ||
| - **ERR no such key**: The stream does not exist | ||
| - **ERR syntax error**: Invalid command syntax or missing required arguments | ||
| - **ERR invalid duration**: Duration value is outside the valid range (1-86,400) | ||
| - **ERR invalid maxsize**: Maxsize value is outside the valid range (1-10,000) | ||
dwdougherty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.