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

partition_allocator: preserve shards for replicas on original nodes #11077

Merged
merged 4 commits into from
May 30, 2023

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented May 26, 2023

After one or several reallocations a replica may end up on one of the original nodes. Previously, we chose the shard for this replica anew in this case. This is awkward because the shard could change so the full replica id (i.e. broker_shard) changed even if the reallocation didn't change anything in the grand scheme of things. So this PR makes reallocations preserve the shard of replicas that end up on original nodes.

And of course this change makes it easier in the future to let nodes choose shards for the replicas they host themselves.

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 4 commits May 26, 2023 21:41
This is in preparation for preserving the shard when moving replicas to
original nodes - we want to choose the shard in partition_allocator
itself, not in allocation_strategy.
After one or several reallocations a replica may end up on one of the
original nodes. Previously, we chose the shard for this replica anew in
this case. This is awkward because the shard could change so the full
replica id (i.e. broker_shard) changed even if the reallocation didn't
change anything in the grand scheme of things. So this commit makes
reallocations preserve the shard of replicas that end up on original
nodes.

And of course this change makes it easier in the future to let nodes
choose shards for the replicas they host themselves.
@mmaslankaprv mmaslankaprv merged commit 4eba55a into redpanda-data:dev May 30, 2023
@ztlpn ztlpn deleted the allocator-preserve-shard 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