Function raftstore::store::fsm::peer::maybe_destroy_source[][src]

pub fn maybe_destroy_source(
    meta: &StoreMeta,
    target_region_id: u64,
    target_peer_id: u64,
    source_region_id: u64,
    region_epoch: RegionEpoch
) -> (bool, bool)

Checks merge target, returns whether the source peer should be destroyed and whether the source peer is merged to this target peer.

It returns (can_destroy, merge_to_this_peer).

can_destroy is true when there is a network isolation which leads to a follower of a merge target Region’s log falls behind and then receive a snapshot with epoch version after merge.

merge_to_this_peer is true when can_destroy is true and the source peer is merged to this target peer.