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

c/partition_allocator: maintain and use final partition counts #11154

Merged
merged 5 commits into from
Jun 2, 2023

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Jun 1, 2023

When moving partitions, partition allocations on old nodes are not removed until the move is finished. This makes sense because partitions remain physically present on old nodes until the very end. But we also use these allocation counts for count-based rebalancing. This is incorrect because after all moves are finished, the distribution won't necessary be uniform.

To fix this, introduce "final counts" - the number of partitions on a node after all currently in-progress moves are finished, maintain it when (re)allocating partitions and in topic_updates_dispatcher and use it in placement constraints and partition counts rebalancing in members_backend.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

  • none

ztlpn added 5 commits June 2, 2023 00:20
When moving partitions, partition allocations on old nodes are not
removed until the move is finished. This makes sense because
partitions remain physically present on old nodes until the very end.
But we also use these allocation counts for count-based rebalancing.
This is incorrect because after all moves are finished, the distribution
won't necessary be uniform. To fix this, introduce "final counts" - the
number of partitions on a node after all currently in-progress moves are
finished and maintain it when (re)allocating partitions and in
topic_updates_dispatcher.
Choose a node for the replica based on final partition counts, not on
currently allocated partitions (this should give better results for
counts-based rebalancing). Additionally, rename these constraints to
better reflect what they are doing.
@ztlpn ztlpn force-pushed the allocator-final-counts branch from 0252419 to 6ee77da Compare June 1, 2023 21:20
Copy link
Member

@mmaslankaprv mmaslankaprv left a comment

Choose a reason for hiding this comment

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

very nice, makes things more clear

@mmaslankaprv mmaslankaprv merged commit 220cc9f into redpanda-data:dev Jun 2, 2023
@ztlpn ztlpn deleted the allocator-final-counts branch November 27, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants