Skip to content

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

Closed
@alicez0626

Description

@alicez0626

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions