Skip to content

MINOR: fix reassign command bug#20003

Merged
chia7712 merged 2 commits intoapache:trunkfrom
DL1231:fix_reassign_command_bug
Jun 24, 2025
Merged

MINOR: fix reassign command bug#20003
chia7712 merged 2 commits intoapache:trunkfrom
DL1231:fix_reassign_command_bug

Conversation

@DL1231
Copy link
Copy Markdown
Collaborator

@DL1231 DL1231 commented Jun 20, 2025

see

case (part, reassignment) => if (!reassignment.addingReplicas().isEmpty ||

During the rewrite for
KAFKA-14595, the relevant
condition was omitted.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions Bot added triage PRs from the community tools small Small PRs labels Jun 20, 2025
@chia7712
Copy link
Copy Markdown
Member

@DL1231 could you please add tests for this bug fix?

}

// Now cancel the assignment and verify that the partition is removed from cancelled replicas
assertEquals(new AbstractMap.SimpleImmutableEntry<>(singleton(foo0), Collections.emptySet()), runCancelAssignment(assignment, true, true));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

runCancelAssignment returns SimpleImmutableEntry, so you use SimpleImmutableEntry to verify the value, right? If so, that is fine in this PR. However, could you please file a PR to replace SimpleImmutableEntry by Map.entry?

@chia7712 chia7712 merged commit 51f2c7b into apache:trunk Jun 24, 2025
25 checks passed
chia7712 pushed a commit that referenced this pull request Jun 24, 2025
chia7712 pushed a commit that referenced this pull request Jun 24, 2025
@chia7712
Copy link
Copy Markdown
Member

backport to 4.1 and 4.0

@github-actions github-actions Bot removed the triage PRs from the community label Jun 25, 2025
chia7712 pushed a commit that referenced this pull request Jun 26, 2025
see #20003 (comment)

Replace `SimpleImmutableEntry` by `Map.entry`.  Replace following
out-of-date APIs:

    Arrays.asList      Collections.singleton
Collections.singletonList      Collections.singletonMap

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, TengYao Chi
 <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
jiafu1115 pushed a commit to jiafu1115/kafka that referenced this pull request Jul 2, 2025
jiafu1115 pushed a commit to jiafu1115/kafka that referenced this pull request Jul 2, 2025
see apache#20003 (comment)

Replace `SimpleImmutableEntry` by `Map.entry`.  Replace following
out-of-date APIs:

    Arrays.asList      Collections.singleton
Collections.singletonList      Collections.singletonMap

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, TengYao Chi
 <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
jiafu1115 pushed a commit to jiafu1115/kafka that referenced this pull request Jul 3, 2025
jiafu1115 pushed a commit to jiafu1115/kafka that referenced this pull request Jul 3, 2025
see apache#20003 (comment)

Replace `SimpleImmutableEntry` by `Map.entry`.  Replace following
out-of-date APIs:

    Arrays.asList      Collections.singleton
Collections.singletonList      Collections.singletonMap

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, TengYao Chi
 <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
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.

3 participants