diff options
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/btr/btr0btr.cc | 24 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 32 | ||||
-rw-r--r-- | storage/innobase/include/page0zip.h | 16 | ||||
-rw-r--r-- | storage/innobase/include/page0zip.ic | 21 | ||||
-rw-r--r-- | storage/innobase/page/page0cur.cc | 100 | ||||
-rw-r--r-- | storage/innobase/page/page0zip.cc | 4 |
6 files changed, 52 insertions, 145 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 3414e05ffb8..bc84ba0d670 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1400,7 +1400,6 @@ btr_page_reorganize_low( ulint max_ins_size2; bool success = false; ulint pos; - bool log_compressed; bool is_spatial; ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); @@ -1477,14 +1476,6 @@ btr_page_reorganize_low( ? page_is_leaf(temp_block->frame) : block->page.id.page_no() == index->page)); - /* If innodb_log_compressed_pages is ON, page reorganize should log the - compressed page image.*/ - log_compressed = page_zip && page_zip_log_pages; - - if (log_compressed) { - mtr_set_log_mode(mtr, log_mode); - } - if (page_zip && !page_zip_compress(block, index, z_level, mtr)) { @@ -1585,7 +1576,6 @@ func_exit: if (success) { mlog_id_t type; - byte* log_ptr; /* Write the log record */ if (page_zip) { @@ -1597,16 +1587,10 @@ func_exit: type = MLOG_PAGE_REORGANIZE; } - log_ptr = log_compressed - ? NULL - : mlog_open_and_write_index( - mtr, page, index, type, - page_zip ? 1 : 0); - - /* For compressed pages write the compression level. */ - if (log_ptr && page_zip) { - mach_write_to_1(log_ptr, z_level); - mlog_close(mtr, log_ptr + 1); + if (byte* log_ptr = mlog_open_and_write_index( + mtr, page, index, type, page_zip ? 1 : 0)) { + *log_ptr++ = z_level; + mlog_close(mtr, log_ptr); } MONITOR_INC(MONITOR_INDEX_REORG_SUCCESSFUL); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index dc12aef7ff8..0a078cce7df 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3423,6 +3423,11 @@ static my_bool innodb_log_checksums; static const char* innodb_log_checksums_deprecated = "The parameter innodb_log_checksums is deprecated and has no effect."; /** Deprecated parameter with no effect */ +static my_bool innodb_log_compressed_pages; +/** Deprecation message for innodb_log_compressed_pages */ +static const char* innodb_log_compressed_pages_deprecated += "The parameter innodb_log_compressed_pages is deprecated and has no effect."; +/** Deprecated parameter with no effect */ static my_bool innodb_log_optimize_ddl; static const char* innodb_log_optimize_ddl_deprecated = "The parameter innodb_log_optimize_ddl is deprecated and has no effect."; @@ -3742,6 +3747,11 @@ static int innodb_init_params() innodb_log_checksums = TRUE; } + if (UNIV_UNLIKELY(!innodb_log_compressed_pages)) { + sql_print_warning(innodb_log_compressed_pages_deprecated); + innodb_log_compressed_pages = TRUE; + } + if (UNIV_UNLIKELY(innodb_log_optimize_ddl)) { sql_print_warning(innodb_log_optimize_ddl_deprecated); innodb_log_optimize_ddl = FALSE; @@ -18853,6 +18863,17 @@ innodb_log_checksums_warn(THD* thd, st_mysql_sys_var*, void*, const void*) innodb_log_checksums_deprecated); } +/** Issue a deprecation warning for SET GLOBAL innodb_log_compressed_pages. +@param[in,out] thd client connection */ +static void +innodb_log_compressed_pages_warn(THD* thd, st_mysql_sys_var*, void*, + const void*) +{ + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, + innodb_log_compressed_pages_deprecated); +} + /** Issue a deprecation warning for SET GLOBAL innodb_log_optimize_ddl. @param[in,out] thd client connection */ static void @@ -19372,14 +19393,9 @@ static MYSQL_SYSVAR_UINT(compression_level, page_zip_level, ", 1 is fastest, 9 is best compression and default is 6.", NULL, NULL, DEFAULT_COMPRESSION_LEVEL, 0, 9, 0); -static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages, - PLUGIN_VAR_OPCMDARG, - "Enables/disables the logging of entire compressed page images." - " InnoDB logs the compressed pages to prevent corruption if" - " the zlib compression algorithm changes." - " When turned OFF, InnoDB will assume that the zlib" - " compression algorithm doesn't change.", - NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(log_compressed_pages, innodb_log_compressed_pages, + PLUGIN_VAR_OPCMDARG, + innodb_deprecated_ignored, NULL, innodb_log_compressed_pages_warn, TRUE); static MYSQL_SYSVAR_BOOL(log_optimize_ddl, innodb_log_optimize_ddl, PLUGIN_VAR_OPCMDARG, diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index a8e44899ea8..64e6f8d2158 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -59,10 +59,6 @@ extern uint page_zip_level; /** 'deleted' flag */ #define PAGE_ZIP_DIR_SLOT_DEL 0x8000U -/* Whether or not to log compressed page images to avoid possible -compression algorithm changes in zlib. */ -extern my_bool page_zip_log_pages; - /**********************************************************************//** Determine the size of a compressed page in bytes. @return size in bytes */ @@ -476,18 +472,6 @@ bool page_zip_verify_checksum(const void* data, ulint size); #ifndef UNIV_INNOCHECKSUM /**********************************************************************//** -Write a log record of compressing an index page without the data on the page. */ -UNIV_INLINE -void -page_zip_compress_write_log_no_data( -/*================================*/ - ulint level, /*!< in: compression level */ - buf_block_t* block, /*!< in: ROW_FORMAT=COMPRESSED index page */ - dict_index_t* index, /*!< in: index */ - mtr_t* mtr) /*!< in: mtr */ - MY_ATTRIBUTE((nonnull)); - -/**********************************************************************//** Reset the counters used for filling INFORMATION_SCHEMA.innodb_cmp_per_index. */ UNIV_INLINE diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic index c7e6737c0d8..edc67b8f42c 100644 --- a/storage/innobase/include/page0zip.ic +++ b/storage/innobase/include/page0zip.ic @@ -363,27 +363,6 @@ page_zip_write_header( } /**********************************************************************//** -Write a log record of compressing an index page without the data on the page. */ -UNIV_INLINE -void -page_zip_compress_write_log_no_data( -/*================================*/ - ulint level, /*!< in: compression level */ - buf_block_t* block, /*!< in: ROW_FORMAT=COMPRESSED index page */ - dict_index_t* index, /*!< in: index */ - mtr_t* mtr) /*!< in: mtr */ -{ - if (byte* log_ptr = mlog_open(mtr, 11 + 1)) { - log_ptr = mlog_write_initial_log_record_low( - MLOG_ZIP_PAGE_COMPRESS_NO_DATA, - block->page.id.space(), block->page.id.page_no(), - log_ptr, mtr); - mach_write_to_1(log_ptr, level); - mlog_close(mtr, log_ptr + 1); - } -} - -/**********************************************************************//** Reset the counters used for filling INFORMATION_SCHEMA.innodb_cmp_per_index. */ UNIV_INLINE diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 846cfa3134b..d864294a722 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -1629,7 +1629,6 @@ page_cur_insert_rec_zip( rec_size, 1) || reorg_before_insert) { /* The values can change dynamically. */ - bool log_compressed = page_zip_log_pages; ulint level = page_zip_level; #ifdef UNIV_DEBUG rec_t* cursor_rec = page_cur_get_rec(cursor); @@ -1664,9 +1663,6 @@ page_cur_insert_rec_zip( } else if (!page_zip->m_nonempty && !page_has_garbage(page)) { /* The page has been freshly compressed, so reorganizing it will not help. */ - } else if (log_compressed && !reorg_before_insert) { - /* Insert into uncompressed page only, and - try page_zip_reorganize() afterwards. */ } else if (btr_page_reorganize_low( recv_recovery_is_on(), level, cursor, index, mtr)) { @@ -1724,82 +1720,34 @@ page_cur_insert_rec_zip( ulint pos = page_rec_get_n_recs_before(insert_rec); ut_ad(pos > 0); - if (!log_compressed) { - const mtr_log_t log_mode = mtr->set_log_mode( - MTR_LOG_NONE); - const bool ok = page_zip_compress( - page_cur_get_block(cursor), - index, level, mtr); - mtr->set_log_mode(log_mode); - if (ok) { - page_cur_insert_rec_write_log( - insert_rec, rec_size, - cursor->rec, index, mtr); - page_zip_compress_write_log_no_data( - level, - page_cur_get_block(cursor), - index, mtr); - - rec_offs_make_valid( - insert_rec, index, - page_is_leaf(page), offsets); - return(insert_rec); + /* We are writing entire page images to the + log. Reduce the redo log volume by + reorganizing the page at the same time. */ + if (page_zip_reorganize(cursor->block, index, mtr)) { + /* The page was reorganized: Seek to pos. */ + if (pos > 1) { + cursor->rec = page_rec_get_nth( + page, pos - 1); + } else { + cursor->rec = page + PAGE_NEW_INFIMUM; } - /* Page compress failed. If this happened on a - leaf page, put the data size into the sample - buffer. */ - if (page_is_leaf(page)) { - ulint occupied = page_get_data_size(page) - + page_dir_calc_reserved_space( - page_get_n_recs(page)); - index->stat_defrag_data_size_sample[ - index->stat_defrag_sample_next_slot] = - occupied; - index->stat_defrag_sample_next_slot = - (index->stat_defrag_sample_next_slot - + 1) % STAT_DEFRAG_DATA_SIZE_N_SAMPLE; - } - - ut_ad(cursor->rec - == (pos > 1 - ? page_rec_get_nth( - page, pos - 1) - : page + PAGE_NEW_INFIMUM)); - } else { - /* We are writing entire page images - to the log. Reduce the redo log volume - by reorganizing the page at the same time. */ - if (page_zip_reorganize( - cursor->block, index, mtr)) { - /* The page was reorganized: - Seek to pos. */ - if (pos > 1) { - cursor->rec = page_rec_get_nth( - page, pos - 1); - } else { - cursor->rec = page - + PAGE_NEW_INFIMUM; - } - - insert_rec = page + rec_get_next_offs( - cursor->rec, TRUE); - rec_offs_make_valid( - insert_rec, index, - page_is_leaf(page), offsets); - return(insert_rec); - } - - /* Theoretically, we could try one - last resort of btr_page_reorganize_low() - followed by page_zip_available(), but - that would be very unlikely to - succeed. (If the full reorganized page - failed to compress, why would it - succeed to compress the page, plus log - the insert of this record? */ + insert_rec = page + rec_get_next_offs( + cursor->rec, TRUE); + rec_offs_make_valid( + insert_rec, index, + page_is_leaf(page), offsets); + return(insert_rec); } + /* Theoretically, we could try one last resort + of btr_page_reorganize_low() followed by + page_zip_available(), but that would be very + unlikely to succeed. (If the full reorganized + page failed to compress, why would it succeed + to compress the page, plus log the insert of + this record?) */ + /* Out of space: restore the page */ if (!page_zip_decompress(page_zip, page, FALSE)) { ut_error; /* Memory corrupted? */ diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 4bb722bd1b0..de7cbc5f12d 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -62,10 +62,6 @@ page_zip_stat_per_index_t page_zip_stat_per_index; /** Compression level to be used by zlib. Settable by user. */ uint page_zip_level; -/** Whether or not to log compressed page images to avoid possible -compression algorithm changes in zlib. */ -my_bool page_zip_log_pages; - /* Please refer to ../include/page0zip.ic for a description of the compressed page format. */ |