vvcephei commented on a change in pull request #9836: URL: https://github.com/apache/kafka/pull/9836#discussion_r561967937
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/MockConsumer.java ########## @@ -218,7 +218,21 @@ public synchronized void unsubscribe() { } toClear.forEach(p -> this.records.remove(p)); - return new ConsumerRecords<>(results); + + final Map<TopicPartition, ConsumerRecords.Metadata> metadata = new HashMap<>(); + for (final TopicPartition partition : subscriptions.assignedPartitions()) { + if (subscriptions.hasValidPosition(partition) && beginningOffsets.containsKey(partition) && endOffsets.containsKey(partition)) { Review comment: Ah, this is from before I removed it. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org