-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Implement XACKDEL and XDELEX command #4629
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
Merged
zuiderkwast
merged 25 commits into
valkey-io:unstable
from
nickiaq:commands-xdelex-xackdel
Sep 10, 2026
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
827a5ee
Implement XACKDEL & Address Code Reviews
f93c54c
Implement XDELEX & Address Code Reviews
9557388
Shared helpers for XDEL/XDELEX/XACKDEL
45effc1
Address CodeRabbit comments
71e9dbd
Address CodeRabbit Comments on XDELEX ACKED mode gap
295a4e1
Propagate XACKDEL/XDELEX manually with pre-9.2 commands
5d2bd88
Create common parser for `XDEL`-like commands
9ea19ed
Align XDEL-like parse helper to others
9fdb69a
Revert unrelated testing change
98c4c30
Remove clunky XDELEX/XACKDEL helpers
71669bb
Clang Format
b814bcf
Add streamDeletePELEntry helper across XACKDEL, XDELEX, XACK
37e6690
Mirror fix for XDELEX ACKED mode gap in XACKDEL as well
c029281
Use size_t for id count to clarify constraints
96128f8
Unify XDEL, XDELEX and XACKDEL into a single xdelGenericCommand
zuiderkwast 3e67a03
Inline single-caller helper streamParseStrictIDsOrReply
zuiderkwast 03ff02d
Clang format
zuiderkwast 3882fdc
Only allocate working arrays each xdelGenericCommand variant needs
zuiderkwast 11ed5b7
Clarify Complexity in XDELEX JSON Defn
nickiaq 0766138
Clarify Complexity in XACKDEL JSON Defn
nickiaq 75b1be9
Revert formatting change to unrelated line
7a0addb
Revert formatting change to unrelated line
51d6e79
Regenerate commands.def after accepting JSON changes in GitHub
704fca7
Add Cross Version (pre-9.2.0) Replication Tests
346b74f
Merge branch 'unstable' into commands-xdelex-xackdel
nickiaq 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,97 @@ | ||
| { | ||
| "XACKDEL": { | ||
| "summary": "Acknowledge and (if possible) delete stream message(s).", | ||
| "complexity": "O(1) for each single item to delete in the stream, regardless of the stream size", | ||
| "group": "stream", | ||
| "since": "9.2.0", | ||
| "arity": -6, | ||
| "function": "xackdelCommand", | ||
| "command_flags": [ | ||
| "WRITE", | ||
| "FAST" | ||
| ], | ||
| "acl_categories": [ | ||
| "FAST", | ||
| "WRITE", | ||
| "STREAM" | ||
| ], | ||
| "key_specs": [ | ||
| { | ||
| "flags": [ | ||
| "RW", | ||
| "UPDATE" | ||
| ], | ||
| "begin_search": { | ||
| "index": { | ||
| "pos": 1 | ||
| } | ||
| }, | ||
| "find_keys": { | ||
| "range": { | ||
| "lastkey": 0, | ||
| "step": 1, | ||
| "limit": 0 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "arguments": [ | ||
| { | ||
| "name": "key", | ||
| "type": "key", | ||
| "key_spec_index": 0 | ||
| }, | ||
| { | ||
| "name": "group", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "mode", | ||
| "type": "oneof", | ||
| "optional": true, | ||
| "arguments": [ | ||
| { | ||
| "name": "keepref", | ||
| "type": "pure-token", | ||
| "token": "KEEPREF" | ||
| }, | ||
| { | ||
| "name": "delref", | ||
| "type": "pure-token", | ||
| "token": "DELREF" | ||
| }, | ||
| { | ||
| "name": "acked", | ||
| "type": "pure-token", | ||
| "token": "ACKED" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "ids", | ||
| "type": "pure-token", | ||
| "token": "IDS" | ||
| }, | ||
| { | ||
| "name": "numids", | ||
| "type": "integer" | ||
| }, | ||
| { | ||
| "name": "id", | ||
| "type": "string", | ||
| "multiple": true | ||
| } | ||
| ], | ||
| "reply_schema": { | ||
| "description": "The command returns an integer for each stream message: -1=message not found, 1=acked and deleted, 2=acked but not deleted.", | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "items": { | ||
| "description": "Status of the stream message, -1=message not found, 1=acked and deleted, 2=acked but not deleted.", | ||
| "type": "integer", | ||
| "minimum": -1, | ||
| "maximum": 2 | ||
| } | ||
| } | ||
| } | ||
| } |
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,93 @@ | ||
| { | ||
| "XDELEX": { | ||
| "summary": "Delete stream message(s) with extended options", | ||
| "complexity": "O(1) for each single item to delete in the stream, regardless of the stream size", | ||
| "group": "stream", | ||
| "since": "9.2.0", | ||
| "arity": -5, | ||
| "function": "xdelexCommand", | ||
| "command_flags": [ | ||
| "WRITE", | ||
| "FAST" | ||
| ], | ||
| "acl_categories": [ | ||
| "FAST", | ||
| "WRITE", | ||
| "STREAM" | ||
| ], | ||
| "key_specs": [ | ||
| { | ||
| "flags": [ | ||
| "RW", | ||
| "UPDATE" | ||
| ], | ||
| "begin_search": { | ||
| "index": { | ||
| "pos": 1 | ||
| } | ||
| }, | ||
| "find_keys": { | ||
| "range": { | ||
| "lastkey": 0, | ||
| "step": 1, | ||
| "limit": 0 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "arguments": [ | ||
| { | ||
| "name": "key", | ||
| "type": "key", | ||
| "key_spec_index": 0 | ||
| }, | ||
| { | ||
| "name": "mode", | ||
| "type": "oneof", | ||
| "optional": true, | ||
| "arguments": [ | ||
| { | ||
| "name": "keepref", | ||
| "type": "pure-token", | ||
| "token": "KEEPREF" | ||
| }, | ||
| { | ||
| "name": "delref", | ||
| "type": "pure-token", | ||
| "token": "DELREF" | ||
| }, | ||
| { | ||
| "name": "acked", | ||
| "type": "pure-token", | ||
| "token": "ACKED" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "ids", | ||
| "token": "IDS", | ||
| "type": "pure-token" | ||
| }, | ||
| { | ||
| "name": "numids", | ||
| "type": "integer" | ||
| }, | ||
| { | ||
| "name": "id", | ||
| "type": "string", | ||
| "multiple": true | ||
| } | ||
| ], | ||
| "reply_schema": { | ||
| "description": "The command returns an integer for each stream message: -1=message not found, 1=message was deleted, 2=message was not deleted due to existing references (ACKED mode).", | ||
| "type": "array", | ||
| "minItems": 0, | ||
| "items": { | ||
| "description": "Status of the stream message, -1=message not found, 1=message was deleted, 2=message was not deleted due to existing references (ACKED mode).", | ||
| "type": "integer", | ||
| "minimum": -1, | ||
| "maximum": 2 | ||
| } | ||
| } | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.