Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.0-incubating
    • Fix Version/s: 4.0.0-incubating
    • Component/s: rocketmq-store
    • Labels:
      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

              • Assignee:
                Yukon yukon
                Reporter:
                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