Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raft:Fix one log append reject bug about MsgUnreachable msg #475

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/raft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ 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> {
prs: ProgressTracker,
/// the progress tracker of each peer.
pub prs: ProgressTracker,

/// The list of messages.
pub msgs: Vec<Message>,
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