You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@river.apache.org by Mark Brouwer <ma...@cheiron.org> on 2007/07/10 12:46:25 UTC
Mahalo and Txn Spec question
I'm implementing durable transaction participation as part of Seven and
due to my reading of the spec I have a question related to TX.2.3
"Joining a Transaction". It states in the 4th paragraph "When a manager
receives a join request, it checks to see if the participant has already
joined the transaction. If it has, and the crash count is the same as
the one specified in the original join, the join is accepted but is
otherwise ignored. If the crash count is different, the manager throws
CrashCountException and forces the transaction to abort."
However when I look into the code of Mahalo I can see when rejoining a
transaction with a different crash count that CrashCountException is
thrown, but I can't see where Mahalo forces the transaction to abort,
which based on my interpretation of the spec seems to be required. Is my
interpretation wrong or is there a bug in Mahalo (or the code I seem to
miss).
Also I assume that when a transaction manager service drives the
transaction to abort a transaction manager should skip the transaction
participant for which the rejoin failed due to the crash count exception?
--
Mark
Re: Mahalo and Txn Spec question
Posted by Mark Brouwer <ma...@cheiron.org>.
Robert Resendes wrote:
>> I'm happy if you file this issue in JIRA.
> OK.
Thanks.
>> Another question I have with regard to Mahalo is what happens if it
>> receives an indefinite RemoteException (such as ConnectException). I
>> found some language with regard to retries (5?) but I couldn't find the
>> retry logic, intervals between retries, etc. Can you help me out here
>> Robert what happens?
>> --
> For this specific case (i.e. abort on the participant) or in general? If
> it's the latter, then it will be a long discussion.
In general. As you might have understood from my postings on
"Controlling the object identification layer implementation" I'm trying
to come up with support for evolving persistent services that might go
off-line for maintenance purposes.
I believe a transaction manager service might be the right beast to
see how my ideas would work in practice as it is one of those services
that are a typical example not everything can be implemented as a
transient/replaceable service. I already have a clone of Mahalo where I
could start with experimentation. Also while implementing persistent
transaction participation support in Seven I try to think of how e.g.
the 2 new exceptions could be utilized when the 'transaction manager'
would throw OfflineException and ObjectIncompatibleException. Therefore
I like to learn more about how Mahalo does what it does, or should do
(?). I know I could dive into the code as I've done in the past when
implementing named transactions
(http://www.cheiron.org/utils/release/v0.2/api/org/cheiron/transaction/server/TransactionManagerX.html
[1]),
but I can remember I got lost often so some general info would be really
helpful.
Also currently when a service that utilizes persistent transaction
participation comes up and the local transaction participants have not
yet rejoined the actual transaction a ConnectException is thrown from
the container provided logic that acts as the transaction participant
proxy. The service when it initializes can obtain all the 'unconnected'
transactions for which it should provide a local transaction
participant and rejoins to be able to participate. I was wondering how
Mahalo would deal with these ConnectExceptions. From the code I was able
to digest that it ain't considered a definite exception, but I was not
sure for how long that is considered the case.
One part I still have to code in Seven is the logic that will call
getState() on the transaction manager service when it has been a while
that prepare has been called by the transaction manager on the
transaction participant. This code will also benefit from the 2 new
exceptions to make it more robust and accurate.
Given the fact that Mahalo is AFAIK the only public free transaction
manager service it would be handy to understand more of its retry
strategy. Although I have cloned it, but I want to keep its logic as
much as possible in sync with the River based version.
[1] I don't know whether there is interest to see this rolled into
River, but for me named transactions was a valuable enhancement to the
transactions specs to have a mutex service.
--
Mark
Re: Mahalo and Txn Spec question
Posted by Robert Resendes <Ro...@Sun.COM>.
Mark Brouwer wrote:
> Robert Resendes wrote:
>> Mark Brouwer wrote:
>>>
>>> However when I look into the code of Mahalo I can see when rejoining a
>>> transaction with a different crash count that CrashCountException is
>>> thrown, but I can't see where Mahalo forces the transaction to abort,
>>> which based on my interpretation of the spec seems to be required. Is my
>>> interpretation wrong or is there a bug in Mahalo (or the code I seem to
>>> miss).
>> I think your interpretation and analysis are correct from a quick look
>> at the code. Do you want to file the bug/issue or should I?
>
> Hi Robert,
>
> I'm happy if you file this issue in JIRA.
OK.
>
>>> Also I assume that when a transaction manager service drives the
>>> transaction to abort a transaction manager should skip the transaction
>>> participant for which the rejoin failed due to the crash count
>>> exception?
>
>> The participant should assume an "abort" upon receiving
>> CrashCountException (although I don't see that explicitly stated
>> anywhere). Even if it doesn't receive the exception (e.g. due to
>> network issues), it can check (via getState()) on the status of any
>> outstanding transactions it's managing. So, in either case, the
>> participant should be able to figure out that it needs to drop out of
>> the transaction.
>>
>> That said, trying to call abort() on the "inconsistent" participant
>> might short circuit the getState() call (above). So, for that case, it
>> could be seen as an optimization if you do make the abort call. [I'm
>> assuming that releasing resources (early) for a transaction is worth
>> the extra cost of a remote call, here, and that this scenario is not
>> the norm within your system.]
>
> I doubt the above is completely clear to me so in my own words and
> assuming Mahalo as implementation. Say we have 2 participants A & B that
> joined transaction T. A crashes and recovers and it is aware of T having
> joined although it lost its state related to the transaction and
> therefore wants to notify the transaction manager service with a
> different crash count that it must abort the transaction.
>
> So A 'rejoins' the transaction manager service with a different crash
> count. The transaction manager service throws CrashCountException and
> (Mahalo doesn't do it due to a bug) should move the transaction into the
> aborted state. At that point it will call abort on transaction
> participant B, it skips the registered transaction participant A,
> because that one is inconsistent (and will likely to fail) and
> transaction participant A can infer from the CrashCountException that
> the transaction has been aborted. If the exception gets lost due to a
> RemoteException it can find out later with a call to getState().
>
I think that's the same idea I was trying to get across.
>
> Another question I have with regard to Mahalo is what happens if it
> receives an indefinite RemoteException (such as ConnectException). I
> found some language with regard to retries (5?) but I couldn't find the
> retry logic, intervals between retries, etc. Can you help me out here
> Robert what happens?
> --
For this specific case (i.e. abort on the participant) or in general? If
it's the latter, then it will be a long discussion.
Bob
Re: Mahalo and Txn Spec question
Posted by Mark Brouwer <ma...@cheiron.org>.
Robert Resendes wrote:
> Mark Brouwer wrote:
>>
>> However when I look into the code of Mahalo I can see when rejoining a
>> transaction with a different crash count that CrashCountException is
>> thrown, but I can't see where Mahalo forces the transaction to abort,
>> which based on my interpretation of the spec seems to be required. Is my
>> interpretation wrong or is there a bug in Mahalo (or the code I seem to
>> miss).
> I think your interpretation and analysis are correct from a quick look
> at the code. Do you want to file the bug/issue or should I?
Hi Robert,
I'm happy if you file this issue in JIRA.
>> Also I assume that when a transaction manager service drives the
>> transaction to abort a transaction manager should skip the transaction
>> participant for which the rejoin failed due to the crash count exception?
> The participant should assume an "abort" upon receiving
> CrashCountException (although I don't see that explicitly stated
> anywhere). Even if it doesn't receive the exception (e.g. due to network
> issues), it can check (via getState()) on the status of any outstanding
> transactions it's managing. So, in either case, the participant should
> be able to figure out that it needs to drop out of the transaction.
>
> That said, trying to call abort() on the "inconsistent" participant
> might short circuit the getState() call (above). So, for that case, it
> could be seen as an optimization if you do make the abort call. [I'm
> assuming that releasing resources (early) for a transaction is worth the
> extra cost of a remote call, here, and that this scenario is not the
> norm within your system.]
I doubt the above is completely clear to me so in my own words and
assuming Mahalo as implementation. Say we have 2 participants A & B that
joined transaction T. A crashes and recovers and it is aware of T having
joined although it lost its state related to the transaction and
therefore wants to notify the transaction manager service with a
different crash count that it must abort the transaction.
So A 'rejoins' the transaction manager service with a different crash
count. The transaction manager service throws CrashCountException and
(Mahalo doesn't do it due to a bug) should move the transaction into the
aborted state. At that point it will call abort on transaction
participant B, it skips the registered transaction participant A,
because that one is inconsistent (and will likely to fail) and
transaction participant A can infer from the CrashCountException that
the transaction has been aborted. If the exception gets lost due to a
RemoteException it can find out later with a call to getState().
Another question I have with regard to Mahalo is what happens if it
receives an indefinite RemoteException (such as ConnectException). I
found some language with regard to retries (5?) but I couldn't find the
retry logic, intervals between retries, etc. Can you help me out here
Robert what happens?
--
Mark
Re: Mahalo and Txn Spec question
Posted by Robert Resendes <Ro...@Sun.COM>.
Mark Brouwer wrote:
>
> However when I look into the code of Mahalo I can see when rejoining a
> transaction with a different crash count that CrashCountException is
> thrown, but I can't see where Mahalo forces the transaction to abort,
> which based on my interpretation of the spec seems to be required. Is my
> interpretation wrong or is there a bug in Mahalo (or the code I seem to
> miss).
I think your interpretation and analysis are correct from a quick look
at the code. Do you want to file the bug/issue or should I?
>
> Also I assume that when a transaction manager service drives the
> transaction to abort a transaction manager should skip the transaction
> participant for which the rejoin failed due to the crash count exception?
The participant should assume an "abort" upon receiving
CrashCountException (although I don't see that explicitly stated
anywhere). Even if it doesn't receive the exception (e.g. due to network
issues), it can check (via getState()) on the status of any outstanding
transactions it's managing. So, in either case, the participant should
be able to figure out that it needs to drop out of the transaction.
That said, trying to call abort() on the "inconsistent" participant
might short circuit the getState() call (above). So, for that case, it
could be seen as an optimization if you do make the abort call. [I'm
assuming that releasing resources (early) for a transaction is worth the
extra cost of a remote call, here, and that this scenario is not the
norm within your system.]
Bob