1 2 3 Previous Next 35 Replies Latest reply on Sep 28, 2009 9:11 AM by jmesnil Go to original post
      • 30. Re: XA resource and setting the timeout
        ataylor

        ignore my last post, what i meant was

        Better to store create time rather than expire time. That allows for the user to dynamically change timeout value.

        ok

        • 31. Re: XA resource and setting the timeout
          timfox

           

          "jhalliday" wrote:
          > You're saying we should only timeout unprepared txs? If so, why?

          Let's go back to my quote from the XA spec:

          "An RM can mark a transaction branch as rollback-only any time except after a successful prepare. ...An RM can also unilaterally roll back and forget a branch any time except after a successful prepare."

          Timeouts allow an RM to walk away from an unprepared tx that it thinks may have been abandoned. It's useful to cover e.g. client crashes. It does not lead to an inconsistent tx outcome since the tx is presumed abort at that stage anyhow.

          Unilaterally deciding to rollback a prepared branch is a much bigger deal as it can lead to heuristics. It can be done, but needs a lot more thought and logging.


          OK that makes life simpler - no need to store any create time, and in the scan we only consider non prepared txs


          Personally I'd avoid automating post-prepare rollbacks and instead provide a tool that admins can use to manually force a tx outcome. Since it may lead to data inconsistency it's not a decision to be made lightly and the best course of action usually needs some understanding of the business context e.g. in some cases it's better to stay blocked for consistency, whilst in others availability concerns may make a rollback+manual data reconciliation a more attractive option.


          We can add this to our management interface

          Thx

          • 32. Re: XA resource and setting the timeout
            timfox
            • 33. Re: XA resource and setting the timeout
              jmesnil

              to sum up,

              We return false from setTransactionTimeout and use our own tx timeout handler
              We only rollback non-prepared tx when they timed out (with a default tx timeout of 5 mins)
              A prepared tx will *not* be checked for timeout. It is up to the admin to decide a heuristic completion
              (we offer management operations to commit/rollback a prepared tx).

              Related to this, XAResource.recover() javadoc specifies to return prepared tx *and* heuristically
              completed tx.
              Currently, we return only the prepared tx.
              Once [link]https://jira.jboss.org/jira/browse/HORNETQ-33[/link] is fixed, we will be able to return the heuristically completed tx.
              I'm curious to know how the TM will handle the heuristically completed tx returned by recover()...

              • 34. Re: XA resource and setting the timeout
                timfox

                Can we have this debate on the HornetQ dev forum, not the JBM dev forum?

                • 35. Re: XA resource and setting the timeout
                  jmesnil

                  posted on the wrong forum. Thread will continue on HornetQ dev forum: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257357#4257357

                  1 2 3 Previous Next