lettuce icon indicating copy to clipboard operation
lettuce copied to clipboard

Sentinel support should be able to autodiscover additional Sentinel nodes

Open mikebell90 opened this issue 4 years ago • 2 comments

Refer to #1144 for original impetus.

Currently Lettuce provides a RedisURI with a list of Sentinel nodes.

My request is there is a way to create a shared SentinelTopologyProvider that caches this list, and adds/removes dynamically additional Sentinel nodes.

Example: I connect with 3 sentinel nodes, but entire cluster is 100 sentinel nodes. In the background Lettuce . would

a) After a delay (10 seconds suggested by Redis . Sentinel documents), a refresh of all Sentinel nodes is made. Additionally discovered ones are added, lost ones (sentinel reset) are removed.

b) Subscribe to the pub-sub topic and watch for new sentinel nodes added/removed (I'm assuming that information is available)

@mp911de brings up concerns of complexity and of security. Obviously the former is inarguable, though if it works like I think it would, it would be no more complex than the standard master/replica refresh. As for security, that's why it's an option, not required.

mikebell90 avatar Oct 31 '19 15:10 mikebell90

Further discussion of reasoning

@mp911de is of course correct that you can try to choose a reasonable number of seed nodes across availability groups and must do so for successful connection to begin with.

However a long running cluster may undergo maintenance. It's a bad thing IMO if the Sentinel topology is . not refreshed at the same time.

mikebell90 avatar Oct 31 '19 15:10 mikebell90

We should find an approach that balances usability vs. extensibility. As a first step, we could make the building blocks (such as SentinelConnector) public so anyone that wants customization beyond what we already provide is able to plug their own functionality together.

mp911de avatar Nov 07 '19 09:11 mp911de