redis-cluster-client 0.13.7 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/redis_client/cluster/router.rb +11 -22
- data/lib/redis_client/cluster_config.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 886bead03f4fc886b7332cedec114bcb37e46c466383e01132166db5314dd27b
|
|
4
|
+
data.tar.gz: 3214c8bb3a017549ef28c4f1b2880850f4fecb8a9a0c9b227b4a33c9fd8855c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 668049b851c868f2fa92d7dddb6b07c3f94c9a24a6eeacdefc902a2584b29b25fe65a32c5b7147747212b25530ed1c91c4641f2dd824a85948dfdcd55a101306
|
|
7
|
+
data.tar.gz: 992f198b630f3a558c7423c8add8b868ef5bbe8775e7bbcfa8089ac25e08b6a475a2bdf0cb7e49a0eb791b80fad05818f5c9dcbb4ab3f3f7b2317cbbc24904f1
|
|
@@ -58,6 +58,7 @@ class RedisClient
|
|
|
58
58
|
'bgsave' => all_node_first_action,
|
|
59
59
|
'quit' => all_node_first_action,
|
|
60
60
|
'save' => all_node_first_action,
|
|
61
|
+
'select' => all_node_first_action,
|
|
61
62
|
'flushall' => primary_first_action,
|
|
62
63
|
'flushdb' => primary_first_action,
|
|
63
64
|
'readonly' => not_supported_action,
|
|
@@ -381,35 +382,23 @@ class RedisClient
|
|
|
381
382
|
end
|
|
382
383
|
|
|
383
384
|
def send_cluster_command(method, command, args, &block) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
384
|
-
if command[1].casecmp('
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
elsif command[1].casecmp('meet').zero?
|
|
393
|
-
fail_not_supported_command(method, command, args, &block)
|
|
394
|
-
elsif command[1].casecmp('replicate').zero?
|
|
395
|
-
fail_not_supported_command(method, command, args, &block)
|
|
396
|
-
elsif command[1].casecmp('reset').zero?
|
|
397
|
-
fail_not_supported_command(method, command, args, &block)
|
|
398
|
-
elsif command[1].casecmp('set-config-epoch').zero?
|
|
399
|
-
fail_not_supported_command(method, command, args, &block)
|
|
400
|
-
elsif command[1].casecmp('setslot').zero?
|
|
401
|
-
fail_not_supported_command(method, command, args, &block)
|
|
385
|
+
if command[1].casecmp('keyslot').zero? ||
|
|
386
|
+
command[1].casecmp('info').zero? ||
|
|
387
|
+
command[1].casecmp('nodes').zero? ||
|
|
388
|
+
command[1].casecmp('slots').zero? ||
|
|
389
|
+
command[1].casecmp('shards').zero? ||
|
|
390
|
+
command[1].casecmp('count-failure-reports').zero? ||
|
|
391
|
+
command[1].casecmp('slaves').zero?
|
|
392
|
+
assign_node(command).public_send(method, *args, command, &block)
|
|
402
393
|
elsif command[1].casecmp('saveconfig').zero?
|
|
403
394
|
@node.call_all(method, command, args).first.then(&TSF.call(block))
|
|
404
|
-
elsif command[1].casecmp('getkeysinslot').zero?
|
|
405
|
-
raise ArgumentError, command.join(' ') if command.size != 4
|
|
406
|
-
|
|
395
|
+
elsif command[1].casecmp('countkeysinslot').zero? || command[1].casecmp('getkeysinslot').zero?
|
|
407
396
|
handle_node_reload_error do
|
|
408
397
|
node_key = @node.find_node_key_of_replica(command[2])
|
|
409
398
|
@node.find_by(node_key).public_send(method, *args, command, &block)
|
|
410
399
|
end
|
|
411
400
|
else
|
|
412
|
-
|
|
401
|
+
fail_not_supported_command(method, command, args, &block)
|
|
413
402
|
end
|
|
414
403
|
end
|
|
415
404
|
|
|
@@ -18,7 +18,7 @@ class RedisClient
|
|
|
18
18
|
DEFAULT_NODES = [DEFAULT_NODE].freeze
|
|
19
19
|
VALID_SCHEMES = [DEFAULT_SCHEME, SECURE_SCHEME].freeze
|
|
20
20
|
VALID_NODES_KEYS = %i[ssl username password host port db].freeze
|
|
21
|
-
MERGE_CONFIG_KEYS = %i[ssl username password].freeze
|
|
21
|
+
MERGE_CONFIG_KEYS = %i[ssl username password db].freeze
|
|
22
22
|
IGNORE_GENERIC_CONFIG_KEYS = %i[url host port path].freeze
|
|
23
23
|
MAX_WORKERS = Integer(ENV.fetch('REDIS_CLIENT_MAX_THREADS', -1)) # for backward compatibility
|
|
24
24
|
# It's used with slow queries of fetching meta data like CLUSTER NODES, COMMAND and so on.
|