redis-clustering 5.0.3 → 5.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5189fa0415c861a31dcc7bf8ace7df80f49284b31247317767f32e950ab8fb2a
4
- data.tar.gz: 89d6d0e1efa004540eea25f91565f4db69d977744c647ea8d2949507711a43ff
3
+ metadata.gz: a8906712b9949503d2e1b4a7a399e874d7fbf9b4a83a24fdc07d51899b8ca96a
4
+ data.tar.gz: a43929498b90257387c6666e64f52db5211edfabf95fbaa6445240c8655a3f19
5
5
  SHA512:
6
- metadata.gz: 772a60bc97ada7a817be3a030079bbab86615fe0abdbfaa9a050b7e8f2811bcb77f38f1b4eb83c3a9851d0cd447be3a328b5b6d50c134aba6ae4d872b5ce12a3
7
- data.tar.gz: 6a47814cd96e7b88ce17632e974e5c235bd66b2d1e37c0069dd9296b4bc072b1e5371034ac820a0288fa300db67f6eff9bd1554096b9e0d93f9705fc578a9fb8
6
+ metadata.gz: fd5acf4b415e67c3cbe904ed44e814175d8c5b69f75d61b5fd8f66b0c6155e4b5bc9908fc3de0dbe16b50db4fd43de014bc34c83e3477b39be5118513eddb9fa
7
+ data.tar.gz: 884aec02c9bdbb2e9d7a833c942a5dd07da8cd442e4785831e02b71f90283880cb3323618f9b29092dd183e2b97e9e2ef478f7b8313545cb3fd569bab383f967
data/README.md CHANGED
@@ -39,6 +39,12 @@ If you want [the connection to be able to read from any replica](https://redis.i
39
39
  Redis::Cluster.new(nodes: nodes, replica: true)
40
40
  ```
41
41
 
42
+ Also, you can specify the `:replica_affinity` option if you want to prevent accessing cross availability zones.
43
+
44
+ ```ruby
45
+ Redis::Cluster.new(nodes: nodes, replica: true, replica_affinity: :latency)
46
+ ```
47
+
42
48
  The calling code is responsible for [avoiding cross slot commands](https://redis.io/topics/cluster-spec#keys-distribution-model).
43
49
 
44
50
  ```ruby
@@ -59,13 +65,13 @@ redis.mget('{key}1', '{key}2')
59
65
  Since Redis can return FQDN of nodes in reply to client since `7.*` with CLUSTER commands, we can use cluster feature with SSL/TLS connection like this:
60
66
 
61
67
  ```ruby
62
- Redis.new(cluster: %w[rediss://foo.example.com:6379])
68
+ Redis::Cluster.new(nodes: %w[rediss://foo.example.com:6379])
63
69
  ```
64
70
 
65
71
  On the other hand, in Redis versions prior to `6.*`, you can specify options like the following if cluster mode is enabled and client has to connect to nodes via single endpoint with SSL/TLS.
66
72
 
67
73
  ```ruby
68
- Redis.new(cluster: %w[rediss://foo-endpoint.example.com:6379], fixed_hostname: 'foo-endpoint.example.com')
74
+ Redis::Cluster.new(nodes: %w[rediss://foo-endpoint.example.com:6379], fixed_hostname: 'foo-endpoint.example.com')
69
75
  ```
70
76
 
71
77
  In case of the above architecture, if you don't pass the `fixed_hostname` option to the client and servers return IP addresses of nodes, the client may fail to verify certificates.
@@ -24,8 +24,6 @@ class Redis
24
24
 
25
25
  def initialize(*)
26
26
  handle_errors { super }
27
- @inherit_socket = false
28
- @pid = Process.pid
29
27
  end
30
28
  ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
31
29
 
data/lib/redis/cluster.rb CHANGED
@@ -53,6 +53,7 @@ class Redis
53
53
  # @option options [Boolean] :inherit_socket (false) Whether to use socket in forked process or not
54
54
  # @option options [Array<String, Hash{Symbol => String, Integer}>] :nodes List of cluster nodes to contact
55
55
  # @option options [Boolean] :replica Whether to use readonly replica nodes in Redis Cluster or not
56
+ # @option options [Symbol] :replica_affinity scale reading strategy, currently supported: `:random`, `:latency`
56
57
  # @option options [String] :fixed_hostname Specify a FQDN if cluster mode enabled and
57
58
  # client has to connect nodes via single endpoint with SSL/TLS
58
59
  # @option options [Class] :connector Class of custom connector
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-clustering
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2022-09-06 00:00:00.000000000 Z
19
+ date: 2022-09-22 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: redis
@@ -24,28 +24,28 @@ dependencies:
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 5.0.3
27
+ version: 5.0.5
28
28
  type: :runtime
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 5.0.3
34
+ version: 5.0.5
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: redis-cluster-client
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '0.2'
41
+ version: 0.3.7
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '0.2'
48
+ version: 0.3.7
49
49
  description: |2
50
50
  A Ruby client that tries to match Redis' Cluster API one-to-one, while still
51
51
  providing an idiomatic interface.
@@ -68,9 +68,9 @@ licenses:
68
68
  metadata:
69
69
  bug_tracker_uri: https://github.com/redis/redis-rb/issues
70
70
  changelog_uri: https://github.com/redis/redis-rb/blob/master/cluster/CHANGELOG.md
71
- documentation_uri: https://www.rubydoc.info/gems/redis/5.0.3
71
+ documentation_uri: https://www.rubydoc.info/gems/redis/5.0.5
72
72
  homepage_uri: https://github.com/redis/redis-rb/blob/master/cluster
73
- source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.3/cluster
73
+ source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.5/cluster
74
74
  post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths: