On 03/11/2011 04:37 PM, Mircea Markus wrote:
Hi Jonathan,
We're thinking to implement the following optimisation around recovery and want to
run it by you first.
As discussed, XAResource.recover broadcasts a call to all cluster members, and all the
prepared transactions initiated by this node's TM would be returned from this method.
What we are thinking is the following: only perform the broadcast once, the first time
XARespurce.recover is called. After that keep track of the prepared tx that originated on
the same node, and return this list only *without* doing the broadcast.
Do you see any problem this approach?
It's valid only if all nodes responded to the initial broadcast. In
other cases there may be outstanding tx you never learn about.
One more (unrelated) question: how does a TM determine that a tx
pertains to it or not. Based on Xid's branch identifier perhaps?
The TM constructs Xids that embed a (hopefully) uniq node id. By default
the recovery system only processes Xids that match.
We might do some further optimisations based on this.
tricky, as you don't know the Xid format, or which TM you are talking to
on any given recover call.
Jonathan.
--
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA), Matt Parsons
(USA) and Brendan Lane (Ireland).