-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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?