Skip to content

Document the 'experimental.connpool' module #4329

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

Merged
merged 4 commits into from
Jul 4, 2024
Merged

Conversation

andreyaksenov
Copy link
Contributor

@andreyaksenov andreyaksenov commented Jul 1, 2024

Documented a new experimental.connpool module.
This PR fixes the following doc issues:

Staging: https://docs.d.tarantool.io/en/doc/connpool-api/reference/reference_lua/connpool/

Note

The code samples used in this document are created using the sharded_cluster_crud_docker demo application.

@andreyaksenov andreyaksenov force-pushed the connpool-api branch 6 times, most recently from e99352a to d684baf Compare July 2, 2024 10:17
@andreyaksenov andreyaksenov marked this pull request as ready for review July 2, 2024 10:19

``experimental.connpool`` is an experimental module and is subject to changes.

An ``experimental.connpool`` module provides a set of features for connecting to remote cluster instances and for executing remote procedure calls on an instance that satisfies the specified criteria.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An ``experimental.connpool`` module provides a set of features for connecting to remote cluster instances and for executing remote procedure calls on an instance that satisfies the specified criteria.
The ``experimental.connpool`` module provides a set of features for connecting to remote cluster instances and for executing remote procedure calls on an instance that satisfies the specified criteria.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that elsewhere in the doc we keep using a definite article before module names, even when introduced for the first time (e.g. https://docs.d.tarantool.io/en/doc/connpool-api/reference/reference_lua/iconv/), with the only exception of explicitly adding "new" like in "a new XXX module" in release notes, but not in the main doc.


.. NOTE::

You need to grant the ``execute`` :ref:`permission <configuration_credentials_managing_users_roles_granting_privileges>` for the specified function to a user used for replication to execute this function on a remote instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You need to grant the ``execute`` :ref:`permission <configuration_credentials_managing_users_roles_granting_privileges>` for the specified function to a user used for replication to execute this function on a remote instance.
You need to grant the ``execute`` :ref:`permission <configuration_credentials_managing_users_roles_granting_privileges>` for the specified function to users with the ``replication`` :ref:`role <box_space-user>` to execute this function on a remote instance.

Copy link
Contributor Author

@andreyaksenov andreyaksenov Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically speaking, a user used for replication and a user with the replication role might be different entities. In particular, user used for replication maintains inter-cluster communications while a user with the replication role can be created to allow some third-party system to get data from a Tarantool cluster (for example, CDC).

local connpool = require('experimental.connpool')
local conn = connpool.connect("storage-b-002", { fetch_schema = true })

Once you have a connection, you can execute requests on a remote instance, for example, select data from a space using :ref:`conn.space.\<space-name\>:select() <conn-select>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Once you have a connection, you can execute requests on a remote instance, for example, select data from a space using :ref:`conn.space.\<space-name\>:select() <conn-select>`.
Once you have a connection, you can execute requests on the remote instance, for example, select data from a space using :ref:`conn.space.\<space-name\>:select() <conn-select>`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaning "the instance to which the connection is established". As I understand, within a single connect() function call a connection can be established to only 1 instance, so the instance is unique in this context.

@andreyaksenov andreyaksenov merged commit 265ebaa into latest Jul 4, 2024
1 check passed
@andreyaksenov andreyaksenov deleted the connpool-api branch July 4, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The instances, replicasets and groups options The mode option for call() and filter() the experimental.connpool module
3 participants