Skip to content

Fix/issue 3311#3313

Open
aartisonigra wants to merge 2 commits into
redis:masterfrom
aartisonigra:fix/issue-3311
Open

Fix/issue 3311#3313
aartisonigra wants to merge 2 commits into
redis:masterfrom
aartisonigra:fix/issue-3311

Conversation

@aartisonigra

@aartisonigra aartisonigra commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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-sunsubscribe in addition to sharded-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 to sharded-channel-moved-error.

Separately, FT.SEARCH PARAMS encoding 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit f9228b9. Configure here.

(channel, listeners) => {
this.emit('sharded-channel-moved', channel, listeners);
this.emit('server-sunsubscribe', channel, listeners);
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f9228b9. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant