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

raftstore: remove stale peer as soon as possible #2281

Merged
merged 5 commits into from Sep 13, 2017

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Sep 11, 2017

When a peer is applying snapshot, it won't have any tasks in apply worker, hence it's safe to destroy it immediately.

We need fail point support to write a stable tests.

When a peer is applying snapshot, it won't have any tasks in apply
worker, hence it's safe to destroy it immediately.
Some(p) => if p.peer_id() == peer.get_id() {
p
} else {
// It has been destroyed.
Copy link
Contributor

Choose a reason for hiding this comment

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

need to check p.peer_id() must > peer.get_id() here?

@lishuai87
Copy link
Contributor

LGTM

Some(p) => if p.peer_id() == peer.get_id() {
p
} else {
assert!(p.peer_id() > peer.get_id());
Copy link
Contributor

Choose a reason for hiding this comment

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

add a comment for how can we meet this case.

Copy link
Contributor

@siddontang siddontang 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

@BusyJay
Copy link
Member Author

BusyJay commented Sep 13, 2017

/run-all-tests

@siddontang siddontang merged commit 05f0362 into master Sep 13, 2017
@ngaut ngaut deleted the busyjay/destroy-stale branch October 2, 2017 15:44
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.

None yet

3 participants