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.
fix #1670
此PR修改計算搬移leader數量的
MigrationCost
,原本的計算方法為"計算每個broker在搬移前/搬移後的leader數量差異",此PR將migrate in與 migrate out拆開計算,如此一來,計算leader的搬移數量的移入與移出將不會抵銷舉個例子:
一個broker搬移前有5個replica leader,此時有一個搬移計畫對此broker移入20個replica leader以及移出10個leader,搬移後此broker上會有 5+20-10個leader(15),原來的算方法會看到leader搬移成本為15-5=+10,也就是增加了10個leader,但這不能實際表示搬移計畫移入或是移出多少leader,正確的數量應該分開計算移入20以及移出10,此PR對此做修正