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

MappedFileQueue#flush should return true when flushing is successful

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Later
    • Affects Version/s: 4.0.0-incubating
    • Fix Version/s: 4.2.0
    • Component/s: rocketmq-store
    • Labels:
      None

      Description

      In the current implementation, MappedFileQueue#flush returns false when flushing is successful.
      This is not intuitive and error prone.

      For instance, in CommitLog#run line:915-918

      for (int i = 0; i < RETRY_TIMES_OVER && !result; i++) {
         result = CommitLog.this.mappedFileQueue.flush(0);
         // ...
      }
      

      I believe retries has to be done when flushing is not successful. But with the code above, it can try to flush only once on CommitLog termination and not continue retrying.

      The same is for DefaultMessageStore#doFlush line:1551

      Or is this not retry on failure, but the number of times flushing has to be done? Then, RETRY_TIMES_OVER should be renamed to something like FLUSH_NUM.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                roman_s Roman Shtykh
                Reporter:
                roman_s Roman Shtykh
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: