Skip to content

Commit

Permalink
Merge 10.1 into 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 31, 2017
2 parents 2f20be9 + 38ca9be commit 2000a90
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 36 deletions.
12 changes: 5 additions & 7 deletions storage/innobase/btr/btr0scrub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*********************************************************************
Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/fil/fil0crypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 4 additions & 7 deletions storage/innobase/include/btr0scrub.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,7 @@ innobase_start_or_create_for_mysql()
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();

Expand All @@ -2739,9 +2740,6 @@ innobase_start_or_create_for_mysql()
*/
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;
Expand Down
12 changes: 5 additions & 7 deletions storage/xtradb/btr/btr0scrub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*********************************************************************
Expand Down
3 changes: 2 additions & 1 deletion storage/xtradb/fil/fil0crypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 4 additions & 7 deletions storage/xtradb/include/btr0scrub.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions storage/xtradb/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3115,12 +3115,10 @@ innobase_start_or_create_for_mysql()
#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;
Expand Down

0 comments on commit 2000a90

Please sign in to comment.