Skip to content
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

.Caching.StackExchangeRedis Sentinel support #28367

Open
FWest98 opened this issue Oct 13, 2020 · 1 comment
Open

.Caching.StackExchangeRedis Sentinel support #28367

FWest98 opened this issue Oct 13, 2020 · 1 comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware feature-caching Includes: StackExchangeRedis and SqlServer distributed caches investigate
Milestone

Comments

@FWest98
Copy link

FWest98 commented Oct 13, 2020

Currently, the caching Redis plugin uses a simple ConnectionMultiplexer.ConnectAsync call with the given configuration. Unfortunately, this does not combine well with clusters with a sentinel.

  • The current dependent version of StackExchange.Redis requires two steps for connecting to a sentinel cluster: first to the sentinel, then to the appropriate master. This scenario cannot be implemented in the current API.
  • The latest version of StackExchange.Redis (2.1.58) no longer requires two steps for connecting to a sentinel cluster (Sentinel improvements StackExchange/StackExchange.Redis#1431): when using a normal Connect-call, the code will try and detect whether you connected to a sentinel and then automatically return a normal connection to the current master. However, once the master fails and another master is elected by the sentinels, this connection object is no longer valid and the caching breaks. There is currently no way to re-instantiate the connection easily.

My current workaround is using the new library version, implementing a Redis caching HealthCheck, and simply letting all application containers fail and be restarted by the orchestrator to connect to the new Redis master. This is, of course, not ideal.

It would be very much appreciated if support for sentinels can be incorporated into the library directly. For example, in the RedisCacheOptions add a bool option indicating the use of sentinel, and add code to retrieve the correct master on the fly; and retry this when the connection to the current master fails.

@JunTaoLuo JunTaoLuo transferred this issue from dotnet/extensions Dec 3, 2020
@JunTaoLuo JunTaoLuo added the feature-caching Includes: StackExchangeRedis and SqlServer distributed caches label Dec 3, 2020
@JunTaoLuo JunTaoLuo added this to the Backlog milestone Dec 3, 2020
@ghost
Copy link

ghost commented Dec 3, 2020

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware and removed area-runtime labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware feature-caching Includes: StackExchangeRedis and SqlServer distributed caches investigate
Projects
None yet
Development

No branches or pull requests

3 participants