[BALANCER] Fix ShuffleTweaker
logic error that cause multiple replicas at one broker
#1770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
這個 PR 修正 #1656 帶來的錯誤,該 PR 的修正讓
ShuffleTweaker
的操作粒度從一個 partition 一次,變成一個 replica 一次,其 replica list alteration 的實作有一段程式碼會基於 stale state 做搬移決策:https://github.com/skiptests/astraea/blob/28ec2c6882c2fad0fffc7367d16e458dbd2e091c/common/src/main/java/org/astraea/common/balancer/tweakers/ShuffleTweaker.java#L134
這始得
ShuffleTweaker
有機會產生出不正常的 replica list,如把兩個同個 partition 的 replica,放到同個節點上。