8000 connpool: support filtering by `sharding.roles` · Issue #10318 · tarantool/tarantool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

connpool: support filtering by sharding.roles #10318

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

Closed
georgiy-belyanin opened this issue Jul 29, 2024 · 0 comments · Fixed by #10319
Closed

connpool: support filtering by sharding.roles #10318

georgiy-belyanin opened this issue Jul 29, 2024 · 0 comments · Fixed by #10319
Assignees
Labels
3.2 Target is 3.2 and all newer release/master branches connpool feature A new functionality

Comments

@georgiy-belyanin
Copy link
Member

Sometimes it's convenient to have a way to filter out all router or storage replicasets in connpool. The role of the replicaset is specified by the sharding.role option, which is not supported in connpool.

Need to support filtering by a sharding_roles option in connpool.filter().

@georgiy-belyanin georgiy-belyanin added feature A new functionality connpool labels Jul 29, 2024
@georgiy-belyanin georgiy-belyanin self-assigned this Jul 29, 2024
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Jul 29, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Closes tarantool#10318

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Jul 29, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

Closes tarantool#10318

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Jul 29, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

Closes tarantool#10318

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Jul 29, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

Closes tarantool#10318

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 1, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

Closes tarantool#10318

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 1, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

Closes tarantool#10318

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 5, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` options.

Closes tarantool#10318

@TarantoolBot document
connpool: `sharding.roles` filtering support
Now `connpool.filter()` 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`, `rebalancer`.

Example:

```yaml
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 5, 2024
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
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})

-- Would call the function 'f1' on 'instance-001' or 'instance-002'
connpool.call('f1', nil, { sharding_roles = { 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 5, 2024
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
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})

-- Would call the function 'f1' on 'instance-001' or 'instance-002'
connpool.call('f1', nil, { sharding_roles = { 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 9, 2024
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
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})

-- Would call the function 'f1' on 'instance-001' or 'instance-002'
connpool.call('f1', nil, { sharding_roles = { 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 9, 2024
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
sharding:
    roles: [storage, router]

groups:
  group-001:
    replicasets:
      replicaset-001:
        sharding:
          roles: [storage, router]
        instances:
          instance-001: {}
          instance-002: {}
  group-002:
    replicasets:
      replicaset-002:
        sharding:
          roles: [storage]
        instances:
          instance-003: {}
          instance-004: {}
```
```lua
-- Returns { 'instance-001', 'instance-002', 'instance-003',
--           'instance-004' }
connpool.filter({ sharding_roles = { 'storage' }})

-- Returns { 'instance-001', 'instance-002' }
connpool.filter({ sharding_roles = { 'storage', 'router' }})

-- Would call the function 'f1' on 'instance-001' or 'instance-002'
connpool.call('f1', nil, { sharding_roles = { 'router' }})
```
georgiy-belyanin added a commit to georgiy-belyanin/tarantool that referenced this issue Aug 15, 2024
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' }})
```
Totktonada pushed a commit that referenced this issue Aug 15, 2024
Support filtering replicasets by the configured sharding role by adding
`sharding_roles` into the `connpool.filter()` and `connpool.call()`
options.

Closes #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' }})
```
@Totktonada Totktonada added the 3.2 Target is 3.2 and all newer release/master branches label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2 Target is 3.2 and all newer release/master branches connpool feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0