Skip to content

Commit 286557a

Browse files
authored
[ISSUE #9379] Set compact timestamp when timeStoreTable empty (#9419)
1 parent e1021ec commit 286557a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreService.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ private void recover() {
146146
this.createNewIndexFile(System.currentTimeMillis());
147147
}
148148

149-
if (!this.timeStoreTable.isEmpty()) {
149+
if (this.timeStoreTable.isEmpty()) {
150+
this.setCompactTimestamp(Long.MAX_VALUE);
151+
} else {
150152
this.currentWriteFile = this.timeStoreTable.lastEntry().getValue();
151153
this.setCompactTimestamp(this.timeStoreTable.firstKey() - 1);
152154
}
@@ -351,7 +353,7 @@ public void destroyExpiredFile(long expireTimestamp) {
351353
int tableSize = (int) timeStoreTable.entrySet().stream()
352354
.filter(entry -> IndexFile.IndexStatusEnum.UPLOAD.equals(entry.getValue().getFileStatus()))
353355
.count();
354-
log.info("IndexStoreService delete file, timestamp={}, remote={}, table={}, all={}",
356+
log.debug("IndexStoreService delete file, timestamp={}, remote={}, table={}, all={}",
355357
expireTimestamp, flatAppendFile.getFileSegmentList().size(), tableSize, timeStoreTable.size());
356358
} finally {
357359
readWriteLock.writeLock().unlock();
@@ -382,7 +384,7 @@ public void destroy() {
382384

383385
@Override
384386
public String getServiceName() {
385-
return IndexStoreService.class.getSimpleName();
387+
return IndexStoreService.class.getSimpleName() + "_" + this.storeConfig.getBrokerName();
386388
}
387389

388390
public void setCompactTimestamp(long timestamp) {

0 commit comments

Comments
 (0)