Skip to content

Empty IP address in cluster nodes output causes Hostname must not be empty or null #1985

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

Closed
alicez0626 opened this issue Feb 26, 2021 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@alicez0626
Copy link

Hi,

During a failover event, cluster nodes output can contain empty IP address such as the following (this is a known Redis behaviour):

4816fa4f6d56279223b54c9925d925a2e5f199fc :6379@1122 master,fail - 1612556082601 0 0 connected
8649eb7e1bc5fa2ace2258725ba7ff14b888c0a9 10.0.163.103:6379@1122 slave 616f2f090c7adfa68262d2a5124a77e5ec889255 0 16125
56087000 13 connected
8064698bd199161060d2771331cb91a678d33ba1 10.0.122.249:6379@1122 slave 570509b7522bac564b9b216dfa013205c95344d3 0 16125
56088000 12 connected
616f2f090c7adfa68262d2a5124a77e5ec889255 10.0.41.12:6379@1122 myself,master - 0 1612556089000 13 connected 0-8191
570509b7522bac564b9b216dfa013205c95344d3 10.0.182.73:6379@1122 master - 0 1612556089560 12 connected 8192-16383

When the client (spring-data-redis wrapper around Jedis) tries to update cluster topology by executing a cluster nodes command, the client is not able to parse the command output if such empty IP exists, and will throw the following exception, causing write outage:

org.springframework.data.redis.ClusterStateFailureException: Could not retrieve cluster information. CLUSTER NODES returned with error.
    - 10.0.122.249:6379 failed: Hostname must not be empty or null.
    - 10.0.182.73:6379 failed: Hostname must not be empty or null.
    - 10.0.41.12:6379 failed: Hostname must not be empty or null.
    - 10.0.163.103:6379 failed: Hostname must not be empty or null.

However, the cluster nodes output does contain the IP address of the new master, which is sufficient information for the client to continue write operation.

The ask here is to see if the client can ignore the empty IP address of the failed master.

References
The version being used:

group: 'org.springframework.data', name: 'spring-data-redis', version: '2.4.3'
redis.clients:jedis:3.3.0

Thank you

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 26, 2021
@mp911de
Copy link
Member

mp911de commented Mar 1, 2021

We should address the issue by skipping entries without a hostname/ip address.

@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 1, 2021
@mp911de mp911de self-assigned this Mar 1, 2021
@mp911de mp911de changed the title Request to ignore empty IP address in cluster nodes output Empty IP address in cluster nodes output causes Hostname must not be empty or null Mar 3, 2021
@christophstrobl christophstrobl added this to the 2.3.8 (Neumann SR8) milestone Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants