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

storage: Fix simulation of rebalance removals to actually remove targets #20709

Merged
merged 1 commit into from
Dec 14, 2017

Conversation

a-robinson
Copy link
Contributor

@a-robinson a-robinson commented Dec 14, 2017

If the first target attempted was rejected due to the simulation
claiming that it would be immediately removed, we would reuse the
modified rangeInfo.Desc.Replicas that had the target added to it,
messing with future iterations of the loop.

Also, we weren't properly modifying the candidates slice, meaning that
we could end up trying the same replica multiple times.

Release note (bug fix): Improve data rebalancing to make thrashing
back and forth between nodes much less likely.

@a-robinson a-robinson requested review from a6802739 and a team December 14, 2017 05:49
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@a-robinson
Copy link
Contributor Author

The test, if you're curious: a-robinson@bab317f

@a6802739
Copy link
Contributor

a6802739 commented Dec 14, 2017

@a-robinson LGTM.

Sorry for the incomplete fix in #18364 caused some problems for you.

#18364 just fix the problem that we could try to rebalance to a target store and then we will remove it immediately, but it couldn't fix the problem that we try to rebalance to a target store with Locality a and then remove another replica within Locality a again and again?

@a-robinson
Copy link
Contributor Author

Fair point that the new test is asking for a little too much. I've made it more lenient and added it to this PR. I'll follow up with the stricter version of the test separately.

If the first target attempted was rejected due to the simulation
claiming that it would be immediately removed, we would reuse the
modified `rangeInfo.Desc.Replicas` that had the target added to it,
messing with future iterations of the loop.

Also, we weren't properly modifying the `candidates` slice, meaning that
we could end up trying the same replica multiple times.

Release note (bug fix): Improve data rebalancing to make thrashing
back and forth between nodes much less likely.
@a-robinson a-robinson merged commit 0ee13bd into cockroachdb:master Dec 14, 2017
@a-robinson a-robinson deleted the allocatorfixes branch May 18, 2018 20:22
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