From dab96d716f32796223fbef2b9b2674a81e8819a5 Mon Sep 17 00:00:00 2001 From: Yu Ning <78631860+Chillax-0v0@users.noreply.github.com> Date: Thu, 28 Nov 2024 09:56:38 +0800 Subject: [PATCH] fix: use the "adjusted" `maxSize` in `ElasticLogSegment#readAsync` (#2184) Signed-off-by: Ning Yu --- .../main/scala/kafka/log/streamaspect/ElasticLogSegment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/kafka/log/streamaspect/ElasticLogSegment.java b/core/src/main/scala/kafka/log/streamaspect/ElasticLogSegment.java index 543d31d905..308e8981b5 100644 --- a/core/src/main/scala/kafka/log/streamaspect/ElasticLogSegment.java +++ b/core/src/main/scala/kafka/log/streamaspect/ElasticLogSegment.java @@ -275,7 +275,7 @@ public CompletableFuture readAsync(long startOffset, int maxSize, return CompletableFuture.completedFuture(new FetchDataInfo(offsetMetadata, MemoryRecords.EMPTY)); } - return log.read(startOffset, maxOffset, maxSize) + return log.read(startOffset, maxOffset, adjustedMaxSize) .thenApply(records -> new FetchDataInfo(offsetMetadata, records)); }