Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-5444

KahaDB bug that skips doing a sync on recoveryFile

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.11.0
    • Component/s: Message Store
    • Labels:
      None

      Description

      There appears to be a bug in the KahaDB PageFile.java class when attempting to sync files to disk. If the "enableDiskSyncs" option is set to true, it looks like the code is intending to sync the recoveryFile and the writeFile. However, it accidentally syncs the writeFile twice and fails to sync the recoveryFile. In the method below, see the if statement towards the bottom that checks the enableDiskSyncs boolean to see the problem:

      private void writeBatch() throws IOException {
      ...
      if (enableDiskSyncs) {
      // Sync to make sure recovery buffer writes land on disk..
      if (enableRecoveryFile)

      { writeFile.sync(); // This should not be writeFile.sync!!!!!! }

      writeFile.sync();
      }
      ...

      The code above should have a recoveryFile.sync() on the line with the comment.

        Attachments

          Activity

            People

            • Assignee:
              tabish Timothy A. Bish
              Reporter:
              jfugitt Jesse Fugitt
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: