Skip to content
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

Get a list of 'connectable' instances from the first node #134

Closed
sharonovd opened this issue Mar 20, 2019 · 1 comment · Fixed by #135
Closed

Get a list of 'connectable' instances from the first node #134

sharonovd opened this issue Mar 20, 2019 · 1 comment · Fixed by #135
Assignees
Labels

Comments

@sharonovd
Copy link

Use-case:
there is a sharded cluster of ~50 tarantools, 12 vshard-routers. User wants to be able to reconnect to another noe smoothly (if the first one goes down). It is not suitable to pass all 50 nodes to connectmesh, moreover - adding a new router requires all client applications restart.

Proposed solution:

  • connector should receive a list of connectable nodes from the first one it connects to. Exact procedure on tarantool side must be configurable.
  • this list should replace the one passed initially.
  • this list should be refreshed periodically in the background
@sharonovd
Copy link
Author

Corner cases:

  1. What should be done if after a list refresh currently active node is no longer in it?
  2. What is the exact API for connector and tarantool?

@Totktonada please help elaborate those, I usually tend to simplest solutions

msiomkin added a commit that referenced this issue Mar 21, 2019
Periodically call a user-defined Lua function on a node to obtain or
refresh the full cluster nodes list.

Resolves: #134
msiomkin added a commit that referenced this issue Mar 23, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
msiomkin added a commit that referenced this issue Mar 23, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
msiomkin added a commit that referenced this issue Mar 23, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
msiomkin added a commit that referenced this issue Mar 23, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
msiomkin added a commit that referenced this issue Mar 24, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
denis-ignatenko pushed a commit that referenced this issue May 31, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
denis-ignatenko pushed a commit that referenced this issue Jun 5, 2019
Periodically call a user-defined Lua function on the current node to
obtain or refresh the full cluster nodes list.

Resolves: #134
Totktonada pushed a commit that referenced this issue Jun 9, 2019
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.
Totktonada pushed a commit that referenced this issue Jun 10, 2019
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.
Totktonada pushed a commit that referenced this issue Jun 10, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants