replication: change bootstrap and replication configuration behaviour
See the docbot request for details. Closes #5272 @TarantoolBot document Title: new `bootstrap_strategy` configuration option Default behaviour of replica set bootstrap, replica recovery when connecting to remote nodes and replication reconfiguration is changed. The new behaviour is controlled by the option `bootstrap_strategy`, which has the default value "auto". Now `replication_connect_quorum` configuration option takes no effect, and the effective quorum value for each stage of configuration (quorum of established connections, quorum of synced nodes) is determined automatically. On replica set bootstrap, the nodes will refuse to boot, unless a majority is reached (this would mean replication_connect_quorum = 3, when #box.cfg.repilcation is 4 or 5, for example, or replication_connect_quorum = 2, when #box.cfg.replication is 2 or 3). Moreover, the bootstrap leader will fail to boot unless it sees that every connected node chose it as the bootstrap leader. On new replica join to an existing cluster, the replica will fail to boot only if it couldn't connect to anyone. As long as at least one connection is established, the replica will try to join like before. Moreover, the replica will check that its box.cfg.replication table contains every registered node in the cluster, thus ensuring that it has tried to connect to everyone and chose the best bootstrap leader possible. On replication reconfiguration on a working instance and recovery from local WAL files, the node will try to connect to everyone specified in box.cfg.replication. Any number of connections (even no connections) will be deemed a success, but the replica will stay in orphan mode until it is synced with everyone connected. If you wish to return to the old behavior, a deprecated setting `bootstrap_strategy` = "legacy" is left for now. With `bootstrap_strategy` = "legacy", the node behaves exactly like before: quorum for both connection and synchronisation is determined by `replication_connect_quorum`, and neither bootstrap leader nor joining replicas perform any additional checks on bootstrap.
Showing
- changelogs/unreleased/gh-5272-bootstrap-strategy-auto.md 8 additions, 0 deletionschangelogs/unreleased/gh-5272-bootstrap-strategy-auto.md
- src/box/applier.cc 69 additions, 3 deletionssrc/box/applier.cc
- src/box/applier.h 4 additions, 0 deletionssrc/box/applier.h
- src/box/box.cc 75 additions, 2 deletionssrc/box/box.cc
- src/box/box.h 1 addition, 0 deletionssrc/box/box.h
- src/box/errcode.h 3 additions, 0 deletionssrc/box/errcode.h
- src/box/lua/cfg.cc 9 additions, 0 deletionssrc/box/lua/cfg.cc
- src/box/lua/load_cfg.lua 14 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/replication.cc 130 additions, 9 deletionssrc/box/replication.cc
- src/box/replication.h 19 additions, 0 deletionssrc/box/replication.h
- test/box-luatest/builtin_events_test.lua 6 additions, 1 deletiontest/box-luatest/builtin_events_test.lua
- test/box/admin.result 2 additions, 0 deletionstest/box/admin.result
- test/box/cfg.result 4 additions, 0 deletionstest/box/cfg.result
- test/box/error.result 3 additions, 0 deletionstest/box/error.result
- test/replication-luatest/bootstrap_strategy_auto_test.lua 183 additions, 0 deletionstest/replication-luatest/bootstrap_strategy_auto_test.lua
- test/replication-luatest/gh_4669_applier_reconnect_test.lua 2 additions, 2 deletionstest/replication-luatest/gh_4669_applier_reconnect_test.lua
- test/replication-luatest/gh_5568_read_only_reason_test.lua 1 addition, 0 deletionstest/replication-luatest/gh_5568_read_only_reason_test.lua
- test/replication-luatest/gh_6966_readonly_bootstrap_test.lua 8 additions, 9 deletionstest/replication-luatest/gh_6966_readonly_bootstrap_test.lua
- test/replication-luatest/gh_7253_election_long_wal_write_test.lua 1 addition, 0 deletions...lication-luatest/gh_7253_election_long_wal_write_test.lua
- test/replication-luatest/gh_7377_bootstrap_connection_failure_test.lua 1 addition, 0 deletions...ion-luatest/gh_7377_bootstrap_connection_failure_test.lua
Loading
Please register or sign in to comment