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

cherrypick-1.1: storage: transfer raft leadership and wait grace period when draining #23306

Merged
merged 2 commits into from
Mar 2, 2018
Merged

Conversation

asubiotto
Copy link
Contributor

@asubiotto asubiotto requested review from bdarnell and a team March 1, 2018 23:04
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@bdarnell
Copy link
Contributor

bdarnell commented Mar 1, 2018

:lgtm:


Review status: 0 of 5 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

The previous version of getRaftLeader would not return the leader if all
replicas had the same term and the leader wasn't the first to be
iterated over.

Release note: None
@asubiotto
Copy link
Contributor Author

Removed the commit with t.Helper since it's not necessary and was failing CI.

Previously, even though a draining replica would transfer its lease,
when it came to `leasePostApply`, the raft leadership would not be
transferred because the target was not up-to-date enough. This would
result in the draining replica taking the leadership with it and
producing a zero qps scenario until a new election was held after
an election timeout.

This change adds a draining flag to a replica so that it may skip this
check. A draining store will also wait for a minimum of 5s after
transferring away all of its replica's leases to allow for the raft
leadership change to take place.

Addresses #22573.

Release note (bug fix): Fix a zero qps scenario when a node would be
gracefully drained.
@asubiotto asubiotto merged commit 8de9b26 into cockroachdb:release-1.1 Mar 2, 2018
@asubiotto asubiotto deleted the asubiotto/1.1cp22767 branch March 2, 2018 17:16
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.

3 participants