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.
Showing
- changelogs/unreleased/gh-8509-bootstrap-strategy-supervised.md 18 additions, 0 deletions...elogs/unreleased/gh-8509-bootstrap-strategy-supervised.md
- src/box/alter.cc 88 additions, 1 deletionsrc/box/alter.cc
- src/box/alter.h 2 additions, 0 deletionssrc/box/alter.h
- src/box/box.cc 48 additions, 7 deletionssrc/box/box.cc
- src/box/box.h 13 additions, 0 deletionssrc/box/box.h
- src/box/lua/ctl.c 9 additions, 0 deletionssrc/box/lua/ctl.c
- src/box/replication.cc 52 additions, 10 deletionssrc/box/replication.cc
- src/box/replication.h 1 addition, 0 deletionssrc/box/replication.h
- src/box/schema.cc 3 additions, 0 deletionssrc/box/schema.cc
- test/replication-luatest/bootstrap_strategy_test.lua 249 additions, 0 deletionstest/replication-luatest/bootstrap_strategy_test.lua
Loading
Please register or sign in to comment