You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Redis v7.0, clusterbus extension and hostname support was added which (among other things) adds hostname information into CLUSTER NODES and CLUSTER SLOTS response.
Assuming we connect to a Redis Cluster on v7.0 with cluster-preferred-endpoint-type set to hostname.
The Redis::Cluster object will have node_flags made up of ip -> role whereas available_slots made up of hostname -> slots.
The @map in Slot object will be configured with the wrong master nodes since every key lookup in @node_flags will return nil.
With wrongly configured master nodes for a substantial % of the slots, subsequent Redis commands will receive MOVED redirections. This affects performance and possible raise false positives for error metrics on the client side.
I understand that the project is not testing against Redis v7.0 in the CI (looking at the actions), but would you be open to a PR to upstream our patch? We would be more than happy to prepare a PR.
The text was updated successfully, but these errors were encountered:
For the current main branch yes, but I'm not interested in a backport for 4.x.
That sounds fair 👍 . For the main branch, I've opened a PR in redis-rb/redis-cluster-client@f173f91. It's merged and looks like it will be released in 0.4.3.
In Redis v7.0, clusterbus extension and hostname support was added which (among other things) adds
hostname
information intoCLUSTER NODES
andCLUSTER SLOTS
response.Key changes:
CLUSTER SLOTS
returns the preferred endpoint under its networking information. This means https://github.com/redis/redis-rb/blob/v4.8.0/lib/redis/cluster/slot_loader.rb will construct a hash with preferred endpoints for keys.CLUSTER NODES
appends the hostname to the node address portion. This means https://github.com/redis/redis-rb/blob/v4.8.0/lib/redis/cluster/node_loader.rb constructs a hash IP addresses for keys regardless of the preferred endpoint.Effects on redis-rb 4.x
Assuming we connect to a Redis Cluster on v7.0 with
cluster-preferred-endpoint-type
set tohostname
.The
Redis::Cluster
object will have node_flags made up ofip -> role
whereas available_slots made up ofhostname -> slots
.The
@map
in Slot object will be configured with the wrong master nodes since every key lookup in@node_flags
will returnnil
.With wrongly configured master nodes for a substantial % of the slots, subsequent Redis commands will receive
MOVED
redirections. This affects performance and possible raise false positives for error metrics on the client side.At GitLab, we are using
redis-rb v4.8.0
and encountered a steady rate of MOVED redirections as a result. We have monkey-patched it via https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112691 in the meantime.I understand that the project is not testing against Redis v7.0 in the CI (looking at the actions), but would you be open to a PR to upstream our patch? We would be more than happy to prepare a PR.
The text was updated successfully, but these errors were encountered: