RocketMQ报错提示logics disk maybe full soon, so reclaim space, -1.0

Posted 帷幄庸者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RocketMQ报错提示logics disk maybe full soon, so reclaim space, -1.0相关的知识,希望对你有一定的参考价值。

异常信息:

disk space will be full soon, but delete file failed.
logics disk maybe full soon, so reclaim space, -1.0
begin to delete before 72 hours file. timeup: false spacefull: true manualDeleteFileSeveralTimes: 0 cleanAtOnce: false

注意:这个问题并不是说明磁盘空间不够,而是因为可能在检验中出现异常。

核心代码

参看RocketMQ源码:UtilAll、DefaultMessageStore

public static double getDiskPartitionSpaceUsedPercent(final String path) 
        if (null == path || path.isEmpty()) 
            log.error("Error when measuring disk space usage, path is null or empty, path : ", path);
            return -1;
        


        try 
            File file = new File(path);

            if (!file.exists()) 
                log.error("Error when measuring disk space usage, file doesn't exist on this path: ", path);
                return -1;
            


            long totalSpace = file.getTotalSpace();

            if (totalSpace > 0) 
                long freeSpace = file.getFreeSpace();
                long usedSpace = totalSpace - freeSpace;

                return usedSpace / (double) totalSpace;
            
         catch (Exception e) 
            log.error("Error when measuring disk space usage, got exception: :", e);            return -1;
        

        return -1;
    

解释:so reclaim space, -1.0,这里的-1是在上面方法校验中返回的,有如下异常情况可能:

  • commitlog、consumequeue的变量不存在或者为空、或者consumequeue、commitlog文件实际不存在
  • 或者在磁盘校验比对空间剩余大小出现异常情况
  • 或者totalSpace计算出来<0的异常情况

正常是返回目前磁盘剩余空间的比例

参考:http://www.lpnote.com/2019/01/04/solve-a-disk-warning-illusion-caused-by-rocketmq/

以上是关于RocketMQ报错提示logics disk maybe full soon, so reclaim space, -1.0的主要内容,如果未能解决你的问题,请参考以下文章

RocketMQ迁移

VMware提示模块Disk启动失败,未能启动虚拟机

i春秋——“百度杯”CTF比赛 十月场——Vld(Vulcan Logic Dumper php opcodesql 报错注入)

Windows启动RocketMq报错:Unrecognized VM option ‘UseCMSCompactAtFullCollection‘

Windows启动RocketMq报错:Unrecognized VM option ‘UseCMSCompactAtFullCollection‘

Windows启动RocketMq报错:Unrecognized VM option ‘UseCMSCompactAtFullCollection‘