Merged
Conversation
sundb
reviewed
Oct 17, 2025
sundb
reviewed
Oct 18, 2025
sundb
reviewed
Oct 19, 2025
sundb
reviewed
Oct 19, 2025
sundb
reviewed
Oct 20, 2025
sundb
reviewed
Oct 20, 2025
sundb
reviewed
Oct 22, 2025
sundb
reviewed
Oct 22, 2025
sundb
reviewed
Oct 22, 2025
sundb
reviewed
Oct 22, 2025
Collaborator
|
fully CI only with runtest: https://github.com/redis/redis/actions/runs/18716621124 |
- Implement MSETEX command with flexible argument parsing - Support all expiration flags: EX, PX, EXAT, PXAT, KEEPTTL - Support condition flags: NX, XX - Add comprehensive test coverage - Include proper replication rewriting for relative times
sundb
reviewed
Oct 23, 2025
sundb
reviewed
Oct 23, 2025
sundb
reviewed
Oct 23, 2025
src/t_string.c
Outdated
| args->kv_count = (int)kv_count_long; | ||
| args->kv_start = j + 2; | ||
|
|
||
| j = j + 1 + ((long long)kv_count_long * 2); /* Skip "KEYS", numkeys, and all key-value pairs */ |
Collaborator
There was a problem hiding this comment.
it's unnecessary, now we know that kv_count_long is legal.
On the other hand, j is int, and this code will cause confusion.
and maybe we can add a test for this.
Suggested change
| j = j + 1 + ((long long)kv_count_long * 2); /* Skip "KEYS", numkeys, and all key-value pairs */ | |
| j = j + 1 + (kv_count_long * 2); /* Skip "KEYS", numkeys, and all key-value pairs */ |
sundb
approved these changes
Oct 23, 2025
Collaborator
|
@StavRLevi Please confirm that all the top comments have been updated. |
Comment on lines
+731
to
+734
| if ((args.flags & OBJ_SET_NX) && (args.flags & OBJ_SET_XX)) { | ||
| addReplyErrorObject(c, shared.syntaxerr); | ||
| return; | ||
| } |
Collaborator
There was a problem hiding this comment.
This check is not needed anymore because of parseExtendedStringArgumentsOrReply
This was referenced Oct 27, 2025
sundb
added a commit
that referenced
this pull request
Oct 27, 2025
In PR #14434, we made the keys parameter flexible, meaning it could appear anywhere among the command arguments. However, this also made key parsing more complex, since we could no longer determine the fixed position of key arguments. Therefore, in this PR, we reverted it back to using fixed positions for the keys. And also fix this [comment](#14434 (comment)). --------- Co-authored-by: Yuan Wang <yuan.wang@redis.com>
This was referenced Oct 29, 2025
This was referenced Dec 30, 2025
This was referenced Jan 13, 2026
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.
Introduce a new command MSETEX to set multiple string keys with a shared expiration in a single atomic operation. Also with flexible argument parsing.
Syntax:
MSETEX numkeys key value [key value …] [XX | NX] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]
Sets the given keys to their respective values.
This command is an extension of the MSETNX that adds expiration and XX options.
Options:
EX seconds - Set the specified expiration time, in seconds
PX milliseconds - Set the specified expiration time, in milliseconds
EXAT timestamp-seconds - Set the specified Unix time at which the keys will expire, in seconds
PXAT timestamp-milliseconds - Set the specified Unix time at which the keys will expire, in milliseconds
KEEPTTL - Retain the time to live associated with the keys
XX - Only set the keys and their expiration if all already exist
NX - Only set the keys and their expiration if none exist
Flexible Argument Parsing examples:
Return Values:
Integer reply: 1 - All keys were set successfully
Integer reply: 0 - No keys were set (due to NX/XX conditions)
Error reply - Syntax error or invalid arguments