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 456bf2b86f0..f98e9a284aa 100644 --- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java +++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java @@ -580,7 +580,7 @@ public long getConfirmOffset() { return this.defaultMessageStore.getMaxPhyOffset(); } // First time it will compute the confirmOffset. - if (this.confirmOffset <= 0) { + if (this.confirmOffset < 0) { setConfirmOffset(((AutoSwitchHAService) this.defaultMessageStore.getHaService()).computeConfirmOffset()); log.info("Init the confirmOffset to {}.", this.confirmOffset); }