[ 
https://issues.apache.org/jira/browse/QPID-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759587#action_12759587
 ] 

Martin Ritchie commented on QPID-1816:
--------------------------------------

I have completed tests that validate the reception of messages after failover. 
As the JIRA pointed out CLIENT_ACK was broken. The fix for which is very 
straight forward. Currently in postDeliver the session is marked dirty.. this 
is wrong.. as it means in onMessage if the message is acknowlege the session is 
still marked dirty! Move the dirty setting to preDeliver and adding a markClean 
in acknowledge. Clears this up.

However, After testing receive/onMessage paths with and without failover and 
seeing no errors. Testing that we correctly throw a 'dirty session'  exception 
from Client_Ack and Transacted sessions when the session is dirty seemed 
sensible... Problem is only client ack works.

In the transacted case we never mark the session dirty when we receive a 
message. There for it is possible to receive message 1, failover receive 
message 2 commit and believe we have commited both messages. Now perhaps my 
test is a little contrived as in a clustered environment message 1 would be 
receieved twice unlike my test which is not clustered so preps the new broker 
with message count... (NUM_MSGS - COUNT).

Whlist the test may not be ideal the fact that we can commit without an 
exception is wrong as there is no guarrantee that the second message we receive 
is a redelivery of the first. 

As I see it this means that in the event of failover any open transaction 
whilst it may commit cleanly, what it is committing is not clear.

Testing needs to be done on dirty session due to receive and dirty sessions due 
to send.

> Unable to acknowledge messages after failover
> ---------------------------------------------
>
>                 Key: QPID-1816
>                 URL: https://issues.apache.org/jira/browse/QPID-1816
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Martin Ritchie
>            Assignee: Martin Ritchie
>            Priority: Critical
>
> Summary:
> If messages have been consumed during a session but not acknowledged and 
> failover occurs it is not possible to acknowledge subsequent messages.
> In the transacted case calling rollback after failover clears the 'dirty' 
> state of the connection.
> However calling recover does not do the same work so the dirty session 
> remains and users are unable to acknowledge messages.
> This occurred on a CLIENT_ACK session but I have not yet investigated the 
> other Acking modes so they may be unaffected.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to