Skip to content

Conversation

@dgoyal-confluent
Copy link

The reassignment completion logic currently requires that all target replicas be present in the in-sync replica set (ISR). If an unhealthy broker exists in both the current and target replica sets (i.e., it is neither added nor removed during the reassignment), it still blocks the reassignment from completing.

For example, the following reassignments would fail to complete if replica 2 were unhealthy and unable to join the ISR, even though completing the reassignment would not reduce the number of replicas in the ISR:

  • [0, 1, 2] -> [0, 1, 2, 3]
  • [0, 1, 2] -> [1, 2, 3]
  • [0, 1, 2] -> [2, 3, 4]

We should allow reassignments to complete if there are replicas in the target replica set that are not in the ISR and are not part of the adding set. This is safe because completing the reassignment would not decrease the ISR size. However, if the target replica set is smaller than the current replica set, we will continue to require that all replicas in the target set are in the ISR to prevent the reassignment from unintentionally shrinking the ISR.

@github-actions github-actions bot added triage PRs from the community kraft small Small PRs labels Dec 9, 2025
@dgoyal-confluent dgoyal-confluent force-pushed the deegoy2/FixBlockedReassignments branch from e225092 to 5d530e9 Compare December 9, 2025 11:01

@Test
public void testDoesNotCompleteReassignmentIfIsrDoesNotHaveAllTargetReplicas() {
public void testCompleteReassignmentIfIsrDoesNotHaveAnExistingTargetReplica() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit on name: testCanCompleteReassignment....

@github-actions github-actions bot removed the triage PRs from the community label Dec 10, 2025
Copy link
Contributor

@ahuang98 ahuang98 left a comment

Choose a reason for hiding this comment

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

thanks for the changes! just requesting for maybe one or two more test cases. otherwise lgtm


@Test
public void testDoesNotCompleteReassignmentIfIsrDoesNotHaveAllTargetReplicas() {
public void testCanCompleteReassignmentIfIsrDoesNotHaveAnExistingTargetReplica() {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we test when replica 0 is missing as well? when both replica 0 and replica 1 are missing?

Copy link

Choose a reason for hiding this comment

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

Added testCanCompleteReassignmentIfIsrDoesNotHaveBothExistingTargetReplica, should be sufficient.

Copy link
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

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

@dgoyal-confluent : Thanks for the PR. Just a minor comment.


// Replica 1 is not in sync
Optional<PartitionReassignmentReplicas.CompletedReassignment> reassignmentOptional =
replicas.maybeCompleteReassignment(List.of(0, 2, 3));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just use {3} as the target ISR as in the original test?

Copy link

Choose a reason for hiding this comment

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

Does the newly added testCanCompleteReassignmentIfIsrDoesNotHaveBothExistingTargetReplica test cover the case?

@github-actions github-actions bot removed the small Small PRs label Dec 17, 2025
Copy link
Contributor

@ahuang98 ahuang98 left a comment

Choose a reason for hiding this comment

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

thanks for the improvement Deepak!

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.

5 participants