redis-clustering 5.0.3 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -2
  3. data/lib/redis/cluster.rb +1 -0
  4. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5189fa0415c861a31dcc7bf8ace7df80f49284b31247317767f32e950ab8fb2a
4
- data.tar.gz: 89d6d0e1efa004540eea25f91565f4db69d977744c647ea8d2949507711a43ff
3
+ metadata.gz: 286c2aa6f3de244c2386b01dd0c6ed9709d3c7efa3fbabd11f7bc586e4417328
4
+ data.tar.gz: bd4e7f425107ecf9b0e0987982bfbb9c8e4fb369fc084416b780c72fc27d7678
5
5
  SHA512:
6
- metadata.gz: 772a60bc97ada7a817be3a030079bbab86615fe0abdbfaa9a050b7e8f2811bcb77f38f1b4eb83c3a9851d0cd447be3a328b5b6d50c134aba6ae4d872b5ce12a3
7
- data.tar.gz: 6a47814cd96e7b88ce17632e974e5c235bd66b2d1e37c0069dd9296b4bc072b1e5371034ac820a0288fa300db67f6eff9bd1554096b9e0d93f9705fc578a9fb8
6
+ metadata.gz: c7465fdc1a1a583aa53d25be7af06418a2eef0f3d1194728322553324a3768ba1b13b0c27188ee3e9dd6c989f0ec0649b73df96dcbcdd7d05380462ca800c2da
7
+ data.tar.gz: c3561fb101b3d31ba799f05b17adc9425cb97d031a8447ccd33b3e0a5ff67678cc5c0779fa37742d797886b3e17b71a050c439f0486849e62b510771a1e3c58a
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.
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.4
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-09 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.4
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.4
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.2
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.2
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.4
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.4/cluster
74
74
  post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths: