Skip to content
Permalink
Browse files
MDEV-29905 fixup: Remove some unnecessary code
srv_shutdown(): Do not call log_free_check(), because it will now
be repeatedly called by ibuf_merge_all(). Do not call
srv_sync_log_buffer_in_background(), because we do not actually care
about durability during shutdown. Log writes will already be triggered
by buf_flush_page_cleaner() for writing back modified pages, possibly by
log_free_check().

logs_empty_and_mark_files_at_shutdown(): Clean up a condition.
This function is the caller of srv_shutdown(), and it will ensure that
the log and the buffer pool will be in clean state before shutdown.
  • Loading branch information
dr-m committed Nov 14, 2022
1 parent 5bf5e6e commit 2283f82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
@@ -1096,13 +1096,9 @@ ATTRIBUTE_COLD void logs_empty_and_mark_files_at_shutdown()
}

/* We need these threads to stop early in shutdown. */
const char* thread_name;

if (srv_fast_shutdown != 2 && trx_rollback_is_active) {
thread_name = "rollback of recovered transactions";
} else {
thread_name = NULL;
}
const char* thread_name = srv_fast_shutdown != 2
&& trx_rollback_is_active
? "rollback of recovered transactions" : nullptr;

if (thread_name) {
ut_ad(!srv_read_only_mode);
@@ -1677,13 +1677,8 @@ void srv_shutdown(bool ibuf_merge)
n_tables_to_drop = row_drop_tables_for_mysql_in_background();

if (ibuf_merge) {
srv_main_thread_op_info = "checking free log space";
log_free_check();
srv_main_thread_op_info = "doing insert buffer merge";
n_bytes_merged = ibuf_merge_all();

/* Flush logs if needed */
srv_sync_log_buffer_in_background();
}

/* Print progress message every 60 seconds during shutdown */

0 comments on commit 2283f82

Please sign in to comment.