BTM
  1. BTM
  2. BTM-22

Resource rollback not handled properly

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.0.1, 1.1, 1.2, 1.3
    • Fix Version/s: 1.3
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      If a resource rolls back for some reason (e.g. a timeout), XAResource.end() may throw any of XA_RB* or it may even completely drop the transaction and throw XAER_NOTA. Currently BTM completely ignores this and attempts to prepare and commit as normal anyway. While things generally end up correct because either prepare or commit (in the 1PC case) will also throw a XA_RB* or XA_HEUR* or XAER_NOTA, it leads to numerous other exceptions, often logged at level WARN.

      Attached is a patch that recognizes XA_RB* and XAER_NOTA from XAResource.end() and causes BTM to roll back in an orderly fashion. Note that for completeness sake XAResource.start() should have similar handling, but I was too lazy to implement that.

      For reference, this behaviour is documented in the X/Open spec on pages 37 ff (xa_end), page 62 (state tables), page 15 ("Rollback-Only", last two sentences), page 18 ("Unilateral RM Action"), and possibly elsewhere.

        Activity

        Hide
        Ludovic Orban added a comment -

        Interesting. I've seen this happening with Sybase ASE but didn't know exactly how to handle that until now, thanks for the clarification.

        I'll read the XA spec chapters you referenced, review your patch and try to get it merged in for 1.3.

        Show
        Ludovic Orban added a comment - Interesting. I've seen this happening with Sybase ASE but didn't know exactly how to handle that until now, thanks for the clarification. I'll read the XA spec chapters you referenced, review your patch and try to get it merged in for 1.3.
        Hide
        Ludovic Orban added a comment -

        Handling of resources unilaterally rolling back at delistment time is now implemented in trunk.

        You patch had most of the analysis done and the basic idea on how it should be implemented. However, I highly refactored the code to make it fit better the TM code base.

        Show
        Ludovic Orban added a comment - Handling of resources unilaterally rolling back at delistment time is now implemented in trunk. You patch had most of the analysis done and the basic idea on how it should be implemented. However, I highly refactored the code to make it fit better the TM code base.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Ronald Tschalär
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: