diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java index 378518d249d..7cf97465512 100644 --- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java +++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java @@ -2179,7 +2179,9 @@ public void handleDiskFlush(AppendMessageResult result, PutMessageResult putMess // Asynchronous flush else { if (!CommitLog.this.defaultMessageStore.isTransientStorePoolEnable()) { - flushCommitLogService.wakeup(); + if (defaultMessageStore.getMessageStoreConfig().isWakeFlushWhenPutMessage()) { + flushCommitLogService.wakeup(); + } } else { if (defaultMessageStore.getMessageStoreConfig().isWakeCommitWhenPutMessage()) { commitRealTimeService.wakeup(); @@ -2206,9 +2208,13 @@ public CompletableFuture handleDiskFlush(AppendMessageResult r // Asynchronous flush else { if (!CommitLog.this.defaultMessageStore.isTransientStorePoolEnable()) { - flushCommitLogService.wakeup(); + if (defaultMessageStore.getMessageStoreConfig().isWakeFlushWhenPutMessage()) { + flushCommitLogService.wakeup(); + } } else { - commitRealTimeService.wakeup(); + if (defaultMessageStore.getMessageStoreConfig().isWakeCommitWhenPutMessage()) { + commitRealTimeService.wakeup(); + } } return CompletableFuture.completedFuture(PutMessageStatus.PUT_OK); }