Prefer to use Endpoint.for
so that we properly persist the original seed endpoint scheme.
#62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am migrating our Elasticache Redis Cluster over to Valkey and decided to update our config to use TLS and IPv6. During this migration, I noticed two separate issues.
First, I got an error when
URI.parse
gets an IPv6 address back from the shard list:But then second, notice the scheme it's trying to connect to
redis://2600:1f28:372:c404:5c2d:ce68:3620:cc4b:
. So there's a few things wrong here.Upon trying to decide the best way to fix this, I came across the Redis Cluster docs which say the following about how we should connect to the cluster nodes:
It specifically says to prefer using the
endpoint
attribute, instead of theip
attribute which is what we were trying to connect to originally. By switchingEndpoint.remote
out forEndpoint.for
, we can actually kill two birds with one stone here. We are able to resolve the IPv6 address from theendpoint
value without any trouble, and we're also able to pass the originalscheme
.This report does highlight an unresolved issue for anyone trying to use
Endpoint.remote
with an IPv6 address but I figure that can be solved with a separate fix.FWIW, the
redis-rb
clustering library gets around this because it is not usingURI.parse
at all. They're simply splitting the address string by the last:
.Types of Changes
Contribution