mariadb/storage/innobase
Libing Song 5bbda97111 MDEV-33853 Async rollback prepared transactions during binlog
crash recovery

Summary
=======
When doing server recovery, the active transactions will be rolled
back by InnoDB background rollback thread automatically. The
prepared transactions will be committed or rolled back accordingly
by binlog recovery. Binlog recovery is done in main thread before
the server can provide service to users. If there is a big
transaction to rollback, the server will not available for a long
time.

This patch provides a way to rollback the prepared transactions
asynchronously. Thus the rollback will not block server startup.

Design
======
- Handler::recover_rollback_by_xid()
  This patch provides a new handler interface to rollback transactions
  in recover phase. InnoDB just set the transaction's state to active.
  Then the transaction will be rolled back by the background rollback
  thread.

- Handler::signal_tc_log_recover_done()
  This function is called after tc log is opened(typically binlog opened)
  has done. When this function is called, all transactions will be rolled
  back have been reverted to ACTIVE state. Thus it starts rollback thread
  to rollback the transactions.

- Background rollback thread
  With this patch, background rollback thread is defered to run until binlog
  recovery is finished. It is started by innobase_tc_log_recovery_done().
2024-09-05 21:19:25 +03:00
..
btr Merge 10.6 into 10.11 2024-08-29 07:47:29 +03:00
buf Merge 11.4 into 11.6 2024-09-04 10:38:25 +03:00
data MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
dict Merge branch '11.4' into 11.5 2024-08-05 17:50:18 +02:00
eval MDEV-26938 Support descending indexes internally in InnoDB 2022-01-26 18:43:05 +01:00
fil Merge branch '11.1' into 11.2 2024-08-03 09:50:16 +02:00
fsp Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-08 12:25:04 +04:00
fts Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-08 12:25:04 +04:00
fut Merge branch '11.2' into 11.4 2024-05-21 19:38:51 +02:00
gis MDEV-34458 wait_for_read in buf_page_get_low hurts performance 2024-06-26 13:51:38 +03:00
ha
handler MDEV-33853 Async rollback prepared transactions during binlog 2024-09-05 21:19:25 +03:00
ibuf MDEV-33588/MDEV-33325 after-merge fix 2024-05-20 11:02:25 +03:00
include MDEV-33853 Async rollback prepared transactions during binlog 2024-09-05 21:19:25 +03:00
lock Merge 10.11 into 11.2 2024-08-29 16:02:57 +03:00
log MDEV-33853 Async rollback prepared transactions during binlog 2024-09-05 21:19:25 +03:00
mem MDEV-27058: Reduce the size of buf_block_t and buf_page_t 2021-11-18 17:47:19 +02:00
mtr Merge 10.11 into 11.2 2024-08-29 16:02:57 +03:00
mysql-test/storage_engine
os Merge branch '11.4' into 11.5 2024-08-05 17:50:18 +02:00
page Merge branch '10.11' into 11.1 2024-08-03 09:32:42 +02:00
pars MDEV-31340 Remove MY_COLLATION_HANDLER::strcasecmp() 2024-04-18 15:22:10 +04:00
que MDEV-34515: Reduce context switching in purge 2024-08-26 12:23:17 +03:00
read MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
rem Merge 10.11 into 11.0 2024-03-28 10:51:36 +02:00
row Merge 11.4 into 11.6 2024-09-04 10:38:25 +03:00
srv MDEV-33853 Async rollback prepared transactions during binlog 2024-09-05 21:19:25 +03:00
sync Merge 10.6 into 10.11 2024-08-14 11:36:52 +03:00
trx MDEV-33853 Async rollback prepared transactions during binlog 2024-09-05 21:19:25 +03:00
unittest MDEV-34759: buf_page_get_low() is unnecessarily acquiring exclusive latch 2024-08-23 13:27:50 +03:00
ut Merge 10.6 into 10.11 2024-03-28 09:16:57 +02:00
.clang-format-old switch off storage/innobase/.clang-format: InnoDB uses a common formatting style for all new code 2021-03-17 11:01:15 +03:00
CMakeLists.txt Merge branch '11.0' into 11.1 2024-05-13 09:52:30 +02:00
COPYING.Google
COPYING.Percona