Description
GLIDE added a new read strategy, AZAffinityAllNodes, in valkey-io/valkey-glide#6721, which closed valkey-io/valkey-glide#6653. Only the Python binding was wired up, so every other client needs the same surface. This issue tracks the Ruby side.
The strategy spreads read requests equally, in round robin, across all nodes in the client's Availability Zone, primary and replicas alike. When no node in the client's AZ is available it falls back to a round robin across all nodes. It differs from AZ_AFFINITY_REPLICAS_AND_PRIMARY in that it does not prioritise replicas ahead of the primary, which is what makes an even per-node read distribution possible on ElastiCache deployments that hit the 5 replica cap. The motivation is written up in valkey-io/valkey-glide#6653.
Prerequisite
The vendored native library has to be built from a GLIDE revision that includes AZAffinityAllNodes = 6 in glide-core/src/protobuf/connection_request.proto, which landed with valkey-io/valkey-glide#6721. Valkey::ReadFrom values are forwarded to the core as raw strings, so until the vendored core knows the value the constant cannot work.
Checklist
Additional Notes
The Python diff in valkey-io/valkey-glide#6721 is a close reference for the binding surface, including the exact wording of the validation errors.
lib/valkey/read_from.rb carries a helpful note about LowestLatency being a valid GLIDE value that is deliberately not exposed as a constant because it panics in the vendored native library. The new strategy is not in that category: it is fully implemented in the core, so it can be exposed normally once the vendored library is current.
The same parity gap in the other clients:
Description
GLIDE added a new read strategy,
AZAffinityAllNodes, in valkey-io/valkey-glide#6721, which closed valkey-io/valkey-glide#6653. Only the Python binding was wired up, so every other client needs the same surface. This issue tracks the Ruby side.The strategy spreads read requests equally, in round robin, across all nodes in the client's Availability Zone, primary and replicas alike. When no node in the client's AZ is available it falls back to a round robin across all nodes. It differs from
AZ_AFFINITY_REPLICAS_AND_PRIMARYin that it does not prioritise replicas ahead of the primary, which is what makes an even per-node read distribution possible on ElastiCache deployments that hit the 5 replica cap. The motivation is written up in valkey-io/valkey-glide#6653.Prerequisite
The vendored native library has to be built from a GLIDE revision that includes
AZAffinityAllNodes = 6inglide-core/src/protobuf/connection_request.proto, which landed with valkey-io/valkey-glide#6721.Valkey::ReadFromvalues are forwarded to the core as raw strings, so until the vendored core knows the value the constant cannot work.Checklist
AZ_AFFINITY_ALL_NODES = "AZAffinityAllNodes"toValkey::ReadFrominlib/valkey/read_from.rb.whenarm to theclient_azvalidation inlib/valkey.rb, so a missingclient_azraises the same way it does for the two existing AZ strategies. Without it the new strategy would silently accept a nil AZ.test/valkey/connection_config_test.rb, which already exercises the existing read-from values and their AZ validation.test/lint/connection_options.rbif it enumerates the acceptedread_from:values.Additional Notes
The Python diff in valkey-io/valkey-glide#6721 is a close reference for the binding surface, including the exact wording of the validation errors.
lib/valkey/read_from.rbcarries a helpful note aboutLowestLatencybeing a valid GLIDE value that is deliberately not exposed as a constant because it panics in the vendored native library. The new strategy is not in that category: it is fully implemented in the core, so it can be exposed normally once the vendored library is current.The same parity gap in the other clients: