diff options
Diffstat (limited to 'storage/innobase/btr/btr0scrub.cc')
-rw-r--r-- | storage/innobase/btr/btr0scrub.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index 7d8966d4109..67c06016c72 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/btr/btr0scrub.cc @@ -1,5 +1,5 @@ // Copyright (c) 2014, Google Inc. -// Copyright (c) 2017, MariaDB Corporation. +// Copyright (c) 2017, 2019, MariaDB Corporation. /**************************************************//** @file btr/btr0scrub.cc @@ -119,13 +119,13 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table, time_t last = start; /* FIXME: this is not the proper way of doing things. The - dict_sys->mutex should not be held by any thread for longer + dict_sys.mutex should not be held by any thread for longer than a few microseconds. It must not be held during I/O, for example. So, what is the purpose for this busy-waiting? This function should be rewritten as part of MDEV-8139: Fix scrubbing tests. */ - while (mutex_enter_nowait(&(dict_sys->mutex))) { + while (mutex_enter_nowait(&dict_sys.mutex)) { /* if we lock to close a table, we wait forever * if we don't lock to close a table, we check if space * is closing, and then instead give up @@ -157,7 +157,7 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table, } } - ut_ad(mutex_own(&dict_sys->mutex)); + ut_ad(mutex_own(&dict_sys.mutex)); return true; } @@ -204,10 +204,10 @@ btr_scrub_table_close_for_thread( /* If tablespace is not marked as stopping perform the actual close. */ if (!space->is_stopping()) { - mutex_enter(&dict_sys->mutex); + mutex_enter(&dict_sys.mutex); /* perform the actual closing */ btr_scrub_table_close(scrub_data->current_table); - mutex_exit(&dict_sys->mutex); + mutex_exit(&dict_sys.mutex); } space->release(); } @@ -434,7 +434,7 @@ btr_pessimistic_scrub( const ulint page_no = mach_read_from_4(page + FIL_PAGE_OFFSET); const ulint left_page_no = mach_read_from_4(page + FIL_PAGE_PREV); const ulint right_page_no = mach_read_from_4(page + FIL_PAGE_NEXT); - const page_size_t page_size(index->table->space->flags); + const ulint zip_size = index->table->space->zip_size(); /** * When splitting page, we need X-latches on left/right brothers @@ -449,16 +449,16 @@ btr_pessimistic_scrub( */ mtr->release_block_at_savepoint(scrub_data->savepoint, block); - buf_block_t* get_block __attribute__((unused)) = btr_block_get( + btr_block_get( page_id_t(index->table->space_id, left_page_no), - page_size, RW_X_LATCH, index, mtr); + zip_size, RW_X_LATCH, index, mtr); /** * Refetch block and re-initialize page */ block = btr_block_get( page_id_t(index->table->space_id, page_no), - page_size, RW_X_LATCH, index, mtr); + zip_size, RW_X_LATCH, index, mtr); page = buf_block_get_frame(block); @@ -470,9 +470,9 @@ btr_pessimistic_scrub( } if (right_page_no != FIL_NULL) { - buf_block_t* get_block __attribute__((unused))= btr_block_get( + btr_block_get( page_id_t(index->table->space_id, right_page_no), - page_size, RW_X_LATCH, index, mtr); + zip_size, RW_X_LATCH, index, mtr); } /* arguments to btr_page_split_and_insert */ @@ -842,13 +842,15 @@ btr_scrub_start_space( ulint space, /*!< in: space */ btr_scrub_t* scrub_data) /*!< in/out: scrub data */ { - bool found; scrub_data->space = space; scrub_data->current_table = NULL; scrub_data->current_index = NULL; - const page_size_t page_size = fil_space_get_page_size(space, &found); - - scrub_data->compressed = page_size.is_compressed(); + if (fil_space_t* s = fil_space_acquire_silent(space)) { + scrub_data->compressed = s->zip_size(); + s->release(); + } else { + scrub_data->compressed = 0; + } scrub_data->scrubbing = check_scrub_setting(scrub_data); return scrub_data->scrubbing; } |