Skip to content

Commit 4e9574a

Browse files
committed
fix
1 parent 81a2d88 commit 4e9574a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

store/src/main/java/org/apache/rocketmq/store/queue/ConsumeQueueStore.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ private void compensateForHA(ConcurrentMap<String, Long> cqOffsetTable) {
515515
}
516516
}
517517

518+
/**
519+
* @param loadAfterDestroy file version cq do not need reload, so ignore
520+
*/
518521
@Override
519522
public void destroy(boolean loadAfterDestroy) {
520523
for (ConcurrentMap<Integer, ConsumeQueueInterface> maps : this.consumeQueueTable.values()) {

store/src/main/java/org/apache/rocketmq/store/queue/RocksDBConsumeQueue.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public RocksDBConsumeQueue(final MessageStoreConfig messageStoreConfig,
4949
this.queueId = queueId;
5050
}
5151

52+
/**
53+
* Only used to pass parameters when calling the destroy method
54+
*
55+
* @see RocksDBConsumeQueueStore#destroy(ConsumeQueueInterface)
56+
*/
5257
public RocksDBConsumeQueue(final String topic, final int queueId) {
5358
this(null, null, topic, queueId);
5459
}

store/src/main/java/org/apache/rocketmq/store/queue/RocksDBConsumeQueueStore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,14 @@ public String getServiceName() {
574574
}
575575

576576
protected void deleteExpiredFiles() {
577-
578577
long minOffset = messageStore.getCommitLog().getMinOffset();
579578
if (minOffset > this.lastPhysicalMinOffset) {
580579
this.lastPhysicalMinOffset = minOffset;
581580

582581
boolean spaceFull = isSpaceToDelete();
583582
boolean timeUp = messageStore.isTimeToDelete();
584583
if (spaceFull || timeUp) {
584+
// To delete the CQ Units whose physical offset is smaller min physical offset in commitLog.
585585
cleanExpired(minOffset);
586586
}
587587

@@ -596,8 +596,8 @@ private boolean isSpaceToDelete() {
596596
.getStorePathConsumeQueue(messageStoreConfig.getStorePathRootDir());
597597
double logicsRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathLogics);
598598
if (logicsRatio > diskSpaceWarningLevelRatio) {
599-
boolean diskOk = messageStore.getRunningFlags().getAndMakeLogicDiskFull();
600-
if (diskOk) {
599+
boolean diskMaybeFull = messageStore.getRunningFlags().getAndMakeLogicDiskFull();
600+
if (diskMaybeFull) {
601601
log.error("logics disk maybe full soon " + logicsRatio + ", so mark disk full");
602602
}
603603
} else if (logicsRatio > diskSpaceCleanForciblyRatio) {

0 commit comments

Comments
 (0)