gabriellefu commented on code in PR #23165:
URL: https://github.com/apache/kafka/pull/23165#discussion_r4187681909
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -6388,17 +6386,16 @@ public void replay(
streamsGroup.setStoredDescriptionTopologyEpoch(value.storedDescriptionTopologyEpoch());
streamsGroup.setFailedDescriptionTopologyEpoch(value.failedDescriptionTopologyEpoch());
- if (value.lastAssignmentConfigs() != null) {
- streamsGroup.setLastAssignmentConfigs(
- value.lastAssignmentConfigs().stream()
- .collect(Collectors.toMap(
-
StreamsGroupMetadataValue.LastAssignmentConfig::key,
-
StreamsGroupMetadataValue.LastAssignmentConfig::value
- ))
- );
- } else {
- streamsGroup.setLastAssignmentConfigs(Map.of());
- }
+ // A record without configs (written before they were persisted)
yields the defaults, so the next
+ // heartbeat only rebalances the group if any effective config
differs from its default.
+ Map<String, String> lastAssignmentConfigs =
value.lastAssignmentConfigs() == null
+ ? Map.of()
+ : value.lastAssignmentConfigs().stream()
+ .collect(Collectors.toMap(
+ StreamsGroupMetadataValue.LastAssignmentConfig::key,
+ StreamsGroupMetadataValue.LastAssignmentConfig::value
+ ));
+
streamsGroup.setLastAssignmentConfigs(AssignmentConfigsImpl.fromMap(lastAssignmentConfigs));
Review Comment:
sure, I can update my pr accordingly
--
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]