mariadb/storage
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
..
archive Merge 10.4 into 10.5 2021-04-21 09:01:01 +03:00
blackhole Merge 10.3 into 10.4 2020-11-03 14:49:17 +02:00
cassandra Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
columnstore Update columnstore 2021-08-02 20:45:40 +02:00
connect Merge 10.4 into 10.5 2021-10-13 12:33:56 +03:00
csv Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
example remove mysql_declare_plugin declaration from some plugins 2020-07-04 01:44:47 +02:00
federated Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
federatedx MDEV-22775: Merge 10.4 into 10.5 2021-04-08 08:08:53 +03:00
heap Merge 10.4 into 10.5 2021-06-08 16:03:53 +03:00
innobase MDEV-26682 Replication timeouts with XA PREPARE 2021-10-18 12:49:10 +03:00
maria Fixed bug in aria_chk that overwrote sort_buffer_length 2021-09-15 21:21:03 +03:00
mroonga Merge 10.4 into 10.5 2021-08-23 11:10:59 +03:00
myisam Merge 10.4 into 10.5 2021-10-13 12:33:56 +03:00
myisammrg Added 'final' to some classes to improve generated code 2020-08-04 17:27:32 +02:00
oqgraph Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
perfschema perfschema: use correct type for left shifts 2021-09-12 15:42:49 +02:00
rocksdb Updated rocksdb test result 2021-09-16 14:06:29 +03:00
sequence Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
sphinx Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
spider MDEV-26539 SIGSEGV in spider_check_and_set_trx_isolation and I_P_List_iterator from THD::drop_temporary_table (10.5.3 opt only) on ALTER 2021-10-18 13:23:48 +09:00
test_sql_discovery MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode 2020-08-01 07:43:50 +04:00
tokudb Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00