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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 325b2794ce4f0325c3f1b0fc8f2cec7b4246ba131b53b1e151e4ecd9dd188371
4
- data.tar.gz: fd2a8916adcc34abdc91ebdf3de383a1a2c1c6a609d05431bd2dd3d8f11bd25b
3
+ metadata.gz: 886bead03f4fc886b7332cedec114bcb37e46c466383e01132166db5314dd27b
4
+ data.tar.gz: 3214c8bb3a017549ef28c4f1b2880850f4fecb8a9a0c9b227b4a33c9fd8855c9
5
5
  SHA512:
6
- metadata.gz: e2eb46131d06412f992ae2902d716c26e3fb048dba3da8dc0bf1dc565943fd88db839944f326fb02ffa07671da63fe2b7b74b0479b5fb1926e5e0fb030ceea8c
7
- data.tar.gz: 9f13a0bff4708332aa9c36a2ea0f7c3cb0b49969804b641734b97229363cb5482ba554616f31d1eb8fe12a52129f59f8cb82d020e33db20a08a292a7464744b8
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('addslots').zero?
385
- fail_not_supported_command(method, command, args, &block)
386
- elsif command[1].casecmp('delslots').zero?
387
- fail_not_supported_command(method, command, args, &block)
388
- elsif command[1].casecmp('failover').zero?
389
- fail_not_supported_command(method, command, args, &block)
390
- elsif command[1].casecmp('forget').zero?
391
- fail_not_supported_command(method, command, args, &block)
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
- assign_node(command).public_send(method, *args, command, &block)
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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.7
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga