Skip to content

Commit

Permalink
[ISSUE apache#7585] Always return duplicate buffer when filter messag…
Browse files Browse the repository at this point in the history
…e and fix log format (apache#7654)
  • Loading branch information
lizhimins authored Dec 13, 2023
1 parent a376fbc commit 50a92a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.rocketmq.store.GetMessageStatus;
import org.apache.rocketmq.store.MessageFilter;
import org.apache.rocketmq.store.SelectMappedBufferResult;
import org.apache.rocketmq.tieredstore.util.MessageBufferUtil;

public class GetMessageResultExt extends GetMessageResult {

Expand Down Expand Up @@ -63,9 +62,9 @@ public GetMessageResult doFilterMessage(MessageFilter messageFilter) {
continue;
}

long offset = this.getMessageQueueOffset().get(i);
result.addMessage(new SelectMappedBufferResult(bufferResult.getStartOffset(),
bufferResult.getByteBuffer(), bufferResult.getSize(), null),
MessageBufferUtil.getQueueOffset(bufferResult.getByteBuffer()));
bufferResult.getByteBuffer().asReadOnlyBuffer(), bufferResult.getSize(), null), offset);
}

if (result.getBufferTotalSize() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public CompletableFuture<Boolean> commitAsync() {
if (fileSegmentInputStream != null) {
long fileSize = this.getSize();
if (fileSize == -1L) {
logger.error("Get commit position error before commit, Commit: %d, Expect: %d, Current Max: %d, FileName: %s",
logger.error("Get commit position error before commit, Commit: {}, Expect: {}, Current Max: {}, FileName: {}",
commitPosition, commitPosition + fileSegmentInputStream.getContentLength(), appendPosition, getPath());
releaseCommitLock();
return CompletableFuture.completedFuture(false);
Expand Down

0 comments on commit 50a92a2

Please sign in to comment.