server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-31949 III. Innodb flush_log_later for XA commit,rollback

Open andrelkin opened this issue 6 months ago • 1 comments

This commit carries changes to Innodb for the user XA's binlog-coordinated ordered commit. It's the part III of the series aimed at improving on parallel slave performance and providing crash-recovery.

As the part I has unified binlog coordinated completion (commit and rollback) of the XA transactions with the normal ones a remained task is to optimize flush to disk call away from the XA completion execution in engine like it's done to the normal transaction. Namely innobase_{rollback,commit}_by_xid()^\footnote{Unlike the normal transaction case, XA-rollback also needs a similar addressing} now raise a flag blocking the flush before innobase_commit_low(). The flag is restored upon that, which of course what the normal transaction does in its execution path past the low-commit.

Tests demonstrate the changes are effectual, e.g binlog_xa_prepared_disconnect.test " failed ", to require it to adapted to possible loss of the commit/rollback upon crash. The actual binlog recovery in such scenarios is only going to be recovered in the part IV of MDEV-33168.

Feasibility of successful recovery of XA-"COMPLETE" is based on a plain observation, that in order to decide whether to commit an XA or not it's sufficient to follow the normal transaction recovery rule: when xid is found in binlog (that's MDEV-33168) the transaction gets completed (committed in the normal transaction case).

andrelkin avatar May 21 '25 13:05 andrelkin

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

:x: andrelkin
:x: emoonrain
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar May 21 '25 13:05 CLAassistant