lucasbru commented on code in PR #22622:
URL: https://github.com/apache/kafka/pull/22622#discussion_r3467062280
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java:
##########
@@ -1054,15 +1109,15 @@ public CoordinatorResult<OffsetDeleteResponseData,
CoordinatorRecord> deleteOffs
*/
public CoordinatorResult<Void, CoordinatorRecord> cleanupGroupMetadata() {
long startMs = time.milliseconds();
+ boolean topologyPluginConfigured =
config.isStreamsGroupTopologyDescriptionPluginConfigured();
List<CoordinatorRecord> records = new ArrayList<>();
groupMetadataManager.groupIds().forEach(groupId -> {
Group group = groupMetadataManager.group(groupId);
- if (group.shouldExpire()) {
- boolean allOffsetsExpired =
offsetMetadataManager.cleanupExpiredOffsets(groupId, records);
- if (allOffsetsExpired) {
- groupMetadataManager.maybeDeleteGroup(groupId, records);
- }
- }
+ if (!group.shouldExpire()) return;
+ boolean allOffsetsExpired =
offsetMetadataManager.cleanupExpiredOffsets(groupId, records);
+ if (!allOffsetsExpired) return;
+ if
(deferStreamsGroupTombstoneForPluginCleanup(topologyPluginConfigured, group))
return;
Review Comment:
Yeah we debated this. The problem is that we need to disable it based on
whether the plugin is defined in the `config`. The alternative would have been
to give `StreamsGroup` or `shouldExpire` a copy of the config. We chose to go
for this instead.
--
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]