showuon commented on a change in pull request #10367:
URL: https://github.com/apache/kafka/pull/10367#discussion_r598381699
##########
File path:
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java
##########
@@ -532,23 +531,23 @@ private void resetDelay() {
* each existing worker. The revoked tasks, once assigned to the new
workers will maintain
* a balanced load among the group.
*
- * @param activeAssignments
- * @param completeWorkerAssignment
- * @return
+ * @param allConnectorsAndTasks all the
connectors and tasks we need to distribute
+ * @param completeWorkerAssignmentWithoutDuplication current workers
assignment without duplication
+ * @return the connectors/tasks that needed to be revoked on each worker,
if no revoke is required, will return empty map
*/
- private Map<String, ConnectorsAndTasks>
performTaskRevocation(ConnectorsAndTasks activeAssignments,
-
Collection<WorkerLoad> completeWorkerAssignment) {
- int totalActiveConnectorsNum = activeAssignments.connectors().size();
- int totalActiveTasksNum = activeAssignments.tasks().size();
- Collection<WorkerLoad> existingWorkers =
completeWorkerAssignment.stream()
+ private Map<String, ConnectorsAndTasks>
performTaskRevocation(ConnectorsAndTasks allConnectorsAndTasks,
+
Collection<WorkerLoad> completeWorkerAssignmentWithoutDuplication) {
+ int totalConnectorsNum = allConnectorsAndTasks.connectors().size();
+ int totalTasksNum = allConnectorsAndTasks.tasks().size();
+ Collection<WorkerLoad> existingWorkers =
completeWorkerAssignmentWithoutDuplication.stream()
Review comment:
Use `allConnectorsAndTasks` (`configured`) to compute the total
connectors/tasks number, and use the
`completeWorkerAssignmentWithoutDuplication` to compute the existing workers.
So it'll always compute the correct expected connector/task number for each
worker
--
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]