fix: allow EVALSHA in ClusterPipeline (#2914) - #4206
Open
ahmed5145 wants to merge 4 commits into
Open
Conversation
Remove EVALSHA from PIPELINE_BLOCKED_COMMANDS so scripts can be pipelined in cluster mode when keys map to one slot. Slot routing already existed in determine_slot(); update docs and add regression coverage.
Sanjays2402
reviewed
Jul 23, 2026
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bbd5d830f
ℹ️ 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".
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
Fixes #2914
EVALSHAwas listed inPIPELINE_BLOCKED_COMMANDS, soClusterPipeline.evalsha()always raised even thoughRedisCluster.determine_slot()already routesEVAL/EVALSHAby keys (including the 0-key random-slot case).This removes
EVALSHAfrom the blocked list so cluster pipelines can queueEVALSHAlike other keyed commands. Callers must still:SCRIPT LOAD, which loads on all primaries)Also updates
docs/lua_scripting.rstand adds regression coverage:EVALSHAis no longer blocked and can be queued onClusterPipelinetest_evalsha_in_pipeline) for CI with a live clusterPull Request check-list
Note
Medium Risk
Changes cluster pipeline command routing and transactional slot logic for EVAL/EVALSHA; risk is moderate but bounded by extensive tests and narrow scope (EVALSHA only, not full scripting on pipelines).
Overview
Enables
EVALSHAon cluster pipelines by removing it fromPIPELINE_BLOCKED_COMMANDS, so queued scripts route like other keyed commands instead of raising immediately.Pipeline routing treats
EVAL/EVALSHAwithout callingCOMMAND GETKEYSwhennumkeysis 0 (avoids Redis <7 breakage). Transactional pipelines get_resolve_transaction_slot: zero-key scripts reuse an existing transaction slot or pick one at random; keyed commands can retarget away from a slot chosen only by prior zero-key scripts.Docs in
lua_scripting.rstdescribe cluster pipelineEVALSHAbehavior and limits (EVAL,load_scripts, etc. still unsupported on cluster pipelines). Sync/async unit and integration tests cover blocking removal, zero-key execute, and transaction slot reuse.Reviewed by Cursor Bugbot for commit 649a36b. Bugbot is set up for automated code reviews on this repo. Configure here.