dajac commented on code in PR #15221:
URL: https://github.com/apache/kafka/pull/15221#discussion_r1462856785
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java:
##########
@@ -604,22 +602,23 @@ public CoordinatorResult<OffsetDeleteResponseData,
Record> deleteOffsets(
)
);
} else {
- final TimelineHashMap<Integer, OffsetAndMetadata>
offsetsByPartition = offsetsByTopic == null ?
- null : offsetsByTopic.get(topic.name());
- if (offsetsByPartition != null) {
- topic.partitions().forEach(partition -> {
- if
(offsetsByPartition.containsKey(partition.partitionIndex())) {
- responsePartitionCollection.add(new
OffsetDeleteResponseData.OffsetDeleteResponsePartition()
- .setPartitionIndex(partition.partitionIndex())
- );
-
records.add(RecordHelpers.newOffsetCommitTombstoneRecord(
- request.groupId(),
- topic.name(),
- partition.partitionIndex()
- ));
- }
- });
- }
+ topic.partitions().forEach(partition -> {
+ // We always add the partition to the response.
+ responsePartitionCollection.add(new
OffsetDeleteResponseData.OffsetDeleteResponsePartition()
+ .setPartitionIndex(partition.partitionIndex())
+ );
Review Comment:
This logic was wrong as the response must contain an entry for every
requested partition. I fixed it and adapted the tests.
--
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]