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: port disruptive test #41

Merged
merged 4 commits into from
Mar 23, 2018
Merged

raft: port disruptive test #41

merged 4 commits into from
Mar 23, 2018

Conversation

july2993
Copy link
Contributor

the port the raft relate part in etcd about #39

@siddontang
Copy link
Contributor

LGTM

@@ -2260,6 +2260,154 @@ fn test_non_promotable_voter_which_check_quorum() {
assert_eq!(nt.peers[&2].leader_id, 1);
}

#[test]
// test_disruptive_follower tests isolated follower,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use doc comment and put the #[test] attribute below the comments.

nt.send(vec![new_message(1, 1, MessageType::MsgPropose, 1)]);
nt.send(vec![new_message(1, 1, MessageType::MsgPropose, 1)]);

nt.peers.get_mut(&1).unwrap().pre_vote = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be set when the node is created using new_test_raft_with_prevote.

Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

src/raft.rs Outdated
@@ -224,7 +224,7 @@ pub struct Raft<T: Storage> {
heartbeat_elapsed: usize,

pub check_quorum: bool,
pre_vote: bool,
pub pre_vote: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems it doesn't have to be pub now?

siddontang
siddontang previously approved these changes Mar 21, 2018
@BusyJay BusyJay merged commit 3ce9555 into tikv:master Mar 23, 2018
@BusyJay
Copy link
Member

BusyJay commented Mar 23, 2018

Thanks for your contributions!

@july2993 july2993 deleted the disruptive_test branch March 23, 2018 02:50
@Hoverbear Hoverbear added this to the 0.3.0 milestone Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants