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: raft learners should be returned after applyConfChange #32

Merged
merged 3 commits into from
Feb 9, 2018

Conversation

july2993
Copy link
Contributor

@july2993 july2993 commented Feb 8, 2018

fix #12

add a new test test_raw_node_propose_add_learner_node() in test_raw_node.rs to cover the fix in apply_conf_change(..)

@siddontang
Copy link
Contributor

LGTM

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.

test_remove_learner should be updated too.

let rd = raw_node.ready();
s.wl().append(&rd.entries).expect("");
for e in rd.committed_entries.as_ref().unwrap() {
if e.get_entry_type() == EntryType::EntryConfChange {
Copy link
Member

Choose a reason for hiding this comment

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

What if conf change entry is not found after iterating all entries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated: check the committed_entries explicitly

@july2993
Copy link
Contributor Author

july2993 commented Feb 9, 2018

@BusyJay test_remove_learner is updated now

@BusyJay
Copy link
Member

BusyJay commented Feb 9, 2018

Thanks!

@BusyJay BusyJay merged commit a558296 into tikv:master Feb 9, 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.

raft: add a learner nodes function and separate learners from nodes
3 participants