Skip to content

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

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

Open
amaan75 opened this issue May 6, 2025 · 1 comment
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@amaan75
Copy link

amaan75 commented May 6, 2025

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 6, 2025
@mp911de mp911de self-assigned this May 12, 2025
@amaan75
Copy link
Author

amaan75 commented May 18, 2025

@mp911de , I have a MRE available for this as well
Repo
I think my problem stems from the fact that shareNativeConnection is true which causes spring to cache that connection provider instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants