showuon commented on a change in pull request #10367:
URL: https://github.com/apache/kafka/pull/10367#discussion_r598079320



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java
##########
@@ -258,17 +241,12 @@ private Long ensureLeaderConfig(long maxOffset, 
WorkerCoordinator coordinator) {
         handleLostAssignments(lostAssignments, newSubmissions, 
completeWorkerAssignment, memberConfigs);
 
         // Do not revoke resources for re-assignment while a delayed rebalance 
is active
-        // Also we do not revoke in two consecutive rebalances by the same 
leader
-        canRevoke = delay == 0 && canRevoke;
-
-        // Compute the connectors-and-tasks to be revoked for load balancing 
without taking into
-        // account the deleted ones.
-        log.debug("Can leader revoke tasks in this assignment? {} (delay: 
{})", canRevoke, delay);
-        if (canRevoke) {
+        log.debug("Can leader revoke tasks in this assignment? (delay: {})", 
delay);
+        if (delay == 0) {
+            // Compute the connectors-and-tasks to be revoked for load 
balancing without taking into
+            // account the deleted ones.
             Map<String, ConnectorsAndTasks> toExplicitlyRevoke =
-                    performTaskRevocation(activeAssignments, 
currentWorkerAssignment);
-
-            log.debug("Connector and task to revoke assignments: {}", 
toRevoke);
+                    performTaskRevocation(configured, 
currentWorkerAssignmentWithoutDuplication);

Review comment:
       change (3): pass `configured` (total tasks we have), and 
`currentWorkerAssignmentWithoutDuplication` into `performTaskRevocation` method.




-- 
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]


Reply via email to