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


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupTopologyDescriptionBackoff.java:
##########
@@ -71,6 +71,11 @@ public boolean isActive(String groupId, int topologyEpoch) {
      * the back-off, and to preserve the exponential chain when the previous 
window has
      * expired without a push reaching the coordinator (e.g. the client never 
sent one,
      * or the push was lost in flight before {@link #armOrExtend} could run).
+     *
+     * <p>Epoch-aware like {@link #armOrExtend}: a stored entry for a newer 
epoch is left
+     * alone. Without this, {@link #throttleConversionDelete}'s sentinel-epoch 
arm on an
+     * empty group could clobber a real-epoch entry left behind from before 
the group's
+     * last member departed, discarding its accumulated attempt count.

Review Comment:
   This unqualified Javadoc link resolves against 
`StreamsGroupTopologyDescriptionBackoff`, which has no 
`throttleConversionDelete` method. Use plain text or qualify the manager method 
so Javadoc does not emit an unresolved-reference error.



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupTopologyDescriptionBackoff.java:
##########
@@ -81,6 +86,9 @@ public boolean armIfNotActive(String groupId, int 
topologyEpoch) {
                 && now < existing.nextAttemptMs()) {
                 return existing;
             }
+            if (existing != null && existing.topologyEpoch() > topologyEpoch) {
+                return existing;

Review Comment:
   Returning the real-epoch entry here prevents `throttleConversionDelete` from 
installing its `UNCERTAIN` entry, while `isConversionDeleteThrottled` only 
checks `isActive(groupId, UNCERTAIN)`. In the scenario this change targets, 
every immediate classic-join retry therefore sees no throttle and invokes the 
failing delete plugin again in a tight loop. Preserving the heartbeat chain 
requires either separate per-purpose entries or updating the conversion 
throttle gate/arming semantics so it still establishes an active conversion 
window.



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