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

kvserver: prevent StoreRebalancer from downreplicating #64650

Merged
merged 1 commit into from
May 20, 2021

Conversation

tbg
Copy link
Member

@tbg tbg commented May 4, 2021

When the replication factor is lowered and the StoreRebalancer
attempts a rebalance, it will accidentally perform a downreplication.
Since it wasn't ever supposed to do that, the downreplication is
pretty haphazard and doesn't safeguard quorum in the same way
that a "proper" downreplication likely would. Prevent if from
changing the number of voters and non-voters to avoid this issue.

Annoyingly, I knew about this problem, but instead of fixing it at the
source - as this commit does - I added a lower- level check that could
then not be backported to release-20.2, where we are now seeing this
problem.

#64649

Release note: None

When the replication factor is lowered and the StoreRebalancer
attempts a rebalance, it will accidentally perform a downreplication.
Since it wasn't ever supposed to do that, the downreplication is
pretty haphazard and doesn't safeguard quorum in the same way
that a "proper" downreplication likely would. Prevent if from
changing the number of voters and non-voters to avoid this issue.

Annoyingly, I [knew] about this problem, but instead of fixing it at the
source - as this commit does - I added a lower- level check that could
then not be backported to release-20.2, where we are now seeing this
problem.

[knew]: cockroachdb#54444 (comment)

Release note: None
@tbg tbg requested a review from a team May 4, 2021 12:44
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

LGTM

@tbg
Copy link
Member Author

tbg commented May 20, 2021

bors r=erikgrinaker,nvanbenschoten

I feel bad about merging this without a test but writing a test for this is a massive PITA, this fix is "obviously" working, and also I hear that @aayushshah15 has to rewrite this whole thing anyway.

@tbg
Copy link
Member Author

tbg commented May 20, 2021

bors r-

@craig
Copy link
Contributor

craig bot commented May 20, 2021

Canceled.

@tbg
Copy link
Member Author

tbg commented May 20, 2021

bors r=erikgrinaker,nvanbenschoten

Just thought Aayush had discovered & fixed this independently, but he fixed another bug of the same sort: #64064

@craig
Copy link
Contributor

craig bot commented May 20, 2021

Build succeeded:

@craig craig bot merged commit 1059834 into cockroachdb:master May 20, 2021
@tbg tbg deleted the avoid-storerebalancer-downreplication branch September 23, 2021 09:08
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.

4 participants