diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index f427a137c4d..376a106bf8a 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/btr/btr0scrub.cc @@ -883,17 +883,15 @@ btr_scrub_update_total_stat(btr_scrub_t *scrub_data) memset(&scrub_data->scrub_stat, 0, sizeof(scrub_data->scrub_stat)); } -/**************************************************************//** -Complete iterating a space */ +/** Complete iterating a space. +@param[in,out] scrub_data scrub data */ UNIV_INTERN -bool -btr_scrub_complete_space( -/*=====================*/ - btr_scrub_t* scrub_data) /*!< in/out: scrub data */ +void +btr_scrub_complete_space(btr_scrub_t* scrub_data) { + ut_ad(scrub_data->scrubbing); btr_scrub_table_close_for_thread(scrub_data); btr_scrub_update_total_stat(scrub_data); - return scrub_data->scrubbing; } /********************************************************************* diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index c8e9e0bd9b7..cdf3d9bd997 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -2083,7 +2083,8 @@ fil_crypt_complete_rotate_space( mutex_exit(&crypt_data->mutex); /* all threads must call btr_scrub_complete_space wo/ mutex held */ - if (btr_scrub_complete_space(&state->scrub_data) == true) { + if (state->scrub_data.scrubbing) { + btr_scrub_complete_space(&state->scrub_data); if (should_flush) { /* only last thread updates last_scrub_completed */ ut_ad(crypt_data); diff --git a/storage/innobase/include/btr0scrub.h b/storage/innobase/include/btr0scrub.h index 608266c206d..8029cc91005 100644 --- a/storage/innobase/include/btr0scrub.h +++ b/storage/innobase/include/btr0scrub.h @@ -154,13 +154,10 @@ btr_scrub_start_space( ulint space, /*!< in: space */ btr_scrub_t* scrub_data); /*!< in/out: scrub data */ -/**************************************************************** -Complete iterating a space -* @return true if space was scrubbed */ +/** Complete iterating a space. +@param[in,out] scrub_data scrub data */ UNIV_INTERN -bool -btr_scrub_complete_space( -/*=====================*/ - btr_scrub_t* scrub_data); /*!< in/out: scrub data */ +void +btr_scrub_complete_space(btr_scrub_t* scrub_data); #endif diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 46eb60654aa..21c1343f5b3 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2729,6 +2729,7 @@ files_checked: will flush dirty pages and that might need e.g. fil_crypt_threads_event. */ fil_system_enter(); + btr_scrub_init(); fil_crypt_threads_init(); fil_system_exit(); @@ -2739,9 +2740,6 @@ files_checked: */ log_make_checkpoint_at(LSN_MAX, TRUE); - /* Init data for datafile scrub threads */ - btr_scrub_init(); - /* Initialize online defragmentation. */ btr_defragment_init(); btr_defragment_thread_active = true; diff --git a/storage/xtradb/btr/btr0scrub.cc b/storage/xtradb/btr/btr0scrub.cc index 24c84ed301b..1b10b79838d 100644 --- a/storage/xtradb/btr/btr0scrub.cc +++ b/storage/xtradb/btr/btr0scrub.cc @@ -886,17 +886,15 @@ btr_scrub_update_total_stat(btr_scrub_t *scrub_data) memset(&scrub_data->scrub_stat, 0, sizeof(scrub_data->scrub_stat)); } -/**************************************************************//** -Complete iterating a space */ +/** Complete iterating a space. +@param[in,out] scrub_data scrub data */ UNIV_INTERN -bool -btr_scrub_complete_space( -/*=====================*/ - btr_scrub_t* scrub_data) /*!< in/out: scrub data */ +void +btr_scrub_complete_space(btr_scrub_t* scrub_data) { + ut_ad(scrub_data->scrubbing); btr_scrub_table_close_for_thread(scrub_data); btr_scrub_update_total_stat(scrub_data); - return scrub_data->scrubbing; } /********************************************************************* diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 99b080ba402..81b1fd362af 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -2127,7 +2127,8 @@ fil_crypt_complete_rotate_space( mutex_exit(&crypt_data->mutex); /* all threads must call btr_scrub_complete_space wo/ mutex held */ - if (btr_scrub_complete_space(&state->scrub_data) == true) { + if (state->scrub_data.scrubbing) { + btr_scrub_complete_space(&state->scrub_data); if (should_flush) { /* only last thread updates last_scrub_completed */ ut_ad(crypt_data); diff --git a/storage/xtradb/include/btr0scrub.h b/storage/xtradb/include/btr0scrub.h index 608266c206d..8029cc91005 100644 --- a/storage/xtradb/include/btr0scrub.h +++ b/storage/xtradb/include/btr0scrub.h @@ -154,13 +154,10 @@ btr_scrub_start_space( ulint space, /*!< in: space */ btr_scrub_t* scrub_data); /*!< in/out: scrub data */ -/**************************************************************** -Complete iterating a space -* @return true if space was scrubbed */ +/** Complete iterating a space. +@param[in,out] scrub_data scrub data */ UNIV_INTERN -bool -btr_scrub_complete_space( -/*=====================*/ - btr_scrub_t* scrub_data); /*!< in/out: scrub data */ +void +btr_scrub_complete_space(btr_scrub_t* scrub_data); #endif diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 35981e79d43..e89b4c4d323 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -3115,12 +3115,10 @@ files_checked: #endif /* WITH_WSREP */ /* Create thread(s) that handles key rotation */ fil_system_enter(); + btr_scrub_init(); fil_crypt_threads_init(); fil_system_exit(); - /* Init data for datafile scrub threads */ - btr_scrub_init(); - /* Initialize online defragmentation. */ btr_defragment_init(); btr_defragment_thread_active = true;