raft: introduce box.cfg.election_* options
The new options are: - election_is_enabled - enable/disable leader election (via Raft). When disabled, the node is supposed to work like if Raft does not exist. Like earlier; - election_is_candidate - a flag whether the instance can try to become a leader. Note, it can vote for other nodes regardless of value of this option; - election_timeout - how long need to wait until election end, in seconds. The options don't do anything now. They are added separately in order to keep such mundane changes from the main Raft commit, to simplify its review. Option names don't mention 'Raft' on purpose, because - Not all users know what is Raft, so they may not even know it is related to leader election; - In future the algorithm may change from Raft to something else, so better not to depend on it too much in the public API. Part of #1146
Showing
- src/box/box.cc 92 additions, 0 deletionssrc/box/box.cc
- src/box/box.h 3 additions, 0 deletionssrc/box/box.h
- src/box/lua/cfg.cc 27 additions, 0 deletionssrc/box/lua/cfg.cc
- src/box/lua/load_cfg.lua 15 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/raft.c 30 additions, 0 deletionssrc/box/raft.c
- src/box/raft.h 35 additions, 0 deletionssrc/box/raft.h
- test/app-tap/init_script.result 3 additions, 0 deletionstest/app-tap/init_script.result
- test/box/admin.result 6 additions, 0 deletionstest/box/admin.result
- test/box/cfg.result 12 additions, 0 deletionstest/box/cfg.result
Loading
Please register or sign in to comment