Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-45

Delete consume queue hang file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1.0-incubating
    • 4.0.0-incubating
    • rocketmq-store
    • None

    Description

      Consume queue file may hang and stop further deleting under concurrent scenario.

      If the consume queue file is concurrently held by another thread, mappedFile.destroy(interval) will only set firstShutdownTimestamp to current timestamp and available false, then return false directly.
      Check MappedFileQueue.java#deleteExpiredFileByOffset,

      if (destroy && mappedFile.destroy(1000 * 60)) {
      files.add(mappedFile);
      deleteCount++;
      } else {
      break;
      }
      the current round of deletion will be stopped and current mapped file becomes handed.

      Next time trying to delete mapped file of this mapped file queue, MappedFileQueue.java#deleteExpiredFileByOffset(offset, unitSize) line No.390
      MappedFile mappedFile = (MappedFile) mfs[i];
      SelectMappedBufferResult result = mappedFile.selectMappedBuffer(this.mappedFileSize - unitSize);
      will always return null as the mapped file is no longer available and cannot hold. Current implementation will only log a warn and exit.

      Attachments

        Issue Links

          Activity

            People

              yukon Xinyu Zhou
              lizhanhui Zhanhui Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified