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

KahaDB data files containing acknowledgements are deleted during cleanup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.10.0, 5.10.1
    • 5.11.1, 5.12.0
    • Message Store
    • None

    Description

      AMQ-2832 was not fixed cleanly.
      The commit dd68c61e65f24b7dc498b36e34960a4bc46ded4b by Gary from 8.10.2010 introduced a problem by deleting too many files.

      Scenarios we are facing currently in production:
      Data file #1 contains unconsumed messages sitting in a DLQ. So this file is not a cleanup candidate.
      The next file #2 contains acks of some messages from file #1. This file is not a cleanup candidate (because of ackMessageFileMap logic).
      The next file #3 contains acks of some messages from file #2. And this file is deleted during the cleanup procedure. So on Broker restart all messages from #2, whose acks were from the deleted file #3, are replayed!
      The reason is gcCandidates variable, which is a copy of gcCandidateSet (see MessageDatabase#checkpointUpdate at the end of the method - org/apache/activemq/store/kahadb/MessageDatabase.java:1659 on 5.10.0 tag). So when a candidate is deleted from gcCandidateSet (org/apache/activemq/store/kahadb/MessageDatabase.java:1668 on 5.10.0 tag), gcCandidates still contains that candidate and the comparison on org/apache/activemq/store/kahadb/MessageDatabase.java:1666 works wrong!
      I will try to adjust AMQ2832Test.

      Attachments

        1. AMQ-5542.patch
          2 kB
          Sergiy Barlabanov
        2. AdjustedAMQ2832Test.patch
          3 kB
          Sergiy Barlabanov

        Issue Links

          Activity

            People

              gtully Gary Tully
              barlabanov Sergiy Barlabanov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: