philipnee commented on PR #14390: URL: https://github.com/apache/kafka/pull/14390#issuecomment-1758845137
Hello @dajac @lianetm @kirktrue - I think the scope of this PR extended a bit beyond "replacing GroupState" because we've realized the member may join/leave the group anytime during its lifecycle. In particular, when the member hasn't joined/ has already left the group, we should stop sending the heartbeat. The current implementation assumes the member should always try to join the group if the groupId is provided, due to the fact that the member's initial state is `UNJOINED`. However, as previously mentioned: 1. the user may only want to commit offsets 2. the user may unsubscribe and then assign (so we should keep the consumer alive and allows it to continue to commit offset) 3. the user might leave the group due to lack of polling (At least I believe that's the current behavior) 4. The user can unsubscribe, and then subscribe. In any of the scenarios above, I think we wouldn't want the member to actively send heartbeats to the GC. As the original intent of the membershipManager is to manage the state only when the member is in a group. However, due to the fact that the member may join/leave the group any time, I feel it might be sensible to always keep an instance active and introduce an inactive state such as `NOT_IN_GROUP` to indicate the member does not actively try to join a group. However, it confuses with `UNJOINED` a bit. I wonder if we should rename the states. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org