mariadb/storage
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
..
archive Merge 10.6 into 10.11 2024-06-27 10:26:09 +03:00
blackhole Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
columnstore Merge branch '11.2' into 11.4 2024-08-04 17:27:48 +02:00
connect Merge branch 'bb-11.5-release' into bb-11.6-release 2024-08-06 17:28:38 +02:00
csv Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
example Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
federated Merge remote-tracking branch 'origin/11.2' into 11.4 2024-07-09 21:45:37 +04:00
federatedx Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
heap Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00
innobase MDEV-33853 Async rollback prepared transactions during binlog 2024-09-05 21:19:25 +03:00
maria Merge 11.4 into 11.6 2024-09-04 10:38:25 +03:00
mroonga Merge branch 'bb-11.5-release' into bb-11.6-release 2024-08-06 17:28:38 +02:00
myisam Merge branch '11.4' into 11.5 2024-08-21 11:52:54 +02:00
myisammrg Merge 10.6 into 10.11 2024-06-27 10:26:09 +03:00
oqgraph Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
perfschema Merge remote-tracking branch 'origin/11.5' into 11.6 2024-07-10 19:18:52 +04:00
rocksdb Fix rocksdb.unique_check: do not have two threads waiting on the same name 2024-08-07 11:26:15 +03:00
sequence MDEV-19123 Change default charset from latin1 to utf8mb4 2024-07-11 10:21:07 +04:00
sphinx Merge branch '10.11' into 11.1 2024-07-08 22:40:16 +02:00
spider Merge 11.4 into 11.6 2024-09-04 10:38:25 +03:00
test_sql_discovery MDEV-19123 Change default charset from latin1 to utf8mb4 2024-07-11 10:21:07 +04:00