Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-1421

Broker starts on corrupted kahadb despite checkForCorruptJournalFiles="true" and ignoreMissingJournalfiles="false"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.3
    • JBoss A-MQ 6.2
    • kahadb
    • Hide
      • Start A-MQ with above kahadb configuration
      • Connect to Karaf shell
      • Run
        activemq:producer --user admin --password admin --messageSize 400 --messageCount 1 --destination testQ
        
      • Stop broker
      • Open kahadb/db-1.log journal file in hex editor and change one or more bytes of the content of the one message residing in the journal. Save the change.
      • rm kahadb/db.data and rm kahadb/db.redo. Alternatively run echo "XXX" > kahadb/db.data.
      • Start the broker. It will log the corrupted journal entry but fully start up! This is an error as due to the kahadb config it should not start up.
      • Query the queueSize of testQ, it contains 0 messages. The corrupted message was skipped.
      Show
      Start A-MQ with above kahadb configuration Connect to Karaf shell Run activemq:producer --user admin --password admin --messageSize 400 --messageCount 1 --destination testQ Stop broker Open kahadb/db-1.log journal file in hex editor and change one or more bytes of the content of the one message residing in the journal. Save the change. rm kahadb/db.data and rm kahadb/db.redo. Alternatively run echo "XXX" > kahadb/db.data. Start the broker. It will log the corrupted journal entry but fully start up! This is an error as due to the kahadb config it should not start up. Query the queueSize of testQ, it contains 0 messages. The corrupted message was skipped.

    Description

      ActiveMQ is configured for

      <persistenceAdapter>
        <kahaDB directory="/Volumes/SDCARD/kahadb"
          checkForCorruptJournalFiles="true"
          checksumJournalFiles="true"
          ignoreMissingJournalfiles="false"
          />
      </persistenceAdapter>
      

      If a journal record gets corrupted (e.g. an unconsumed message) and if the index also gets corrupted, the broker will restart without raising errors.
      It logs the corrupted records at INFO level as in

      Corrupt journal records found in '/tmp/kahadb/db-1.log' between offsets: 594..13262
      

      but fully starts up thereafter. Due to ignoreMissingJournalFiles=false it should raise an error and exit.

      If only the journal record of an unconsumed message gets corrupted but the index remains valid, the broker will correctly refuse to start but raise

      Failed to start Apache ActiveMQ ([amq, null], java.io.IOException: Detected missing/corrupt journal files. 1 messages affected.)
      

      Attachments

        Issue Links

          Activity

            People

              gtully@redhat.com Gary Tully
              rhn-support-tmielke Torsten Mielke
              Michal Toth Michal Toth
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: