Skip to content

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

Closed
@TarantoolBot

Description

@TarantoolBot

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions