diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index 24c84ed301b..1b10b79838d 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/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/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index a388ce4b604..25966e17e75 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/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/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 0010ec9c002..db52e31881c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -3030,12 +3030,10 @@ files_checked: /* 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; 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 a388ce4b604..25966e17e75 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 c87b7652c21..94e680d0e80 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -3146,12 +3146,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;