-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support cluster discovery in MeshConnection
This feature adds the new optional arguments to the MeshConnection contructor: * `cluster_discovery_function` -- a name of the function which will be periodically called on a currently connected tarantool instance to update a list of MeshConnection addresses. * `cluster_discovery_delay` -- minimal amount of seconds between address list updates (default is 60 seconds). The update of addresses is performed right after successful connecting and before performing a request (if a minimal time passes). This commits changes the round robin retry strategy. Before it performs two attempts to connect to each address reconnect_max_attempts times (3 by default), now it do that only once. The new type of error is added: ConfigurationError. It is risen when a user provides incorrect configuration: say, one of provided addresses is not correct. The new type of warning is added: ClusterDiscoveryWarning. This warning is shown when a something went wrong during cluster discovery: say, one of returned addresses is not correct. Note the difference: a user provided configuration verified strictly, while a cluster discovery function result is filtered (with warnings) and good addresses are applied (if the list is not empty). Aside of the new functionality this commit improves compatibility of MeshConnection API with Connection. The following arguments are added to the MeshConnection constructor: `host`, `port`, `call_16`, `connection_timeout`. An address from `host` / `port` arguments is added to `addrs` (if provided) as the first item. Fixes #134.
- Loading branch information
1 parent
e98c377
commit 4dfe5f9
Showing
8 changed files
with
587 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
.. currentmodule:: tarantool.mesh_connection | ||
|
||
class :class:`MeshConnection` | ||
----------------------------- | ||
|
||
.. autoclass:: MeshConnection | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.