Commit 4dfe5f9
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.1 parent e98c377 commit 4dfe5f9
File tree
8 files changed
+587
-27
lines changed- doc
- api
- tarantool
- unit/suites
8 files changed
+587
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
| |||
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
| 180 | + | |
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
| |||
0 commit comments