chickenchickenlove commented on code in PR #21565:
URL: https://github.com/apache/kafka/pull/21565#discussion_r2871550726


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -4151,6 +4343,40 @@ private 
CoordinatorResult<ConsumerGroupHeartbeatResponseData, CoordinatorRecord>
         );
     }
 
+    /**
+     * Handles the case when a static member decides to leave the group.
+     * The member is not actually fenced from the group, and instead it's
+     * member epoch is updated to -2 to reflect that a member using the given
+     * instance id decided to leave the group and would be back within session
+     * timeout.
+     *
+     * @param group     The group.
+     * @param member    The static member in the group for the instance id.
+     *
+     * @return A CoordinatorResult with a single record signifying that the 
static member is leaving.
+     */
+    private CoordinatorResult<StreamsGroupHeartbeatResult, CoordinatorRecord> 
streamsGroupStaticMemberGroupLeave(

Review Comment:
   Sorry for making you confused.  🙇‍♂️ 
   JFYI, This is why I implemented it that way. (AFAIK, KIP-1071 does not 
define the behavior for this case.)
   
   My understanding is that the coordinator tracks `pendingRevocationTasks` and 
uses them to determine whether a task is still owned or not. 
`pendingRevocationTasks` represent tasks that the member is expected to revoke 
and report as revoked in the next heartbeat response.
   
   However, when a `static member` terminates with epoch `-2`, we can generally 
assume the Streams application has shut down. In that case, even if we never 
receive a follow-up heartbeat response, it is reasonable to treat the 
revocation as completed.
   
   Therefore, by writing `pendingRevocationTasks` as `EMPTY`, another member 
that is waiting to acquire those tasks can be assigned them immediately, 
without having to wait for the static member that left with -2 to come back.
   
   What do you think?



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