Skip to content

Commit

Permalink
fix one bug about MsgUnreachable local type
Browse files Browse the repository at this point in the history
close tikv/tikv#11371
Signed-off-by: tier-cap <[email protected]>

Signed-off-by: tier-cap <[email protected]>
  • Loading branch information
tier-cap committed Apr 21, 2022
1 parent f968d2c commit 3dc6ec5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/raft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ pub struct RaftCore<T: Storage> {
/// A struct that represents the raft consensus itself. Stores details concerning the current
/// and possible state the system can take.
pub struct Raft<T: Storage> {
/// the progress tracker of each peer.
pub prs: ProgressTracker,

/// The list of messages.
Expand Down
4 changes: 2 additions & 2 deletions src/raw_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ pub enum SnapshotStatus {

/// Checks if certain message type should be used internally.
pub fn is_local_msg(t: MessageType) -> bool {
// remove MessageType::MsgUnreachable
matches!(
t,
MessageType::MsgHup
| MessageType::MsgBeat
| MessageType::MsgUnreachable
| MessageType::MsgSnapStatus
| MessageType::MsgCheckQuorum
)
Expand Down Expand Up @@ -805,7 +805,7 @@ mod test {
let tests = vec![
(MessageType::MsgHup, true),
(MessageType::MsgBeat, true),
(MessageType::MsgUnreachable, true),
(MessageType::MsgUnreachable, false),
(MessageType::MsgSnapStatus, true),
(MessageType::MsgCheckQuorum, true),
(MessageType::MsgPropose, false),
Expand Down

0 comments on commit 3dc6ec5

Please sign in to comment.