You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2025/12/24 01:31:48 UTC
(rocketmq) branch develop updated: Fix epoch truncate (#9942)
This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 5132258db9 Fix epoch truncate (#9942)
5132258db9 is described below
commit 5132258db946e9741550c5d1076d605f60a1f2e3
Author: littleboy <zh...@harmonycloud.cn>
AuthorDate: Wed Dec 24 09:31:42 2025 +0800
Fix epoch truncate (#9942)
---
.../apache/rocketmq/store/ha/autoswitch/AutoSwitchHAClient.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/store/src/main/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHAClient.java b/store/src/main/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHAClient.java
index 176c25a96f..3dd14f4e35 100644
--- a/store/src/main/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHAClient.java
+++ b/store/src/main/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHAClient.java
@@ -463,8 +463,11 @@ public class AutoSwitchHAClient extends ServiceThread implements HAClient {
LOGGER.error("Failed to truncate slave log to {}", truncateOffset);
return false;
}
- this.epochCache.truncateSuffixByOffset(truncateOffset);
- LOGGER.info("Truncate slave log to {} success, change to transfer state", truncateOffset);
+ final long maxPhyOffset = this.messageStore.getMaxPhyOffset();
+ if (truncateOffset < maxPhyOffset) {
+ this.epochCache.truncateSuffixByOffset(truncateOffset);
+ LOGGER.info("Truncate slave log to {} success, change to transfer state", truncateOffset);
+ }
changeCurrentState(HAConnectionState.TRANSFER);
this.currentReportedOffset = truncateOffset;
}