-
1. Re: JBMESSAGING-1006 - Throwing exception when failover fail
clebert.suconic Jun 29, 2007 2:45 PM (in response to clebert.suconic)There is one problem with that though...
Suppose a connection has one session, two consumers, consumerA, consumerB... one on each queue...
ConsumerA will failOver OK, while ConsumerB won't recover acks.
Should we invalidate the whole connection... closing also ConsumerA... or should we invalidate only ConsumerB?
I believe we should invalidate the whole connection... as the failover is supposed to perform as a whole IMO, but I wanted to discuss that first. -
2. Re: JBMESSAGING-1006 - Throwing exception when failover fail
timfox Jun 29, 2007 2:49 PM (in response to clebert.suconic)recovery is done on a per session level, not connection or consumer. so the session should be invalidated
-
3. Re: JBMESSAGING-1006 - Throwing exception when failover fail
clebert.suconic Jun 29, 2007 2:58 PM (in response to clebert.suconic)recovery is done on a per session level, not connection or consumer. so the session should be invalidated
Right...
Think about the two sessions case then?
One Connection , two sessions, each one with a consumer on a different queue.
If session1 can't find ACKs and session2 find ACKs, we want only session1 invalidated, right?
Right now Exceptions are handled on FailoverCommandCenter... I will be adding exception handling for each Session now on SessionState.synchronizeWith. -
4. Re: JBMESSAGING-1006 - Throwing exception when failover fail
clebert.suconic Jun 29, 2007 3:41 PM (in response to clebert.suconic)Just an update...
Another point I'm dealing with on this task, is to make ServerSessionEndpoing::recoverDeliveries atomic.
Case anything goes wrong with the execution of Queue::recoverDeliveries... ServerSessionEndpoing::recoverDeliveries needs to keep messages untouched. -
5. Re: JBMESSAGING-1006 - Throwing exception when failover fail
timfox Jun 30, 2007 11:26 AM (in response to clebert.suconic)"clebert.suconic@jboss.com" wrote:
Just an update...
Another point I'm dealing with on this task, is to make ServerSessionEndpoing::recoverDeliveries atomic.
Case anything goes wrong with the execution of Queue::recoverDeliveries... ServerSessionEndpoing::recoverDeliveries needs to keep messages untouched.
It doesn't need to be atomic.
The only things that need to be atomic are transactional sends and acks -
6. Re: JBMESSAGING-1006 - Throwing exception when failover fail
clebert.suconic Jun 30, 2007 11:33 AM (in response to clebert.suconic)recoverDeliveries does a loop...
if it can't find one of the ACKs... part of the ACKs are recovered, and the client was invalidated.
I'm removing recovered ACKs if one of the messages couldn't be found. -
7. Re: JBMESSAGING-1006 - Throwing exception when failover fail
timfox Jun 30, 2007 1:02 PM (in response to clebert.suconic)I'll re-iterate what I said before.
The only things that execute in a transactional context are sending and ack of messages. These are the only things for which we give a transactional guarantee.
Cancelling and recovering don't need to be atomic.
Why?
Imagine if the cancel or recovery of several message failed half way. The session would eventually get closed and the remaining messages would end up back on the queue. No messages would be lost and we wouldn't have broken any of our transactional promises. -
8. Re: JBMESSAGING-1006 - Throwing exception when failover fail
clebert.suconic Jun 30, 2007 2:36 PM (in response to clebert.suconic)Imagine if the cancel or recovery of several message failed half way. The session would eventually get closed and the remaining messages would end up back on the queue. No messages would be lost and we wouldn't have broken any of our transactional promises.
This is not the behavior I saw on testcases..
The exception was breaking failover... and messages were getting lost. (Until a restart on server) -
9. Re: JBMESSAGING-1006 - Throwing exception when failover fail
timfox Jun 30, 2007 3:25 PM (in response to clebert.suconic)"clebert.suconic@jboss.com" wrote:
The exception was breaking failover... and messages were getting lost. (Until a restart on server)
Probably because you weren't closing the session.
If the recovery failed halfway then the session will still contain deliveries corresponding to the "missing" messages.
The client then gets an exception and closes the session, the deliveries will then get cancelled back to the queue.
If the client crashes the server side cleanup will automatically close the session. In any cas there is no need to make the recovery atomic. -
10. Re: JBMESSAGING-1006 - Throwing exception when failover fail
clebert.suconic Jul 1, 2007 10:54 AM (in response to clebert.suconic)This should be pretty easy to try. I will try it out on monday.
The problem was failover was interrupting failover and keepting the session half way. I have fixed the order where the client is set already (before failover). I will try closing the session when this happens.