Copilot commented on code in PR #23784:
URL: https://github.com/apache/kafka/pull/23784#discussion_r4256374013


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/AssignmentRefinerImpl.java:
##########
@@ -302,6 +308,15 @@ static TaskDecisions analyzeTasks(
                 continue;
             }
 
+            // A target owner that never reports its restore progress could 
not be seen to finish warming up, so the
+            // task is handed to it right away, cold unless its own process 
still holds the state. A caught-up copy on
+            // another process is not worth a detour either: promoting it 
would only postpone the same grant and add
+            // a second hand-over. This is the price of a group that is 
part-way through a client upgrade.
+            if (WarmupSupport.of(heartbeatVersions.get(targetOwner)) == 
WarmupSupport.NOT_SUPPORTED) {

Review Comment:
   This handles only a known version-0 member, but `UNKNOWN` also cannot safely 
receive a new warm-up. After coordinator failover the version map is empty, so 
a migration to a target process with no existing copy is staged and 
`planWarmups` plants a warm-up, contrary to `AssignmentRefiner`'s contract and 
potentially stranding a version-0 target. Handle `UNKNOWN` separately: retain 
staging only when the target process already holds the copy; otherwise grant 
the task directly, and cover both paths with tests.



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