squah-confluent commented on code in PR #19495: URL: https://github.com/apache/kafka/pull/19495#discussion_r2047494613
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java: ########## @@ -256,7 +263,7 @@ private OffsetAndMetadata remove( if (partitionOffsets.isEmpty()) topicOffsets.remove(topic); - if (topicOffsets.isEmpty()) + if (!preserveGroups && topicOffsets.isEmpty()) offsetsByGroup.remove(groupId); Review Comment: We use `offsetsByGroup` to clean up the list of open transactions per group. https://github.com/apache/kafka/blob/6e26ec06bb895ff236cf1a402827d95e8d3c8c4d/group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java#L1046-L1054 If we do not maintain an entry here, the clean up will not happen. Later, we will not delete the group when we expire its last offset. https://github.com/apache/kafka/blob/6e26ec06bb895ff236cf1a402827d95e8d3c8c4d/group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java#L887-L888 -- 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