-
Notifications
You must be signed in to change notification settings - Fork 969
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
Introduce MasterReplicaClient to reuse performance-intensive resources #1256
Comments
We currently have no way to reuse these facilities as the factory exposes static methods only. We didn’t add a stateful object such as RedisClusterClient to avoid yet another client object. |
Would it be possible to create external SentinelConnector instance (that will encapsulate single sentinel topology and refresher) and pass it to MasterReplica.connectAsync() as optional parameter? SentinelConnector requires same arguments as MasterReplica.connectAsync() so it can be created upfront and used to create connections in connection pool. |
These resources may be associated with state and disposable resources (e.g. the sentinel variant maintains connections to Redis sentinels to capture topology changes via pub/sub). We’ve a few tickets that as for master replica extensions that do not play well with the static factory methods. We will eventually have to add a something like a MasterReplica client and deprecate the MasterReplica factory. One of the items is the ability to use topology refresh on demand and a single connection isn’t the right place to do so. |
Do you see any workaround which we may apply, that will work with 5.2.x ? |
No, we cannot do anything for 5.2.x and 5.3. The earliest version with such support could be Lettuce 6 and even for Lettuce 6 it's unclear whether it's going to be 6.0 or 6.1. Given the current Corona impact I have even less time to build features myself. |
Bug Report
Each connection created using sentinel MasterReplica.connectAsync() creates new sentinel topology provider and refresher. This heavily degrades performance when used together with connections pool.
Current Behavior
Current SentinelConnector.connectAsync() implementations create a new instance of sentinel topology provider and refresher for every connection.
Expected behavior/code
Create single sentinel topology provider and refresher for all connections created from same client and URI.
Environment
The text was updated successfully, but these errors were encountered: