Skip to content
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

[QUESTION]How to solve the redis-cluster server replay MOVED redirect address by redis-plus-plus #600

Closed
gxp0306 opened this issue Oct 8, 2024 · 7 comments

Comments

@gxp0306
Copy link

gxp0306 commented Oct 8, 2024

When using Redis Plus plus as a client to connect to the Redis cluster and access Redis, the Redis server replies with an Invalid ASK error message: 1492 1172:: 1: fd2a: 6379, requiring the client to use a redirect address for access. How can Redis Plus Plus retrieve data through the MOVED redirect address of Redis cluster

@sewenew
Copy link
Owner

sewenew commented Oct 8, 2024

Thanks for reporting this!

When parsing the ASK and MOVED error message, redis-plus-plus separates the message with the first whitespace and colon. However, this does not work IPV6, since it has colon in the IP part. I'll fix the problem by finding the colon from reverse order to separate port from the IP part.

B.T.W. Are you sure there're whitespace in the IP part? I don't think it's valid IPV6 format.

Regards

@gxp0306
Copy link
Author

gxp0306 commented Oct 8, 2024

Thank you for your reply!
Yeah, there're no whitespace in the IPV6.But if redis-cluster server replay redirect address ip is ipv4,How can use redis-plus-plus to get redis data througth redirect address,wheather redis-plus-plus can get redis data througth redirect address automaticly,applications do not anything.such as MOVED command.

@sewenew
Copy link
Owner

sewenew commented Oct 8, 2024

I fixed the code to make it support IPv6 on dev branch. Could you please test it with the dev branch? I don't have IPv6 env to do the test. Thanks!

But if redis-cluster server replay redirect address ip is ipv4,How can use redis-plus-plus to get redis data througth redirect address,wheather redis-plus-plus can get redis data througth redirect address automaticly

redis-plus-plus handles MOVED and ASK error, and follow the redirection to get the data. The application code doesn't need to handle these errors.

Regards

@sewenew
Copy link
Owner

sewenew commented Oct 9, 2024

I did some tests in IPv4 env, merged the code into master branch, and made a new release.

Regards

@sewenew sewenew closed this as completed Oct 9, 2024
@fjccc
Copy link

fjccc commented Nov 4, 2024

Hello, I would like to know the specific version corresponding to this dev branch

@fjccc
Copy link

fjccc commented Nov 4, 2024

Hello, I would like to ask if you can provide the link to the code submission when you solved this problem. We want to see the specific changes made.

@sewenew
Copy link
Owner

sewenew commented Nov 5, 2024

Hello, I would like to ask if you can provide the link to the code submission when you solved this problem. We want to see the specific changes made.

You can check this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants