StackExchange / StackExchange/StackExchange.Redis
SE.Redis not discovering Replica node AWS Cluster Mode Disabled
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 1.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
I have a Redis cache with a single replica Node (for failover) but we would like to use it for read commands.
My understanding is that using the ConnectionMultiplexer with the primary node should auto discover the replicas but it is not.
Using get GetEndPoints() I can see it only finds the primary node
Using endpoint Unspecified/redacted.com:6379. Role: Standalone, Connected: True. Replica: False. Cluster node count: (null)
so I expanded logging and can see where it get INFO sets server type to Standalone
redacted.com:6379: Auto-configured (CLIENT) connection-id: 9560805
redacted.com:6379: Auto-configured (INFO) role: primary
redacted.com:6379: Auto-configured (INFO) version: 7.1.0
redacted.com:6379: Auto-configured (INFO) server-type: Standalone
So I jumped out to Cloud Shell to run the info command and it does return the Replication info
# Server
redis_mode:standalone
...
# Replication
role:master
connected_slaves:1
It looks like you have a topology issue with the discovery. I think you are over prioritizing redis_mode in your classification, and need to check the Replication info with redis_mode:standalone with role:master.
By giving ConnectionMultiplexer both the primary and reader endpoints I was able to work around this issue, but I am concerned how this setup will function for people giving the connectionMultiplexer just the primary endpoint with a second node for failover if SE.Redis doesn't know the replica exists will it still failover?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ConnectionMultiplexer endpoint discovery and the INFO response handling described in the logs. Reproduce against an AWS Redis deployment with cluster mode disabled, comparing redis_mode:standalone and role:master with the discovered endpoints. Done means a primary-only connection discovers the replica and preserves expected failover behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, redis
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100