Skip to content

LoadState when the initial Addrs is a dns SRV records #1077

Closed as not planned
@delfick

Description

@delfick

Hi,

I have a kubedb redis cluster in my kubernetes cluster and I create my go-redis ClusterClient with the Addrs of []string{"my-redis.kubedb:6379"}.

This works fine until I do a deployment against my redis cluster that results in all nodes getting a new ip address.

When this happens, the loadState function at https://github.com/go-redis/redis/blob/master/cluster.go#L967 doesn't know it needs to re-resolve my-redis.kubedb again and so it never finds my new cluster.

It seems in this function I have the initial address at the start of the list but when https://github.com/go-redis/redis/blob/master/cluster.go#L983 happens it gets a cached node object for that address and because all nodes have new ip addresses, this node is no longer correct and so I get no route to host errors.

For now I'll recreate my client if I start getting no route to host errors, but I was wondering if you had ideas on how we can make the go-redis client able to handle this scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions