diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-21 12:01:44 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-21 12:33:41 +0300 |
commit | dc7c080369472f6f33344299d2e3d01619edf885 (patch) | |
tree | 353ad57bf7ae46281fd4d8534bf1eb9a93f28ecf | |
parent | 45dbd47026362dc18a5d1717d33191a0e15db61f (diff) | |
download | mariadb-git-dc7c080369472f6f33344299d2e3d01619edf885.tar.gz |
MDEV-17026 Assertion srv_undo_sources || ... failed on slow shutdown
trx_purge_add_update_undo_to_history(): Relax the too strict assertion
by removing the condition on srv_fast_shutdown (innodb_fast_shutdown).
Rollback is allowed during any form of shutdown.
-rw-r--r-- | storage/innobase/trx/trx0purge.cc | 18 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0purge.cc | 18 |
2 files changed, 20 insertions, 16 deletions
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 9e5e90128cb..181fde958ff 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -243,18 +243,20 @@ trx_purge_add_update_undo_to_history( hist_size + undo->size, MLOG_4BYTES, mtr); } - /* Before any transaction-generating background threads or the + /* After the purge thread has been given permission to exit, + we may roll back transactions (trx->undo_no==0) + in THD::cleanup() invoked from unlink_thd() in fast shutdown, + or in trx_rollback_resurrected() in slow shutdown. + + Before any transaction-generating background threads or the purge have been started, recv_recovery_rollback_active() can start transactions in row_merge_drop_temp_indexes() and - fts_drop_orphaned_tables(), and roll back recovered transactions. - After the purge thread has been given permission to exit, - in fast shutdown, we may roll back transactions (trx->undo_no==0) - in THD::cleanup() invoked from unlink_thd(). */ + fts_drop_orphaned_tables(), and roll back recovered transactions. */ ut_ad(srv_undo_sources + || trx->undo_no == 0 || ((srv_startup_is_before_trx_rollback_phase || trx_rollback_or_clean_is_active) - && purge_sys->state == PURGE_STATE_INIT) - || (trx->undo_no == 0 && srv_fast_shutdown)); + && purge_sys->state == PURGE_STATE_INIT)); /* Add the log as the first in the history list */ flst_add_first(rseg_header + TRX_RSEG_HISTORY, diff --git a/storage/xtradb/trx/trx0purge.cc b/storage/xtradb/trx/trx0purge.cc index cbf783628f9..893dc8f398c 100644 --- a/storage/xtradb/trx/trx0purge.cc +++ b/storage/xtradb/trx/trx0purge.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -247,18 +247,20 @@ trx_purge_add_update_undo_to_history( hist_size + undo->size, MLOG_4BYTES, mtr); } - /* Before any transaction-generating background threads or the + /* After the purge thread has been given permission to exit, + we may roll back transactions (trx->undo_no==0) + in THD::cleanup() invoked from unlink_thd() in fast shutdown, + or in trx_rollback_resurrected() in slow shutdown. + + Before any transaction-generating background threads or the purge have been started, recv_recovery_rollback_active() can start transactions in row_merge_drop_temp_indexes() and - fts_drop_orphaned_tables(), and roll back recovered transactions. - After the purge thread has been given permission to exit, - in fast shutdown, we may roll back transactions (trx->undo_no==0) - in THD::cleanup() invoked from unlink_thd(). */ + fts_drop_orphaned_tables(), and roll back recovered transactions. */ ut_ad(srv_undo_sources + || trx->undo_no == 0 || ((srv_startup_is_before_trx_rollback_phase || trx_rollback_or_clean_is_active) - && purge_sys->state == PURGE_STATE_INIT) - || (trx->undo_no == 0 && srv_fast_shutdown)); + && purge_sys->state == PURGE_STATE_INIT)); /* Add the log as the first in the history list */ flst_add_first(rseg_header + TRX_RSEG_HISTORY, |