Feature Request: Public API Exposure for Sentinel Topology Events #3215
Labels
status: feedback-reminder
We've sent a reminder that we need additional information before we can continue
status: waiting-for-feedback
We need additional information before we can continue
Uh oh!
There was an error while loading. Please reload this page.
Summary:
Expose Sentinel events—such as SentinelTopologyRefreshEvent—in the public API, so that irrecoverable events during failover (e.g. "READONLY You can't write against a read only replica") can be captured and acted upon without relying on reflection or custom workarounds. This is currently due to the fact that the events are package protected.
Context:
We use Lettuce (version 6.3.0.RELEASE) in a Redis Sentinel setup. During master failover events, we encounter irrecoverable errors such as receiving
READONLY You can't write against a read only replica
errors on connections. We are testing some mitigations such as #2082 however as the connection issues are very hard to reproduce we'd like to increase the visibility in order to produce alerts on certain Sentinel events.Alternatives Tried:
Reflection:
We attempted to access internal fields for topology refresh data.
Custom Pub/Sub Listener:
We implemented a listener that subscribes to Sentinel’s +switch-master channel. For example:
Benefits:
Enables direct integration with external monitoring or recovery logic.
Eliminates reliance on fragile internal APIs or reflection.
Provides a more robust mechanism for detecting irrecoverable failover events (like inability to write to a read-only instance) and triggering corrective actions.
Request:
Please consider exposing Sentinel topology events (e.g. SentinelTopologyRefreshEvent) in the public API or providing a documented mechanism for subscribing to these events. This would allow external components to react to failover events, capture irrecoverable errors, and implement custom recovery logic without resorting to workarounds.
The text was updated successfully, but these errors were encountered: