push
github
limbo: introduce explicit state The txn_limbo::state now is one member which clearly reflects the state of the limbo: inactive, leader, or replica. Previously these states also existed but had to be deducted from other properties. With the new approach it became possible to remove some of the other state-flags, simplify others, and simplify the limbo's API in general. For example, there is no more such states as "fenced" or "frozen". Because these were very high-level descriptions of events like when a leader steps down due to quorum loss or a new term appearing or when the instance was just restarted. These were events, not states. The state in these cases is the limbo becoming a "replica" instead of "leader". With such approach the concept of "unfencing" also disappears. Because a replica can't just become a leader even if the quorum is restored. It anyway needs to be elected again. The most important parts of this commit are the state itself and the new flag is_transition_in_progress. The new flag previously didn't exist explicitly. These new things will be needed in scope of #8095, where ownership transition will actually be in progress for quite a while, not only during PROMOTE journal write. Part of #8095 NO_DOC=refactoring NO_CHANGELOG=refactoring NO_TEST=tested (cherry picked from commit a755e0ed3)
68798 of 116441 branches covered (59.08%)
72 of 72 new or added lines in 5 files covered. (100.0%)
210 existing lines in 17 files now uncovered.103585 of 118277 relevant lines covered (87.58%)
1631705.49 hits per line