diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-02-09 10:04:00 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-02-09 10:18:46 +0200 |
commit | 66c6188a4b21d81b8d882386e0b059c4a6d05224 (patch) | |
tree | e9f8cfd9d535ae2e56c13f618b39746307923581 /storage | |
parent | 070a8754c44e29572d1fafbfece251ace23ba41d (diff) | |
download | mariadb-git-66c6188a4b21d81b8d882386e0b059c4a6d05224.tar.gz |
Relax assertions on shutdown after aborted startup.
A proper InnoDB shutdown after aborted startup was introduced
in commit 81b7fe9d383bdf68a622b95384f067ed68ba342c.
Also related to this is MDEV-11985, making read-only shutdown more robust.
If startup was aborted, there may exist recovered transactions that were
not rolled back. Relax the assertions accordingly.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/trx/trx0sys.cc | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 5 | ||||
-rw-r--r-- | storage/innobase/trx/trx0undo.cc | 7 |
3 files changed, 10 insertions, 4 deletions
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 94ea858f729..434e29bcf27 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, 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 @@ -1097,6 +1098,7 @@ trx_sys_close(void) /* Only prepared transactions may be left in the system. Free them. */ ut_a(UT_LIST_GET_LEN(trx_sys->rw_trx_list) == trx_sys->n_prepared_trx + || !srv_was_started || srv_read_only_mode || srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO); diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index acb73e0ad33..94caf5bd4c0 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2016, MariaDB Corporation. +Copyright (c) 2015, 2017, 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 @@ -635,7 +635,8 @@ trx_free_prepared( ut_a(trx_state_eq(trx, TRX_STATE_PREPARED) || (trx_state_eq(trx, TRX_STATE_ACTIVE) && trx->is_recovered - && (srv_read_only_mode + && (!srv_was_started + || srv_read_only_mode || srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO))); ut_a(trx->magic_n == TRX_MAGIC_N); diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index aaf0e397607..4bc40680c4b 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, 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 @@ -2021,7 +2022,8 @@ trx_undo_free_prepared( case TRX_UNDO_ACTIVE: /* lock_trx_release_locks() assigns trx->is_recovered=false */ - ut_a(srv_read_only_mode + ut_a(!srv_was_started + || srv_read_only_mode || srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO); break; default: @@ -2042,7 +2044,8 @@ trx_undo_free_prepared( case TRX_UNDO_ACTIVE: /* lock_trx_release_locks() assigns trx->is_recovered=false */ - ut_a(srv_read_only_mode + ut_a(!srv_was_started + || srv_read_only_mode || srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO); break; default: |