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

The mode option for call() and filter() #4151

Closed
Tracked by #4294
TarantoolBot opened this issue Apr 12, 2024 · 0 comments · Fixed by #4329
Closed
Tracked by #4294

The mode option for call() and filter() #4151

TarantoolBot opened this issue Apr 12, 2024 · 0 comments · Fixed by #4329
Assignees

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Apr 12, 2024

Related dev. issue(s): tarantool/tarantool#9930
Parent doc. issue(s): #4129

Product: Tarantool
Since: 3.1
Root document: not created yet (#4129)
SME: @ ImeevMA

Details

The new mode option is now supported by the call() and filter()
functions from the experimental.connpool module. This option allows to
filter candidates based on their read-only status.

The filter() function supports three values of the mode option:

  1. nil means that the read_only status of the instance is not
    checked;
  2. ro means that only instances with read_only == true are
    considered;
  3. rw means that only instances with read_only == false are
    considered.

The call() function supports five values of the mode option:

  1. nil means that the read_only status of the instance is not
    checked when instance is selected to execute call();
  2. ro means that only instances with read_only == true are
    considered when instance is selected to execute call();
  3. rw means that only instances with read_only == false are
    considered when instance is selected to execute call().
  4. prefer_ro means that call() will only be executed on instances
    with read_only == false if it is not possible to execute it on
    instances with read_only == true;
  5. prefer_rw means that call() will only be executed on instances
    with read_only == true if it is not possible to execute it on
    instances with read_only == false.

Note that if this option is not nil, a connection will be attempted to
each instance in the config if a connection does not exist. This means
that any of these functions can potentially block for a maximum of
<number of instances> * 10 seconds.
Requested by @ ImeevMA in tarantool/tarantool@60fdffb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants