Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-6372

RecoveryImpl completing in-progress transactions, XidFactoryImpl needs to be smarter with matching

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2
    • None
    • transaction manager
    • Security Level: public (Regular issues)
    • None
    • Aries, OSGI, camel, activemq

    • Patch Available

    Description

      Given a camel route with from("activemq:a").to("activemq:b") in a Geronimo managed XA transaction. On start/restart new transactions are created in parallel with recovery of the jms components.
      There are two issues:

      • The Recovery processing can match new transactions through the XidFactory.matchXX methods and rollback new work in error. (Note: a xa_recover of activemq correctly returns all prepared transactions)
      • The XidFactoryImpl(byte[] seed) can create duplicate xids which could potentially interfere with recovering transactions and makes it impossible to determine from the logs what is going on.

      Xids should be globally unique and recoverable. So they need a persistent unique seed (provided through configuration) and an ever increasing id.
      The current time provides a simple approach to an increasing id that negates the need to persist the last used id in the transaction recovery log.
      (It has the downside of regressing if the XidFactory is recreated in the same millisecond, but I think this is in practice improbable outside unit tests.)

      If the id component is keyed of the epoch, a recovering XidFactory can match only old Xids, ones created by it in a previous incarnation. In this way it can avoid completing newly created transactions.

      Attachments

        1. GERONIMO-6372.patch
          15 kB
          Gary Tully

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              gtully Gary Tully
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: