Repository navigation
ZRANGESTORE, GEOSEARCHSTORE and EVAL source keys bypass the key pre-processor - #4675
Merged
Merged
Conversation
Collaborator
key() is where the CommandKeyArgumentPreProcessor is applied and where a key is recorded for hash slot computation. These builders sent the key through add()/addObjects() instead, so it reached the wire untransformed and never entered CommandArguments.getKeys().
insaf021
force-pushed
the
command-objects-key-preprocessor
branch
from
August 8, 2026 07:31
ad410bc to
550dc4b
Compare
Contributor
Author
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 550dc4bd20
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…archStore, eval, evalsha) Cross-slot zrangestore and geosearchStore are now rejected client-side, since the source key is registered for slot computation; every overload is covered. The eval/evalsha varargs tests pin slot registration against the key()/add() loop rewrite. Replaces PrefixedKeyArgumentsTest: the store commands regress prefixing and slot registration together through the same key() call, so the behavioral cluster tests cover both.
ggivo
added a commit
that referenced
this pull request
Aug 12, 2026
Running docs/release-notes/<version>.md file, appended in the same PR as any user-visible behavior change, so notes are written at merge time instead of reconstructed at release time. Seeded with the #4675 key pre-processor entry.
ggivo
added a commit
that referenced
this pull request
Aug 12, 2026
Running docs/release-notes/<version>.md file, appended in the same PR as any user-visible behavior change, so notes are written at merge time instead of reconstructed at release time. Seeded with the #4675 key pre-processor entry.
ggivo
added a commit
that referenced
this pull request
Aug 25, 2026
* Start release notes for 8.1.0 Running docs/release-notes/<version>.md file, appended in the same PR as any user-visible behavior change, so notes are written at merge time instead of reconstructed at release time. Seeded with the #4675 key pre-processor entry. * docs: state the compared versions in the 8.1.0 release notes header Reviewers couldn't tell which versions the notes cover. Add a Full Changelog compare link (v8.0.0...master until the tag exists) and fold the link flip into the release-time step. * docs: replace changelog compare link with an upgrade-from sentence The compare link needed a manual update at release time; a plain sentence states the covered upgrade without maintenance.
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.
With a
PrefixedKeyArgumentPreProcessor("tenantA:")installed:CommandArguments.key(Object)is the only place the pre-processor runs and the only place a key is recorded for slot computation, so a key routed throughadd()reaches the wire untransformed and never entersgetKeys().ZRANGESTOREthen writes inside the namespace and reads from outside it, and the cluster provider sees one slot for a two key command so its multi slot guard cannot fire.Eighteen sites, all the same shape: the source key of
zrangestoreandgeosearchStore/geosearchStoreStoreDist, and the firstkeyCountvarargs ofeval/evalsha. The eval varargs overloads already calledaddHashSlotKeys, which records the slot but leaves the outgoing argument alone; theList<String> keysoverloads beside them were always correct and are untouched.Without a pre-processor, the
eval/evalshavarargs overloads behave exactly as before — their slot keys were already registered viaaddHashSlotKeys, so this PR only changes which argument value goes out when a pre-processor rewrites keys.For
ZRANGESTOREandGEOSEARCHSTOREthere is one behaviour change even without a pre-processor: the source key now entersgetKeys(), so on cluster a cross-slot call fails client-side withJedisClusterOperationExceptioninstead of being dispatched to the destination's node and rejected by the server with a CROSSSLOT error. Standalone behaviour is unchanged.Tests: cluster tests assert the cross-slot rejection for every
zrangestore/geosearchStoreoverload and pineval/evalshavarargs slot registration.Closes #4674
Note
Medium Risk
Fixes cluster slot tracking and key preprocessing for multi-key commands; behavior is unchanged without a key preprocessor, but cluster routing and prefixed keys now correctly include source keys.
Overview
Fixes source keys bypassing
key()registration inzrangestore,geosearchStore/geosearchStoreStoreDist, andeval/evalshavarargs overloads.Those keys were previously passed with
add(), so they skipped key preprocessors and were omitted from cluster slot computation. They now go throughkey(), matching commands likezunionstore. Theeval/evalshavarargs paths also stop usingaddHashSlotKeysalone (which recorded slots but left wire args untransformed).Cluster tests assert cross-slot rejection for the fixed commands. Without a key preprocessor, wire behavior is unchanged.
Reviewed by Cursor Bugbot for commit 2a37c60. Bugbot is set up for automated code reviews on this repo. Configure here.