Skip to content

Automatic master discovery #196

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

Closed
Totktonada opened this issue Nov 18, 2021 · 0 comments · Fixed by #207
Closed

Automatic master discovery #196

Totktonada opened this issue Nov 18, 2021 · 0 comments · Fixed by #207
Assignees
Labels
feature A new functionality

Comments

@Totktonada
Copy link
Member

Totktonada commented Nov 18, 2021

  • Poll box.info.ro on each instance every X seconds.
  • Add mode = 'any' / 'ro' / 'prefer_ro' / 'prefer_rw' / 'rw' parameter for call, eval, execute, select, ping, insert, replace, delete, update, upsert.
  • Fail fast: if we have no rw instance ATM -> report the fail to a caller.
  • Fail fast: got ER_READ_ONLY -> report it to a caller.

RFC is here.

Related: tarantool/go-tarantool#113.

@Totktonada Totktonada added feature A new functionality teamE labels Nov 18, 2021
@Totktonada Totktonada added the 8sp label Dec 14, 2021
DifferentialOrange added a commit that referenced this issue Mar 17, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 17, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 17, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Mar 23, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
User used to connect must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is selected to execute this request.
Connection is selected based on request mode:
* Mode.RW selects an RW instance.
* Mode.PREFER_RW selects an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO selects an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode. For any other type of request (call, eval,
execute, ping, select) mode could be set explicitly.

pool.call('some_write_procedure', args, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 19, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since
it would be a waste to ignore several Python 3.x features in master
discovery implementation, we decided to drop Python 2 support here.

Python 2 workaround cleanup activities are expected to be solved as
part of #212 solution.

1. https://www.python.org/doc/sunset-python-2/

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce connection interface to be used in connection pool
implementation. Only CRUD and base connect/close API is required
by the interface.

Part of #196
DifferentialOrange added a commit that referenced this issue Apr 20, 2022
Introduce ConnectionPool class to work with cluster of Tarantool
instances. ConnectionPool support master discovery and ro/rw-based
requests, so it is most useful while working with a single replicaset of
instances. ConnectionPool is supported only for Python 3.7 or newer.
Authenticated user must be able to call `box.info` on instances.

ConnectionPool updates information about each server state (RO/RW)
on initial connect and then asynchronously in separate threads.
Application retries must be written considering the asynchronous nature
of cluster state refresh. User does not need to use any synchronization
mechanisms in requests, it's all handled with ConnectionPool methods.

ConnectionPool API is the same as a plain Connection API.
On each request, a connection is chosen to execute this request.
A connection is chosen based on a request mode:
* Mode.ANY chooses any instance.
* Mode.RW chooses an RW instance.
* Mode.RO chooses an RO instance.
* Mode.PREFER_RW chooses an RW instance, if possible, RO instance
  otherwise.
* Mode.PREFER_RO chooses an RO instance, if possible, RW instance
  otherwise.
All requests that are guaranteed to write (insert, replace, delete,
upsert, update) use RW mode by default. select uses ANY by default. You
can set the mode explicitly. call, eval, execute and ping requests
require to set the mode explicitly.

Example:

  pool = tarantool.ConnectionPool(
      addrs=[
          {'host': '108.177.16.0', 'port': 3301},
          {'host': '108.177.16.0', 'port': 3302},
      ],
      user='test',
      password='test',)

  pool.call('some_write_procedure', arg, mode=tarantool.Mode.RW)

Closes #196
DifferentialOrange added a commit that referenced this issue Apr 22, 2022
Add a short guide how to setup Tarantool user to able to work with
connection pool.

Follows up #196
DifferentialOrange added a commit that referenced this issue Oct 19, 2022
After backporting dataclasses, it became possible to use
ConnectionPool on Python 3.6.

Follows #196
DifferentialOrange added a commit that referenced this issue Oct 21, 2022
After backporting dataclasses, it became possible to use
ConnectionPool on Python 3.6.

Follows #196
DifferentialOrange added a commit that referenced this issue Oct 24, 2022
After backporting dataclasses, it became possible to use
ConnectionPool on Python 3.6.

Follows #196
DifferentialOrange added a commit that referenced this issue Oct 24, 2022
After backporting dataclasses, it became possible to use
ConnectionPool on Python 3.6.

Follows #196
DifferentialOrange added a commit that referenced this issue Oct 27, 2022
After backporting dataclasses, it became possible to use
ConnectionPool on Python 3.6.

Follows #196
DifferentialOrange added a commit that referenced this issue Oct 31, 2022
After backporting dataclasses, it became possible to use
ConnectionPool on Python 3.6.

Follows #196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants