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: support request snapshot on leader's side #4926

Merged
merged 12 commits into from Jul 4, 2019

Conversation

Projects
None yet
4 participants
@overvenus
Copy link
Contributor

commented Jun 19, 2019

What have you changed? (mandatory)

Support actively request snapshot on leader's side. It enables a follower/learner to request a snapshot even if it has up-to-date log.

What are the type of the changes? (mandatory)

  • New feature (change which adds functionality)

How has this PR been tested? (mandatory)

Unit tests.

Does this PR affect documentation (docs) or release note? (mandatory)

No.

Does this PR affect tidb-ansible update? (mandatory)

No.

Refer to a related PR or issue link (optional)

Please merge pingcap/raft-rs#243 first.

raftstore: support request snapshot on leader's side
Signed-off-by: Neil Shen <overvenus@gmail.com>

@overvenus overvenus requested review from BusyJay and Connor1996 Jun 19, 2019

@overvenus overvenus added the C: Raft label Jun 19, 2019

overvenus added some commits Jul 2, 2019

update raft
Signed-off-by: Neil Shen <overvenus@gmail.com>
peer_storage: always save raft state after applied a snapshot
Signed-off-by: Neil Shen <overvenus@gmail.com>
raftstore: reject request snapshot while merging
Signed-off-by: Neil Shen <overvenus@gmail.com>

@overvenus overvenus force-pushed the overvenus:request-snasphot branch from 8d0419e to 1eaa89e Jul 2, 2019

peer: update comments
Signed-off-by: Neil Shen <overvenus@gmail.com>
@overvenus

This comment has been minimized.

Copy link
Contributor Author

commented Jul 2, 2019

Address comments
Signed-off-by: Neil Shen <overvenus@gmail.com>
@zhangjinpeng1987
Copy link
Member

left a comment

LGTM

Test leader rejects merge if there is any request snapshot
Signed-off-by: Neil Shen <overvenus@gmail.com>
let mut min = None;
if let Some(progress) = self.raft_group.status_ref().progress {
for (id, pr) in progress.iter() {
if pr.state == ProgressState::Snapshot

This comment has been minimized.

Copy link
@Connor1996

Connor1996 Jul 3, 2019

Member

add some comments here?

@Connor1996
Copy link
Member

left a comment

rest LGTM

hicqu and others added some commits Jul 3, 2019

Address comments
Signed-off-by: Neil Shen <overvenus@gmail.com>
Merge branch 'request-snasphot' of https://github.com/overvenus/tikv
…into request-snasphot

Signed-off-by: Neil Shen <overvenus@gmail.com>
@overvenus

This comment has been minimized.

Copy link
Contributor Author

commented Jul 4, 2019

@zhangjinpeng1987
Copy link
Member

left a comment

LGTM

@Connor1996
Copy link
Member

left a comment

LGTM

@overvenus overvenus merged commit e17843a into tikv:master Jul 4, 2019

2 checks passed

DCO All commits are signed off!
Details
idc-jenkins-ci/test Jenkins job succeeded.
Details

@overvenus overvenus deleted the overvenus:request-snasphot branch Jul 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.