Chia-Ping Tsai created KAFKA-21267:
--------------------------------------
Summary: The empty removing/adding is omitted when calculating the
assignment
Key: KAFKA-21267
URL: https://issues.apache.org/jira/browse/KAFKA-21267
Project: Kafka
Issue Type: Bug
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
{code:java}
if (!reassignment.replicas().equals(currentReplicas)) {
builder.setTargetReplicas(reassignment.replicas());
}
if (!reassignment.removing().isEmpty()) {
builder.setTargetRemoving(reassignment.removing());
}
if (!reassignment.adding().isEmpty()) {
builder.setTargetAdding(reassignment.adding());
} {code}
I noticed those guards but could not find a reason for them, since an empty
delta is a totally possible situation in reassignments. The test cases in the
attachment were generated by AI, and they show how we can hit the issue when
the empty delta is not written back.
The simple fix is to remove those unnecessary conditions ...
--
This message was sent by Atlassian Jira
(v8.20.10#820010)