Failure to rollback first command after axondb shutdown

Hi,

I am using domain persistence using standard repository GenericJpaRepository to store the state of aggregate. My eventstore is AxonDB.
I observed one issue here where if I kill the axondb process, the next command that updates the aggregates (or create new aggregate) stores the state of aggregate in database although I get command processing failed message in the logs.
However next command after this one does not store the state and transaction is rolled back correctly.

May be prepare_commit phase is not checking if the connection is still active to the axondb instance.

Attaching logs for first command after axondb shutdown and second command after axondb shutdown.

Regards,
Swapnil

FirstCommandAfterAxonDBShutdown.log (5.93 KB)

SecondCommandAfterAxonDBShutdown.log (6.31 KB)

Hi Swapnil,

Thanks for reporting this issue. It is caused by the async nature of some of the communication between Axon applications and AxonDB, and to the fact that there are multiple transaction handlers.
The issue is that the Axon application does not see in time that AxonDB is down (only on the commit action) and at that point the JPA transaction to update projections is already committed.
This will be fixed in the next version of the AxonDB client.
By the way, if you have tracking event processors the issue does not occur.

Regards,
Marc

Thanks Marc.
How will tracking event processor circumvent the issue? Because this happens at the time of publishing events.

Regards,
Swapnil

Hi Swapnil,
It is kind of a side effect. As the tracking event processor keeps an open connection to the AxonDB, it will fail if AxonDB is stopped.
After that the prepare_commit phase in publishing events will already fail as there is no connection. Similar as in your second publish action.

Regards,
Marc

Got it. Thanks for explanation Marc.

Regards,
Swapnil