box: introduce on_election triggers
On_election triggers are fired asynchronously after any Raft event with a broadcast, they are run in a worker fiber, so it's allowed to yield inside them, unlike Raft's on_update triggers we already had. Closes #5819 @TarantoolBot document Title: document triggers on election state change A new function to register triggers is added, `box.ctl.on_election()`. Triggers registered via this function are run asynchronously every time a visible change in `box.info.election` table appears. No parameters are passed to the trigger, it may check what's changed by looking at `box.info.election` and `box.info.synchro`.
Showing
- changelogs/unreleased/gh-5819-election-triggers.md 5 additions, 0 deletionschangelogs/unreleased/gh-5819-election-triggers.md
- src/box/lua/ctl.c 8 additions, 0 deletionssrc/box/lua/ctl.c
- src/box/raft.c 4 additions, 0 deletionssrc/box/raft.c
- src/box/raft.h 7 additions, 0 deletionssrc/box/raft.h
- test/replication/election_basic.result 144 additions, 0 deletionstest/replication/election_basic.result
- test/replication/election_basic.test.lua 53 additions, 0 deletionstest/replication/election_basic.test.lua
Please register or sign in to comment