Hi

I've been looking at a problem I ran into here where messages are consumed,
and acknowledged, but are then later redelivered to the consumer again
after a broker restart.

The consumer is running with transacted sessions, and looking in KahaDB, I
can see a KAHA_REMOVE_MESSAGE_COMMAND, with the local transaction ID added
to the journal, and then a KAHA_COMMIT_COMMAND after it. Some time later, I
see the exact same KAHA_REMOVE_MESSAGE_COMMAND appended to the journal
again, with the exact same transaction information, but no
corresponding KAHA_COMMIT_COMMAND. This appears to follow a
KAHA_REWRITTEN_DATA_FILE_COMMAND.

It looks like the ack compaction method is forwarding the acknowledgement,
but not the commit - it appears that the commit is only forwarded in the
case of an XA transaction.

I notice that there are some tests around this in AMQ-7067. I've managed to
reproduce this with a further test case in AMQ8067Test.java, and I have
created a PR for this here: https://github.com/apache/activemq/pull/636,
and backported to 5.16.x https://github.com/apache/activemq/pull/637 and
5.15.x. https://github.com/apache/activemq/pull/638

Are there other cases that should be tested around this?

Thanks

Jon

Reply via email to