diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 4b4a9a11796..8c54d6eb083 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2983,9 +2983,6 @@ files_checked: /* Create the thread that will optimize the FTS sub-system. */ fts_optimize_init(); - /* Init data for datafile scrub threads */ - btr_scrub_init(); - /* Create thread(s) that handles key rotation */ fil_crypt_threads_init(); @@ -2994,6 +2991,9 @@ files_checked: os_thread_create(log_scrub_thread, NULL, NULL); } + /* Init data for datafile scrub threads */ + btr_scrub_init(); + /* Initialize online defragmentation. */ btr_defragment_init(); @@ -3177,11 +3177,11 @@ innobase_shutdown_for_mysql(void) if (!srv_read_only_mode) { fil_crypt_threads_cleanup(); - - /* Cleanup data for datafile scrubbing */ - btr_scrub_cleanup(); } + /* Cleanup data for datafile scrubbing */ + btr_scrub_cleanup(); + #ifdef __WIN__ /* MDEV-361: ha_innodb.dll leaks handles on Windows MDEV-7403: should not pass recv_writer_thread_handle to diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 51f2c70c400..6e45725098c 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -3075,9 +3075,6 @@ files_checked: /* Create the thread that will optimize the FTS sub-system. */ fts_optimize_init(); - /* Init data for datafile scrub threads */ - btr_scrub_init(); - /* Create thread(s) that handles key rotation */ fil_crypt_threads_init(); @@ -3086,6 +3083,9 @@ files_checked: os_thread_create(log_scrub_thread, NULL, NULL); } + /* Init data for datafile scrub threads */ + btr_scrub_init(); + /* Initialize online defragmentation. */ btr_defragment_init(); @@ -3269,11 +3269,11 @@ innobase_shutdown_for_mysql(void) if (!srv_read_only_mode) { fil_crypt_threads_cleanup(); - - /* Cleanup data for datafile scrubbing */ - btr_scrub_cleanup(); } + /* Cleanup data for datafile scrubbing */ + btr_scrub_cleanup(); + #ifdef __WIN__ /* MDEV-361: ha_innodb.dll leaks handles on Windows MDEV-7403: should not pass recv_writer_thread_handle to