From dd127799bc179da10cc24c5d5cd105c9a5584730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 10 Apr 2018 18:01:21 +0300 Subject: MDEV-15832 With innodb_fast_shutdown=3, skip the rollback of connected transactions row_undo_step(): If innodb_fast_shutdown=3 has been requested, abort the rollback of any non-DDL transactions. Starting with MDEV-12323, we aborted the rollback of recovered transactions. The transactions would be rolled back on subsequent server startup. trx_roll_report_progress(): Renamed from trx_roll_must_shutdown(), now that the shutdown check has been moved to the only caller. trx_commit_low(): Allow mtr=NULL for transactions that are aborted on rollback. trx_rollback_finish(): Clean up aborted transactions to avoid assertion failures and memory leaks on shutdown. This code was previously in trx_rollback_active(). trx_rollback_to_savepoint_low(), trx_rollback_for_mysql_low(): Remove some redundant assertions. --- storage/innobase/trx/trx0trx.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'storage/innobase/trx/trx0trx.cc') diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 6690d3e7676..9b3e67a9043 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1457,19 +1457,18 @@ trx_commit_in_memory( srv_wake_purge_thread_if_not_active(); } -/****************************************************************//** -Commits a transaction and a mini-transaction. */ -void -trx_commit_low( -/*===========*/ - trx_t* trx, /*!< in/out: transaction */ - mtr_t* mtr) /*!< in/out: mini-transaction (will be committed), - or NULL if trx made no modifications */ +/** Commit a transaction and a mini-transaction. +@param[in,out] trx transaction +@param[in,out] mtr mini-transaction (NULL if no modifications) */ +void trx_commit_low(trx_t* trx, mtr_t* mtr) { assert_trx_nonlocking_or_in_list(trx); ut_ad(!trx_state_eq(trx, TRX_STATE_COMMITTED_IN_MEMORY)); ut_ad(!mtr || mtr->is_active()); - ut_ad(!mtr == !trx->has_logged_or_recovered()); + ut_d(bool aborted = trx->in_rollback + && trx->error_state == DB_DEADLOCK); + ut_ad(!mtr == (aborted || !trx->has_logged_or_recovered())); + ut_ad(!mtr || !aborted); /* undo_no is non-zero if we're doing the final commit. */ if (trx->fts_trx != NULL && trx->undo_no != 0) { -- cgit v1.2.1