Atomikos transaction logs com.atomikos.icatch.enable_logging = false

I would like to understand if distributed transaction capabilities will work for my application if I set com.atomikos.icatch.enable_logging=false

  • Do I understand correctly that transaction recovery matters when a failure occurs, and we want to completely restart the same transaction.
  • Does recovery work in a single distributed transaction?
  • My application is tolerant of crashes in the sense that crashes can always be simply restarted from the very beginning with a new transaction. Does this mean that in my case, you can set com.atomikos.icatch.enable_logging=false
  • Can com.atomikos.icatch.enable_logging=false lead to an inconsistent state of the database if not all participants in the distributed transactions were committed?

Update I was called after this problem to find out a little more about the internals of the distributed transactions that I described here: How would you tune the distributed (XA) transaction for performance?

+6
source share
2 answers

Well, it took me a while to figure this out. The answer is NO, if we disable com.atomikos.icatch.enable_logging, we cannot guarantee the consistency of transactions, and we can get some things fixed in one database, but not fixed in another.

In transaction XA, we have two main roles. Transaction Coordinator and Transaction Participant. Two transaction logs are involved here. The Coordinator’s transaction log on one side and the participant’s transaction log.

What happens is that first all participants in the XA transaction register for the coordinator. XA_START then follows the write phase, when all SQL statements are sent to different participants. X_END marks the end of this process and the point where commit is invoked from the point of view of the application.

At this point, the Transaction Coordinator takes control of the backstage. PREPARE message is sent to each participant. Each participant answers READ TO COMMIT or ABORT, the message is sent to the logs. If all participants respond with COMMIT. A challenge call is sent to each member.

This means that if a failure occurs and transaction logging is disabled on the coordinator side, that is, Atomikos, this is the real chance that one participant will succeed in COMMIT and the other member will not be able to commit.

Essentially, com.atomikos.icatch.enable_logging is mandatory if you want to guarantee a consistent state.

0
source

If you want distributed transactions, then you probably also want to enable logging. Disabling it is really intended only for testing configurations.

0
source

Source: https://habr.com/ru/post/1261500/


All Articles