1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-17 11:52:32 +03:00
Files
node-redis/packages/client
Nikolay Karadzhov 96d6445d66 fix(ssubscribe): properly resubscribe in case of shard failover (#3098)
* fix(ssubscribe): properly resubscribe in case of shard failover

1) when RE failover happens, there is a disconnect
2) affected Client reconnects and tries to resubscribe all existing listeners
ISSUE #1: CROSSSLOT Error - client was doing ssubscribe ch1 ch2.. chN which, after the failover could result in CROSSSLOT ( naturally, becasuse now some slots could be owned by other shards )
FIX: send one ssubscribe command per channel instead of one ssubscribe for all channels
ISSUE #2: MOVED Error - some/all of the channels might be moved somewhere else
FIX: 1: Propagate the error to the Cluster. 2: Cluster rediscovers topology.
3: Cluster resubscribes all listeners of the failed client ( possibly some/all of those will end up in a different client after the rediscovery ) 

fixes: #2902
2025-10-13 11:59:08 +03:00
..
2022-12-26 13:35:37 -05:00
2025-06-04 10:52:14 +03:00
2025-10-01 13:46:33 +00:00
2022-05-02 11:48:12 -04:00

@redis/client

The source code and documentation for this package are in the main node-redis repo.