vvcephei commented on a change in pull request #8696:
URL: https://github.com/apache/kafka/pull/8696#discussion_r429346085

File path: 
@@ -57,14 +59,42 @@ public boolean assign(final Map<UUID, ClientState> clients,
-        final boolean probingRebalanceNeeded = assignTaskMovements(
-            tasksToCaughtUpClients(statefulTasks, clientStates, 
+        final AtomicInteger remainingWarmupReplicas = new 
+        final Map<TaskId, SortedSet<UUID>> tasksToCaughtUpClients = 
+            statefulTasks,
+            clientStates,
+            configs.acceptableRecoveryLag
+        );
+        // We temporarily need to know which standby tasks were intended as 
+        // for active tasks, so that we don't move them (again) when we plan 
+        // task movements. We can then immediately treat warmups exactly the 
same as
+        // hot-standby replicas, so we just track it right here as metadata, 
+        // than add "warmup" assignments to ClientState, for example.
+        final Map<UUID, Set<TaskId>> warmups = new TreeMap<>();
+        final int neededActiveTaskMovements = assignActiveTaskMovements(
+            tasksToCaughtUpClients,
-            configs.maxWarmupReplicas
+            warmups,
+            remainingWarmupReplicas
+        );
+        final int neededStandbyTaskMovements = assignStandbyTaskMovements(
+            tasksToCaughtUpClients,
+            clientStates,
+            remainingWarmupReplicas,
+            warmups
         assignStatelessActiveTasks(clientStates, diff(TreeSet::new, 
allTaskIds, statefulTasks));
+        // We shouldn't plan a probing rebalance if we _needed_ task 
movements, but couldn't do any
+        // due to being configured for no warmups.

Review comment:
       Yeah, I've just realized this, too. And upon second consideration, I 
don't think the warmup=0 really provides a good mechanism for what I was 
thinking of. I think we'd better leave it as "at least one". Thanks!

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:

Reply via email to