Fix/issue 3311#3313
Open
aartisonigra wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit f9228b9. Configure here.
| (channel, listeners) => { | ||
| this.emit('sharded-channel-moved', channel, listeners); | ||
| this.emit('server-sunsubscribe', channel, listeners); | ||
| }, |
There was a problem hiding this comment.
Extra queue callback misbinds clientId
High Severity
#initiateQueue passes two channel-move callbacks into RedisCommandsQueue, but the constructor only accepts one. The leftover callback is bound as clientId, and the real clientId argument is ignored, so every client queue and its PubSub instance get a function instead of the identity string.
Reviewed by Cursor Bugbot for commit f9228b9. Configure here.
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.


Fixes #3311
This change resolves a sharded Pub/Sub resubscription issue during in-place slot migrations in Redis Cluster.
Changes
Align sharded Pub/Sub migration event handling.
Ensure resubscribe and rediscover logic is triggered when a sharded channel is moved.
Fix typo in the emitted error event name:
sharded-shannel-moved-error → sharded-channel-moved-error
Note
Medium Risk
Cluster sharded Pub/Sub migration touches live subscription behavior during topology changes; the RediSearch change alters wire format for PARAMS and could affect any caller relying on the previous (incorrect) length.
Overview
Fixes cluster sharded Pub/Sub when slots move in place: the command queue callback now emits
server-sunsubscribein addition tosharded-channel-moved, so cluster node clients run rediscover → reattach listeners on the new master. Cluster slot setup registers that handler explicitly and corrects the failure event name tosharded-channel-moved-error.Separately,
FT.SEARCHPARAMSencoding is fixed: the length field is the number of key/value pairs (not total arguments), so parameterized queries like@field:"$x"bind correctly on Redis Stack/FT.Reviewed by Cursor Bugbot for commit f9228b9. Bugbot is set up for automated code reviews on this repo. Configure here.