spring-projects / spring-projects/spring-data-redis

Aws ElastiCache: Master replica, once initial call to master for ROLE fails it then it never tries to rediscover MASTER

Open
#3,143 1 comment 0 reactions 1 assignee View on GitHub

@mp911de is already working on this.

Since May 12, 2025.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Hi, I am using lettuce with spring data Redis
LettuceCore : 6.1.4.RELEASE
spring-data-redis: 2.5.4
AWS elasticache for Redis 6.X (non clustered mode)
while connecting with Redis we supply the client 2 endpoints 1 reader endpoint and a primary endpoint.
we recently encountered an issue where while connecting to this cluster the role command to primary failed the first time because of some transient network issue and then even though the network became stable our set and get commands both continued to failed because we had set ReadFromUpstream as a read preference.

Is there any plans to change this behaviour?
Ideally I would like my container to retry figuring out if the master is available even if it wasn't able to do so the first time.

This is easily reproducible too, I setup a Redis with 1 master and 2 replicas via docker and keep the master down during the time my service tries to connect to Redis the first time and post that it stays that way.

My understanding is that the issue comes from the fact that once this masterReplicaConnectionProvider has the knownNodes set the first time and never changes afterwords.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.