StackExchange / StackExchange/StackExchange.Redis

Sentinel connection error when using the highIntegrity = true configuration

Open
#2,992 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

I am using Redis with the sentinel model.
Environment information:

Redis version: 7.0.5
StackExchange.Redis version: 2.8.58
My connection string configuration is as follows:
“10.0.0.1:26379,10.0.0.2:26379,10.0.0.3:26379,serviceName=mycluster,abortConnect=false,highIntegrity=true”

I encountered the following error:

StackExchange.Redis.RedisConnectionException: Sentinel: The ConnectionMultiplexer is not a Sentinel connection. Detected as: Standalone
   at StackExchange.Redis.ConnectionMultiplexer.GetSentinelMasterConnection(ConfigurationOptions config, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs:line 173
   at StackExchange.Redis.ConnectionMultiplexer.SentinelPrimaryConnectAsync(ConfigurationOptions configuration, TextWriter writer) in /_/src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs:line 157
   at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectSlowAsync(CancellationToken token)
   at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token)
   at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)
   at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetStringAsync(IDistributedCache cache, String key, CancellationToken token)

Before setting highIntegrity=true, I did not encounter this error.

Please help me find the root cause of the error.
Thank you!

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.

Research direction

Start in src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs at GetSentinelMasterConnection and SentinelPrimaryConnectAsync, then trace how the highIntegrity option is parsed and how the connection is detected as Standalone. Reproduce the reported configuration with Redis 7.0.5 and StackExchange.Redis 2.8.58. Done means the root cause of the Sentinel detection error is identified and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.