mingyen066 commented on code in PR #20040: URL: https://github.com/apache/kafka/pull/20040#discussion_r2173250668
########## coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeTest.java: ########## @@ -2940,6 +2942,135 @@ public void testAppendRecordBatchSize() { assertTrue(batchSize > MIN_BUFFER_SIZE && batchSize < maxBatchSize); } + @Test + public void testCoordinatorDoNotRetainLargeBuffer() { + MockTimer timer = new MockTimer(); + InMemoryPartitionWriter mockWriter = new InMemoryPartitionWriter(false) { + @Override + public LogConfig config(TopicPartition tp) { + var props = new Properties(); + props.put(TopicConfig.MAX_MESSAGE_BYTES_CONFIG, String.valueOf(1024 * 1024)); // 1MB + return new LogConfig(props); + } + + @Override + public long append( + TopicPartition tp, + VerificationGuard verificationGuard, + MemoryRecords batch + ) { + return super.append(tp, verificationGuard, batch); + } Review Comment: My mistake — I meant to use MockPartitionWriter, but after replacing it with InMemoryPartitionWriter, I forgot to clean it up. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org