forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connpool: support filtering by
sharding.roles
Support filtering replicasets by the configured sharding role by adding `sharding_roles` into the `connpool.filter()` and `connpool.call()` options. Closes tarantool#10318 @TarantoolBot document connpool: `sharding.roles` filtering support Now `connpool.filter()` and `connpool.call()` supports filtering by sharding roles using the `sharding_roles` option. Its value is the table containing the required sharding roles. Possible roles are: `router`, `storage`. Filtering out the `rebalancer` instances are not supported. Example: ```yaml groups: group-001: replicasets: replicaset-001: sharding: roles: [router] instances: instance-001: {} instance-002: {} group-002: replicasets: replicaset-002: sharding: roles: [storage] instances: instance-003: {} instance-004: {} ``` ```lua -- Returns { 'instance-003', 'instance-004' } connpool.filter({ sharding_roles = { 'storage' }}) -- Returns { 'instance-001', 'instance-002' } connpool.filter({ sharding_roles = { 'router' }}) -- Would call the function 'f1' on 'instance-001' or 'instance-002' connpool.call('f1', nil, { sharding_roles = { 'router' }}) ```
- Loading branch information
1 parent
f1c76b9
commit 32244f4
Showing
3 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelogs/unreleased/gh-10318-connpool-sharding-roles-filter.md
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/connpool | ||
|
||
- The `connpool.filter()` and `connpool.call()` functions now support | ||
filtering by the `sharding.roles` option (gh-10318). |
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