Skip to content

Commit 2c109a4

Browse files
authored
Merge branch 'latest' into gh-4575-rep-queue-max-size
2 parents 13220ab + e6977b7 commit 2c109a4

File tree

1 file changed

+17
-123
lines changed

1 file changed

+17
-123
lines changed

doc/reference/configuration/configuration_reference.rst

Lines changed: 17 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,13 +3619,6 @@ The ``replication`` section defines configuration parameters related to :ref:`re
36193619

36203620
The expulsion process follows the standard procedure, involving the removal of the instance from the ``_cluster`` system space.
36213621

3622-
The ``autoexpel`` logic is activated during specific events:
3623-
3624-
- **Startup**. When the cluster starts, ``autoexpel`` checks and removes instances not matching the updated configuration.
3625-
- **Reconfiguration**. When the YAML configuration is reloaded, ``autoexpel`` compares the current state to the updated configuration and performs necessary expulsions.
3626-
- ``box.status`` **watcher event**. Changes detected by the ``box.status`` watcher also trigger the ``autoexpel`` mechanism.
3627-
3628-
36293622
``autoexpel`` does not take any actions on newly joined instances unless one of the triggering events occurs.
36303623
This means that an instance meeting the ``autoexpel`` criterion can still join the cluster, but it may be removed
36313624
later during reconfiguration or on subsequent triggering events.
@@ -3635,7 +3628,7 @@ The ``replication`` section defines configuration parameters related to :ref:`re
36353628
global levels. It is not applicable at the instance level.
36363629

36373630

3638-
Configuration fields
3631+
**Configuration fields**
36393632

36403633
- ``by`` (string, default: ``nil``): specifies the ``autoexpel`` criterion. Currently, only ``prefix`` is supported and must be explicitly set.
36413634

@@ -3645,7 +3638,8 @@ The ``replication`` section defines configuration parameters related to :ref:`re
36453638

36463639

36473640

3648-
replication.autoexpel_by.*
3641+
3642+
replication.autoexpel.by
36493643
~~~~~~~~~~~~~
36503644

36513645
``replication.autoexpel_by`` purpose is to define the criterion used for determining which instances in a cluster are
@@ -3655,15 +3649,16 @@ replication.autoexpel_by.*
36553649

36563650
- Instances that are part of the cluster and should adhere to the YAML configuration.
36573651

3658-
- Instances or tools (e.g., CDC tools) that use the replication channel but are not part of the cluster configuration.
3652+
- Instances or tools (e.g., CDC tools) that use the replication channel but are not part of the cluster configuration.
36593653

36603654

3661-
The default value of by is ``nil``, meaning no ``autoexpel`` criterion is applied unless explicitly set.
3655+
The default value of ``by`` is ``nil``, meaning no ``autoexpel`` criterion is applied unless explicitly set.
36623656

36633657
Currently, the only supported value for by is ``prefix``. The ``prefix`` value instructs the system to identify instances
36643658
based on their names, matching them against a prefix pattern defined in the configuration.
36653659

3666-
If the ``autoexpel`` feature is enabled (``enabled: true``), the ``by`` field must be explicitly set to ``prefix``.
3660+
3661+
If the ``autoexpel`` feature is enabled, the ``by`` field must be explicitly set to ``prefix``.
36673662

36683663
The absence of this field or an unsupported value will result in configuration errors.
36693664

@@ -3682,7 +3677,8 @@ replication.autoexpel_by.*
36823677
36833678

36843679

3685-
replication.autoexpel_enabled.*
3680+
3681+
replication.autoexpel.enabled
36863682
~~~~~~~~~~~~~
36873683

36883684
The ``replication.autoexpel_enabled`` field is a boolean configuration option that determines whether the autoexpel logic is active for the cluster.
@@ -3692,8 +3688,9 @@ replication.autoexpel_enabled.*
36923688

36933689
By default, the ``enabled`` field is set to ``false``, meaning the ``autoexpel`` logic is turned off. This ensures that no instances are automatically removed unless explicitly configured.
36943690

3695-
Enabling ``autoexpel`` logic
36963691

3692+
**Enabling ``autoexpel`` logic**
3693+
36973694
To enable ``autoexpel``, you should set enabled to true in the ``replication.autoexpel`` section of your YAML configuration:
36983695

36993696
.. code-block:: yaml
@@ -3708,7 +3705,8 @@ replication.autoexpel_enabled.*
37083705
To disable ``autoexpel``, set enabled to ``false``.
37093706

37103707

3711-
Dependencies
3708+
3709+
**Dependencies**
37123710

37133711
If ``enabled`` is set to ``true``, the following fields are required:
37143712

@@ -3723,8 +3721,8 @@ replication.autoexpel_enabled.*
37233721
| Environment variable: TT_REPLICATION_AUTOEXPEL_ENABLED
37243722
37253723

3726-
replication.autoexpel_prefix.*
3727-
~~~~~~~~~~~~~
3724+
3725+
replication.autoexpel.prefix
37283726

37293727
The ``prefix`` field filters instances for expulsion by differentiating cluster instances (from the YAML configuration) from external services (e.g., CDC tools). Only instances matching the prefix are considered.
37303728

@@ -3754,7 +3752,8 @@ replication.autoexpel_prefix.*
37543752
37553753
In this setup:
37563754

3757-
- Instances are grouped by replicaset names (e.g., ``r-001-i-001`` for ``replicaset r-001``).
3755+
- Instances are prefixed with a replicaset name (e.g., ``r-001-i-001`` for replicaset ``r-001``).
3756+
37583757
- The prefix ensures that only instances with names matching the replicaset name are auto expelled when removed from the configuration.
37593758

37603759

@@ -3779,111 +3778,6 @@ replication.autoexpel_prefix.*
37793778
| Environment variable: TT_REPLICATION_AUTOEXPEL_PREFIX
37803779
37813780

3782-
3783-
autoexpel full example
3784-
~~~~~~~~~~~~~
3785-
3786-
1. Create a ``config.yaml`` file with the following content:
3787-
3788-
.. code-block:: yaml
3789-
3790-
credentials:
3791-
users:
3792-
guest:
3793-
roles: [super]
3794-
3795-
replication:
3796-
failover: manual
3797-
autoexpel:
3798-
enabled: true
3799-
by: prefix
3800-
prefix: '{{ replicaset_name }}'
3801-
3802-
iproto:
3803-
listen:
3804-
- uri: 'unix/:./var/run/{{ instance_name }}.iproto'
3805-
3806-
groups:
3807-
g-001:
3808-
replicasets:
3809-
r-001:
3810-
leader: r-001-i-001
3811-
instances:
3812-
r-001-i-001: {}
3813-
r-001-i-002: {}
3814-
r-001-i-003: {}
3815-
3816-
3817-
This configuration:
3818-
- Sets up authentication with a guest user assigned the super role.
3819-
- Enables the ``autoexpel`` option to automatically expel instances not present in the YAML file.
3820-
- Defines instance names based on a prefix pattern: ``{{ replicaset_name }}``.
3821-
- Lists three instances: ``r-001-i-001``, ``r-001-i-002``, and ``r-001-i-003``.
3822-
3823-
3824-
2. Open terminal window and start three instances using the following commands:
3825-
3826-
.. code-block:: lua
3827-
3828-
tarantool --name r-001-i-001 --config config.yaml -i
3829-
3830-
3831-
.. code-block:: lua
3832-
3833-
tarantool --name r-001-i-002 --config config.yaml -i
3834-
3835-
3836-
.. code-block:: lua
3837-
3838-
tarantool --name r-001-i-003 --config config.yaml -i
3839-
3840-
3. Edit ``config.yaml`` and remove the following entry for ``r-001-i-003``:
3841-
3842-
.. code-block:: lua
3843-
r-001-i-003: {}
3844-
3845-
3846-
The updated ``config.yaml`` should look like this:
3847-
3848-
.. code-block:: yaml
3849-
3850-
groups:
3851-
g-001:
3852-
replicasets:
3853-
r-001:
3854-
leader: r-001-i-001
3855-
instances:
3856-
r-001-i-001: {}
3857-
r-001-i-002: {}
3858-
3859-
Save the file.
3860-
3861-
4. For the leader instance (``r-001-i-001``), check the ``_cluster`` space:
3862-
3863-
.. hint::
3864-
3865-
The ``_cluster`` system space in Tarantool stores metadata about all instances currently recognized as part of the cluster.
3866-
It shows which instances are registered and active.
3867-
3868-
You should see ``r-001-i-003`` still listed in the ``_cluster`` system space.
3869-
3870-
5. Reload the configuration:
3871-
3872-
.. code-block:: lua
3873-
3874-
config = require('config')
3875-
config:reload()
3876-
3877-
6. Verify the changes:
3878-
3879-
.. code-block:: lua
3880-
3881-
box.space._cluster:fselect()
3882-
3883-
After the reload, ``r-001-i-003`` should no longer appear in the ``_cluster`` system space.
3884-
3885-
3886-
38873781
.. _configuration_reference_replication_bootstrap_strategy:
38883782

38893783
.. confval:: replication.bootstrap_strategy

0 commit comments

Comments
 (0)