lucasbru commented on code in PR #23454:
URL: https://github.com/apache/kafka/pull/23454#discussion_r4025082428


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/AssignmentRefinerImpl.java:
##########
@@ -547,4 +897,83 @@ record TaskDecisions(
         List<TaskGrant> grantedTasks
     ) {
     }
+
+    /**
+     * What a staged migration needs from the budget, which is what the 
classification pass sorts them by.
+     */
+    private enum Warming {
+        /** Nothing can warm this migration and no slot may be spent on it. */
+        PARK,
+
+        /** A standby on the target owner itself already warms it, for free. */
+        BORROW,
+
+        /** A warm-up is already restoring for it, and keeps the slot it was 
funded with. */
+        KEEP,
+
+        /** It needs a warm-up placed on its target owner, which costs a slot. 
*/
+        PLANT
+    }
+
+    /**
+     * A staged migration competing for a warm-up slot, with the parts of the 
funding order that can be resolved
+     * ahead of the comparisons.
+     *
+     * @param task
+     *        The task being migrated.
+     * @param targetOwner
+     *        The member the warm-up task goes on, if this migration is 
funded. Always the migration's target
+     *        owner, so that the warm-up can be promoted in place once it has 
caught up.
+     * @param targetProcessId
+     *        The process that member runs in, whose load the funding order 
reads and the accounting raises.
+     * @param sourceLoad
+     *        The load of the process still running the task, which cannot 
change during a funding pass.
+     * @param borrowable
+     *        Whether missing out on a slot leaves the migration warmed 
anyway, because a standby on a sibling member
+     *        of the target owner's process can be borrowed where it sits. 
Such a candidate never parks.
+     */
+    private record FundingCandidate(
+        TaskId task,
+        String targetOwner,
+        String targetProcessId,
+        double sourceLoad,

Review Comment:
   But the source of one migration can also be the target of another migration 
right? It seems that would change the source load.
   
   It may be worth not tracking the source load precisely for algorithmic 
simplicity, but the comments look now act like the source load doesn't change 
which I don't think is correct?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to