mariadb/storage/innobase/trx
Marko Mäkelä 18eab4a832 MDEV-26682 Replication timeouts with XA PREPARE
The purpose of non-exclusive locks in a transaction is to guarantee
that the records covered by those locks must remain in that way until
the transaction is committed. (The purpose of gap locks is to ensure
that a record that was nonexistent will remain that way.)

Once a transaction has reached the XA PREPARE state, the only allowed
further actions are XA ROLLBACK or XA COMMIT. Therefore, it can be
argued that only the exclusive locks that the XA PREPARE transaction
is holding are essential.

Furthermore, InnoDB never preserved explicit locks across server restart.
For XA PREPARE transations, we will only recover implicit exclusive locks
for records that had been modified.

Because of the fact that XA PREPARE followed by a server restart will
cause some locks to be lost, we might as well always release all
non-exclusive locks during the execution of an XA PREPARE statement.

lock_release_on_prepare(): Release non-exclusive locks on XA PREPARE.

trx_prepare(): Invoke lock_release_on_prepare() unless the
isolation level is SERIALIZABLE or this is an internal distributed
transaction with the binlog (not actual XA PREPARE statement).

This has been discussed with Sergei Golubchik and Andrei Elkin.

Reviewed by: Sergei Golubchik
2021-10-18 12:49:10 +03:00
..
trx0i_s.cc Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
trx0purge.cc MDEV-26445 followup: Try to work around GCC 4.8.5 ICE on ARMv8 2021-10-05 07:13:14 +03:00
trx0rec.cc Merge 10.4 into 10.5 2021-06-21 18:49:36 +03:00
trx0roll.cc Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
trx0rseg.cc Merge 10.4 into 10.5 2021-09-24 12:14:35 +03:00
trx0sys.cc Merge 10.4 into 10.5 2021-09-24 12:14:35 +03:00
trx0trx.cc MDEV-26682 Replication timeouts with XA PREPARE 2021-10-18 12:49:10 +03:00
trx0undo.cc Merge 10.4 into 10.5 2021-06-23 08:17:49 +03:00