-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redis client in ipv6 environment is not working #2978
Comments
Thank you for your feedback. go-redis has not been adapted for IPv6. Are you interested in submitting a PR? |
Hi, I have a question. |
I'm not sure where the problem lies. In cluster mode, go-redis perceives all nodes within the cluster through the cluster slots command, using their IP addresses and ports to establish connections. However, I've checked all operations involving IP addresses, and they all use net.JoinHostPort(), which requires an IPv6 Redis cluster for testing. |
Can you print the result of cluster slots? |
I also encountered this error. Seems like |
I currently do not have more devices to build an IPv6 cluster for testing. I am not sure about the data format of MOVE ADDR. If it looks like MOVE fd01:abcd::7d03:6379, then it is not a valid IPv6 format. However, after Redis fixes it, it may look like MOVE [fd01:abcd::7d03]:6379, which could cause compatibility issues. |
redis ipv6 issue redis/redis#6238 It looks like we can make some compatibility adjustments to handle both fd01:abcd::7d03:6379 and [fd01:abcd::7d03]:6379 types of IPv6 addresses properly. @daviddzxy, can you continue? |
Moreover, under normal circumstances, go-redis should not encounter MOVE. Before sending a command, go-redis calculates the node for the key and sends the Redis command to that node. This type of issue only occurs when Redis is reassigning slots, and it seems we triggered another bug that caused slot calculation errors. |
Sure, I ll update the PR. |
I updated the PR. @monkey92t |
I have done some more debugging. It turns out that when |
Should I create another issue for this bug? I plan to make a PR with a fix later today. |
OK! |
Issue tracker is used for reporting bugs and discussing new features. Please use
stackoverflow for supporting issues.
When using redis-client 9.5.1 we have issue at ipv6 environment.
We have a kubernetes environment and we are using redis cluster.
In our application we first create a new redis client
with address redisdb service name: xxx-crdb.test.svc.cluster.local.:6379
Then we are checking connection with
resp, err := c.redisClient.Ping(context.Background()).Result()
Ping is successful.
After that are are creating a consumer group:
c.redisClient.XGroupCreateMkStream(context.Background(), streamName, groupName, start).Err()
The later command fails with redis-client 9.5.1 with error:
dial tcp: address fd01:abcd::7d03:6379: too many colons in address.
We have many retries and it constantly fails.
With redis-client 9.3.0 it fails once and then it succeeds.
The text was updated successfully, but these errors were encountered: