diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h index 324e3f0478d..58488df4be6 100644 --- a/storage/innobase/include/srv0start.h +++ b/storage/innobase/include/srv0start.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2020, MariaDB Corporation. +Copyright (c) 2017, 2022, 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 @@ -52,9 +52,6 @@ void innodb_preshutdown(); /** Shut down InnoDB. */ void innodb_shutdown(); -/** Shut down background threads that can generate undo log. */ -void srv_shutdown_bg_undo_sources(); - /*************************************************************//** Copy the file path component of the physical file to parameter. It will copy up to and including the terminating path separator. diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index d585639f20a..c0b2f5e02f0 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -848,6 +848,26 @@ static void srv_shutdown_threads() } } + +/** Shut down background threads that can generate undo log. */ +static void srv_shutdown_bg_undo_sources() +{ + srv_shutdown_state= SRV_SHUTDOWN_INITIATED; + + if (srv_undo_sources) + { + ut_ad(!srv_read_only_mode); + fts_optimize_shutdown(); + dict_stats_shutdown(); + while (row_get_background_drop_list_len_low()) + { + srv_inc_activity_count(); + os_thread_yield(); + } + srv_undo_sources= false; + } +} + #ifdef UNIV_DEBUG # define srv_init_abort(_db_err) \ srv_init_abort_low(create_new_db, __FILE__, __LINE__, _db_err) @@ -1953,23 +1973,6 @@ skip_monitors: return(DB_SUCCESS); } -/** Shut down background threads that can generate undo log. */ -void srv_shutdown_bg_undo_sources() -{ - srv_shutdown_state = SRV_SHUTDOWN_INITIATED; - - if (srv_undo_sources) { - ut_ad(!srv_read_only_mode); - fts_optimize_shutdown(); - dict_stats_shutdown(); - while (row_get_background_drop_list_len_low()) { - srv_inc_activity_count(); - os_thread_yield(); - } - srv_undo_sources = false; - } -} - /** Shutdown purge to make sure that there is no possibility that we call any plugin code (e.g., audit) inside virtual column computation.