From 39b0562c16f4b6f18867993a2d35949144d9f4ed Mon Sep 17 00:00:00 2001 From: Julien Letessier Date: Wed, 22 Jan 2025 18:03:39 +0100 Subject: [PATCH] Fixes initial topology With a single-node cluster, this fixes a failure whereby the client attempts to issue a READONLY command to the sole master. This returns an unknown command error with Redis Enterprise Cloud. --- lib/redis_client/cluster/node/base_topology.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redis_client/cluster/node/base_topology.rb b/lib/redis_client/cluster/node/base_topology.rb index 82c5f2ca..bc692924 100644 --- a/lib/redis_client/cluster/node/base_topology.rb +++ b/lib/redis_client/cluster/node/base_topology.rb @@ -54,7 +54,7 @@ def disconnect_from_unwanted_nodes(options) def connect_to_new_nodes(options) (options.keys - @clients.keys).each do |node_key| option = options[node_key].merge(@client_options) - config = ::RedisClient::Cluster::Node::Config.new(scale_read: !@primary_node_keys.include?(node_key), **option) + config = ::RedisClient::Cluster::Node::Config.new(scale_read: @replica_node_keys.include?(node_key), **option) client = @pool.nil? ? config.new_client : config.new_pool(**@pool) @clients[node_key] = client end