Skip to content
Snippets Groups Projects
Commit c419cab7 authored by Serge Petrenko's avatar Serge Petrenko Committed by Serge Petrenko
Browse files

replication: add bootstrap_strategy "supervised"

This commit adds another possible bootstrap_strategy to accompany "auto"
and "config": "supervised".

Such a strategy may be useful to pin the desired bootstrap leader on an
active cluster (so that the user may join the replicas from the desired
node without changing their box.cfg) or to manually set the bootstrap
leader among the nodes that managed to start without issues.

More details are in the docbot request.

Closes #8509

@TarantoolBot document
Title: new bootstrap strategy - "supervised"

The `bootstrap_strategy` configuration option may now be set to
"supervised".

This strategy works as follows:
When bootstrapping a new replicaset, the nodes do not choose a bootstrap
leader automatically and instead wait for it to be appointed by the
user. The configuration will fail if no bootstrap leader is appointed
during a `replication_connect_timeout`.

In order to apppoint a bootstrap leader, the user has to issue
`box.ctl.make_bootstrap_leader()` call on the desired node. This must be
done during the initial `box.cfg()` call.

Possible ways to achieve this are:

1. In interactive mode:
```lua
fiber.create(box.cfg, desired_config)
box.ctl.make_bootstrap_leader()
```
2. Via an init script:
```lua
-- Init script:
console.listen(admin_port)
box.cfg(desired_config)
-- User console:
tarantoolctl enter admin port
> box.ctl.make_bootstrap_leader()
```

When joining a new replica with `bootstrap_strategy` = "supervised" to
an existing replica set, the replica will not choose the bootstrap
leader automatically, but will instead join to the node on which
`box.ctl.make_bootstrap_leader()` was issued last. In case such a node
isn't found after a `replication_connect_timeout`, the configuration
fails.
parent ea4a55df
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment