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


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMember.java:
##########
@@ -315,6 +320,37 @@ public StreamsGroupMember build() {
                 tasksPendingRevocation
             );
         }
+
+        /**
+         * Resets the assignment epochs to 0 for all assigned active tasks.
+         * Used when a static member leaves, so that the rejoining member's
+         * active tasks will be assigned from epoch 0 to the new member ID.
+         * All commits using the old member ID will be fenced.
+         */
+        public Builder resetAssignedTasksEpochsToZero() {

Review Comment:
   small cleanup: the two early returns could collapse into one (`if 
(activeTasksWithEpochs.isEmpty())`), and the inner for-loop setting each value 
to 0 reads a bit noisy - replaceAll((k, v) -> 0) or a stream collector would be 
tidier



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