feat: add ForEachMaster method to rueidiscompat Cmdable interface#982
Merged
rueian merged 2 commits intoredis:mainfrom Apr 15, 2026
Merged
feat: add ForEachMaster method to rueidiscompat Cmdable interface#982rueian merged 2 commits intoredis:mainfrom
rueian merged 2 commits intoredis:mainfrom
Conversation
Add ForEachMaster to the Cmdable interface and implement it on Compat. It concurrently calls a function on each master node in the cluster, delegating to the existing doPrimaries method. Includes comprehensive unit tests covering master/replica filtering, error handling, empty nodes, and Cmdable wrapping. Agent-Logs-Url: https://github.com/SoulPancake/rueidis/sessions/dc7821d0-d23a-4637-8634-0fc80e4aae45 Co-authored-by: SoulPancake <70265851+SoulPancake@users.noreply.github.com>
rueian
reviewed
Apr 14, 2026
Collaborator
rueian
left a comment
There was a problem hiding this comment.
There are build failures and please remove the rueidiscompat.test
rueian
approved these changes
Apr 15, 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.
Add ForEachMaster to the Cmdable interface and implement it on Compat. It concurrently calls a function on each master node in the cluster, delegating to the existing doPrimaries method.
Note
Medium Risk
Public interface expansion can be breaking for any external
Cmdableimplementations and introduces a new concurrent execution entrypoint whose error/role handling must remain correct across cluster nodes.Overview
Adds a new
Cmdable.ForEachMaster(ctx, fn)API to run a callback concurrently against each master node in a Redis cluster, returning the first error encountered.Implements
ForEachMasteronCompatby delegating to existingdoPrimariesand passing a per-nodeCmdablewrapper into the callback;Pipelinenow satisfies the expanded interface with a stub that panics. Adds comprehensive unit tests covering master filtering, error propagation, empty/no-master cases, and ensuring the callback receives a working wrapped client.Reviewed by Cursor Bugbot for commit 46f1c8f. Bugbot is set up for automated code reviews on this repo. Configure here.