This is an automated email from the ASF dual-hosted git repository.

lizhimin 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 286557a204 [ISSUE #9379] Set compact timestamp when timeStoreTable 
empty (#9419)
286557a204 is described below

commit 286557a2042d11e0329c93bd08337cffdbdd96a0
Author: lizhimins <[email protected]>
AuthorDate: Wed May 21 17:25:19 2025 +0800

    [ISSUE #9379] Set compact timestamp when timeStoreTable empty (#9419)
---
 .../org/apache/rocketmq/tieredstore/index/IndexStoreService.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreService.java
 
b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreService.java
index f4f602a105..00566d6872 100644
--- 
a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreService.java
+++ 
b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreService.java
@@ -146,7 +146,9 @@ public class IndexStoreService extends ServiceThread 
implements IndexService {
             this.createNewIndexFile(System.currentTimeMillis());
         }
 
-        if (!this.timeStoreTable.isEmpty()) {
+        if (this.timeStoreTable.isEmpty()) {
+            this.setCompactTimestamp(Long.MAX_VALUE);
+        } else {
             this.currentWriteFile = this.timeStoreTable.lastEntry().getValue();
             this.setCompactTimestamp(this.timeStoreTable.firstKey() - 1);
         }
@@ -351,7 +353,7 @@ public class IndexStoreService extends ServiceThread 
implements IndexService {
             int tableSize = (int) timeStoreTable.entrySet().stream()
                 .filter(entry -> 
IndexFile.IndexStatusEnum.UPLOAD.equals(entry.getValue().getFileStatus()))
                 .count();
-            log.info("IndexStoreService delete file, timestamp={}, remote={}, 
table={}, all={}",
+            log.debug("IndexStoreService delete file, timestamp={}, remote={}, 
table={}, all={}",
                 expireTimestamp, flatAppendFile.getFileSegmentList().size(), 
tableSize, timeStoreTable.size());
         } finally {
             readWriteLock.writeLock().unlock();
@@ -382,7 +384,7 @@ public class IndexStoreService extends ServiceThread 
implements IndexService {
 
     @Override
     public String getServiceName() {
-        return IndexStoreService.class.getSimpleName();
+        return IndexStoreService.class.getSimpleName() + "_" + 
this.storeConfig.getBrokerName();
     }
 
     public void setCompactTimestamp(long timestamp) {

Reply via email to