Struct raft::Changer [−][src]
pub struct Changer<'a> { /* fields omitted */ }
Expand description
Changer facilitates configuration changes. It exposes methods to handle simple and joint consensus while performing the proper validation that allows refusing invalid configuration changes before they affect the active configuration.
Implementations
Creates a changer.
pub fn enter_joint(
&self,
auto_leave: bool,
ccs: &[ConfChangeSingle]
) -> Result<(Configuration, MapChange)>
[src]
pub fn enter_joint(
&self,
auto_leave: bool,
ccs: &[ConfChangeSingle]
) -> Result<(Configuration, MapChange)>
[src]Verifies that the outgoing (=right) majority config of the joint config is empty and initializes it with a copy of the incoming (=left) majority config. That is, it transitions from
(1 2 3)&&()
to
(1 2 3)&&(1 2 3)
```.
The supplied changes are then applied to the incoming majority config,
resulting in a joint configuration that in terms of the Raft thesis[1]
(Section 4.3) corresponds to `C_{new,old}`.
[1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf
Transitions out of a joint configuration. It is an error to call this method if the configuration is not joint, i.e. if the outgoing majority config is empty.
The outgoing majority config of the joint configuration will be removed, that is,
the incoming config is promoted as the sole decision maker. In the notation of
the Raft thesis1 (Section 4.3), this method transitions from C_{new,old}
into
C_new
.
At the same time, any staged learners (LearnersNext) the addition of which was held back by an overlapping voter in the former outgoing config will be inserted into Learners.
Carries out a series of configuration changes that (in aggregate) mutates the
incoming majority config Voters[0]
by at most one. This method will return an
error if that is not the case, if the resulting quorum is zero, or if the
configuration is in a joint state (i.e. if there is an outgoing configuration).
Auto Trait Implementations
impl<'a> RefUnwindSafe for Changer<'a>
impl<'a> UnwindSafe for Changer<'a>