2.9.24
IMPORTANT: this release changes the distribution of pub/sub channels when using cluster:
(this change is specific to pub/sub with regular SUBSCRIBE channels, not "sharded" SSUBSCRIBE channels)
- pre 2.9.24: all channels would always be routed similarly to key-like routing (and similar to
SSUBSCRIBE) - from 2.9.24: non-
SSUBSCRIBEchannels are now randomly distributed to nodes by default, but can optionally use key-like routing by calling.WithKeyRouting()on theRedisChannelvalue
This change represents a safer, "least surprises" default; most people expect their cluster to help distribute load, including pub/sub load, between nodes. This is especially useful when there are few (or even only a single) channel(s) that dominate the pub/sub load, which is surprisingly common. Without this change, all that load would be handled only by a single server, because the channel my_notifications would be treated similarly to a key, via hash-slot sharding, and all clients would connect to the node serving that slot - when in reality, any node can be used for subscription, with the server distributing events horizontally to all nodes.