You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/03/28 02:52:30 UTC

[GitHub] [rocketmq] HScarb commented on issue #4042: The 'store.log' print inaccurate message

HScarb commented on issue #4042:
URL: https://github.com/apache/rocketmq/issues/4042#issuecomment-1080125126


   In your situation, disk space is above 75%, but lower than 85%, will delete expired files, but no files expired, so no files deleted.
   When CommitLog delete method is called but no files deleted, this log will be printed.
   `disk space will be full soon, but delete file failed.`
   reference: https://github.com/HScarb/knowledge/blob/master/rocketmq/RocketMQ_%E8%BF%87%E6%9C%9F%E6%96%87%E4%BB%B6%E5%88%A0%E9%99%A4%E6%9C%BA%E5%88%B6.md
   
   ```java
       // 满足下列条件之一将继续删除
       // 1. 到了设置的每天固定删除时间(4点)
       // 2. 磁盘空间不充足,默认为75%
       // 3. executeDeleteFilesManually方法被调用,手工删除文件
       if (timeup || spacefull || manualDelete) {
   
           if (manualDelete)
               this.manualDeleteFileSeveralTimes--;
   
           // 是否立即强制删除文件(磁盘空间大于85%为true)
           boolean cleanAtOnce = DefaultMessageStore.this.getMessageStoreConfig().isCleanFileForciblyEnable() && this.cleanImmediately;
   
           log.info("begin to delete before {} hours file. timeup: {} spacefull: {} manualDeleteFileSeveralTimes: {} cleanAtOnce: {}",
               fileReservedTime,
               timeup,
               spacefull,
               manualDeleteFileSeveralTimes,
               cleanAtOnce);
   
           // 文件保留时间,默认 72,这里转换成小时
           fileReservedTime *= 60 * 60 * 1000;
   
           // 删除成功的文件数量
           deleteCount = DefaultMessageStore.this.commitLog.deleteExpiredFile(fileReservedTime, deletePhysicFilesInterval,
               destroyMapedFileIntervalForcibly, cleanAtOnce);
           if (deleteCount > 0) {
           // 危险情况:磁盘满了,但是又无法删除文件
           } else if (spacefull) {
               log.warn("disk space will be full soon, but delete file failed.");
           }
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org