Commit 1eb59c30 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24340 Unique final message of InnoDB during shutdown

innobase_space_shutdown(): Remove. We want this step to be executed
before the message "InnoDB: Shutdown completed; log sequence number "
is output by innodb_shutdown(). It used to be executed after that step.

innodb_shutdown(): Duplicate the code that used to live in
innobase_space_shutdown().

innobase_init_abort(): Merge with innobase_space_shutdown().
parent 178d32f0
...@@ -6073,12 +6073,9 @@ static bool xtrabackup_prepare_func(char** argv) ...@@ -6073,12 +6073,9 @@ static bool xtrabackup_prepare_func(char** argv)
srv_shutdown_bg_undo_sources(); srv_shutdown_bg_undo_sources();
srv_purge_shutdown(); srv_purge_shutdown();
buf_flush_sync_all_buf_pools(); buf_flush_sync_all_buf_pools();
innodb_shutdown();
innobase_space_shutdown();
} }
else
innodb_shutdown();
innodb_shutdown();
innodb_free_param(); innodb_free_param();
/* output to metadata file */ /* output to metadata file */
......
...@@ -3544,11 +3544,12 @@ ha_innobase::init_table_handle_for_HANDLER(void) ...@@ -3544,11 +3544,12 @@ ha_innobase::init_table_handle_for_HANDLER(void)
reset_template(); reset_template();
} }
/** Free tablespace resources allocated. */ /*********************************************************************//**
void innobase_space_shutdown() Free any resources that were allocated and return failure.
@return always return 1 */
static int innobase_init_abort()
{ {
DBUG_ENTER("innobase_space_shutdown"); DBUG_ENTER("innobase_init_abort");
srv_sys_space.shutdown(); srv_sys_space.shutdown();
if (srv_tmp_space.get_sanity_check_status()) { if (srv_tmp_space.get_sanity_check_status()) {
fil_space_close(srv_tmp_space.name()); fil_space_close(srv_tmp_space.name());
...@@ -3559,20 +3560,6 @@ void innobase_space_shutdown() ...@@ -3559,20 +3560,6 @@ void innobase_space_shutdown()
#ifdef WITH_INNODB_DISALLOW_WRITES #ifdef WITH_INNODB_DISALLOW_WRITES
os_event_destroy(srv_allow_writes_event); os_event_destroy(srv_allow_writes_event);
#endif /* WITH_INNODB_DISALLOW_WRITES */ #endif /* WITH_INNODB_DISALLOW_WRITES */
DBUG_VOID_RETURN;
}
/*********************************************************************//**
Free any resources that were allocated and return failure.
@return always return 1 */
static
int
innobase_init_abort()
/*=================*/
{
DBUG_ENTER("innobase_init_abort");
innobase_space_shutdown();
DBUG_RETURN(1); DBUG_RETURN(1);
} }
...@@ -4417,7 +4404,6 @@ innobase_end(handlerton*, ha_panic_function) ...@@ -4417,7 +4404,6 @@ innobase_end(handlerton*, ha_panic_function)
} }
innodb_shutdown(); innodb_shutdown();
innobase_space_shutdown();
mysql_mutex_destroy(&commit_cond_m); mysql_mutex_destroy(&commit_cond_m);
mysql_cond_destroy(&commit_cond); mysql_cond_destroy(&commit_cond);
......
...@@ -976,6 +976,3 @@ which is in the prepared state ...@@ -976,6 +976,3 @@ which is in the prepared state
@return 0 or error number */ @return 0 or error number */
int innobase_rollback_by_xid(handlerton* hton, XID* xid); int innobase_rollback_by_xid(handlerton* hton, XID* xid);
/** Free tablespace resources allocated. */
void innobase_space_shutdown();
...@@ -2913,6 +2913,17 @@ innodb_shutdown() ...@@ -2913,6 +2913,17 @@ innodb_shutdown()
fclose(dict_foreign_err_file); fclose(dict_foreign_err_file);
} }
srv_sys_space.shutdown();
if (srv_tmp_space.get_sanity_check_status()) {
fil_space_close(srv_tmp_space.name());
srv_tmp_space.delete_files();
}
srv_tmp_space.shutdown();
#ifdef WITH_INNODB_DISALLOW_WRITES
os_event_destroy(srv_allow_writes_event);
#endif /* WITH_INNODB_DISALLOW_WRITES */
if (srv_was_started && srv_print_verbose_log) { if (srv_was_started && srv_print_verbose_log) {
ib::info() << "Shutdown completed; log sequence number " ib::info() << "Shutdown completed; log sequence number "
<< srv_shutdown_lsn; << srv_shutdown_lsn;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment