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

KahaDB bug that skips doing a sync on recoveryFile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.11.0
    • Message Store
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: