Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connpool: prefer_ro and prefer_rw for call()
This patch introduces "prefer_ro" and "prefer_rw" values for the "mode" option for the "call()" function. Closes #9930 @TarantoolBot document Title: The `mode` option for `call()` and `filter()` 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.
- Loading branch information
Showing
3 changed files
with
96 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## feature/experimental | ||
|
||
* Introduced the `mode` option for the `filter()` and `call()` functions | ||
in the `experimental.connpool` module (gh-9930). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters