dongnuo123 commented on code in PR #15221:
URL: https://github.com/apache/kafka/pull/15221#discussion_r1458085202


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java:
##########
@@ -856,7 +899,8 @@ public boolean cleanupExpiredOffsets(String groupId, 
List<Record> records) {
         });
         metrics.record(OFFSET_EXPIRED_SENSOR_NAME, expiredPartitions.size());
 
-        return allOffsetsExpired.get();
+        // We don't want to remove the group if there are ongoing transactions.
+        return allOffsetsExpired.get() && 
!openTransactionsByGroup.containsKey(groupId);

Review Comment:
   Just want to understand here, if there are ongoing transactions, 
`hasPendingTransactionalOffsets(groupId, topic, partition)` will be true and 
`allOffsetsExpired` will be set to false in L888. Why 
`!openTransactionsByGroup.containsKey(groupId)` is needed?



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