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
Conversation
When a peer is applying snapshot, it won't have any tasks in apply worker, hence it's safe to destroy it immediately.
src/raftstore/store/store.rs
Outdated
Some(p) => if p.peer_id() == peer.get_id() { | ||
p | ||
} else { | ||
// It has been destroyed. |
There was a problem hiding this comment.
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?
LGTM |
Some(p) => if p.peer_id() == peer.get_id() { | ||
p | ||
} else { | ||
assert!(p.peer_id() > peer.get_id()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
/run-all-tests |
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.