showuon commented on a change in pull request #10367:
URL: https://github.com/apache/kafka/pull/10367#discussion_r598081851
##########
File path:
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignorTest.java
##########
@@ -1133,20 +1219,9 @@ public void
testTaskAssignmentWhenTasksDuplicatedInWorkerAssignment() {
assertDelay(0, returnedAssignments);
expectedMemberConfigs = memberConfigs(leader, offset,
returnedAssignments);
assertNoReassignments(memberConfigs, expectedMemberConfigs);
- assertAssignment(1, 4, 0, 2, "worker1", "worker2");
Review comment:
This revocation is unnecessary because we revoked the connecor1 and all
of the tasks in connector1 in previous round, so when entering this round, the
assignment is:
W1: connectors: [connector2], tasks: [T2-0, T2-1, T2-2, T2-3]
W2: connectors: [], tasks: []
We can just assign the connector1 and 4 of his tasks into W2, and complete
the rebalance.
However, before my change, in `performTasksRevocation` method, we use
`activeAssignment` as the total tasks, so, we'll get the `avg umber of tasks
each worker can have` = 4 (total active tasks) / 2 (total worker) = 2, then
revoke 2 tasks, and then assign to 2 workers in next round.
After my change, the `avg number of tasks each worker can have` will be: 8
(total tasks) / 2 (total workers) = 4, so no tasks will be revoked.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]