Commit 58888e2c authored by Jan Lindström's avatar Jan Lindström

MDEV-6935: Change the default value for innodb_log_compressed_pages to false

Merge Facebook commit ca40b4417fd224a68de6636b58c92f133703fc68
authored by Steaphan Greene from https://github.com/facebook/mysql-5.6
Change the default value for innodb_log_compressed_pages to false

Logging these pages is a waste. We don't want this to be enabled.

One caution here: If the zlib version used by innodb is changed, but
the running version is still the previous version, and the running
version crashes, it is possible crash recovery could fail.

When crash recovery uses a zlib version at all different than the
version used by the crashed instance, it is possible that a redone
compression could fail, where the original did not, because the new
zlib version compresses the same data to a slightly larger size.

Because of the nature of compression, this is even possible when
upgrading to a version of zlib which actually peforms overall better
compression than the previous version.

If this happens, mysql will fail to recover, since a page split can
not be safely triggered during crash recovery.

So, either the exact zlib version must be controlled between builds,
or these rare recovery failures must be accepted. The cost of
logging these pages is quite high, so we consider this limitation to
be worthwhile.

This failure scenario can not happen if there was a clean shutdown.
This is only relevant to restarting crashed instances, or starting an
instance built via a hot backup too (XtraBackup).
parent 2d2d11f0
SET @start_global_value = @@global.innodb_log_compressed_pages; SET @start_global_value = @@global.innodb_log_compressed_pages;
SELECT @start_global_value; SELECT @start_global_value;
@start_global_value @start_global_value
1 0
'#---------------------BS_STVARS_028_01----------------------#' '#---------------------BS_STVARS_028_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages); SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
COUNT(@@GLOBAL.innodb_log_compressed_pages) COUNT(@@GLOBAL.innodb_log_compressed_pages)
...@@ -66,4 +66,4 @@ ERROR 42S22: Unknown column 'innodb_log_compressed_pages' in 'field list' ...@@ -66,4 +66,4 @@ ERROR 42S22: Unknown column 'innodb_log_compressed_pages' in 'field list'
SET @@global.innodb_log_compressed_pages = @start_global_value; SET @@global.innodb_log_compressed_pages = @start_global_value;
SELECT @@global.innodb_log_compressed_pages; SELECT @@global.innodb_log_compressed_pages;
@@global.innodb_log_compressed_pages @@global.innodb_log_compressed_pages
1 0
...@@ -1141,9 +1141,9 @@ READ_ONLY NO ...@@ -1141,9 +1141,9 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE ON GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ON DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT 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. VARIABLE_COMMENT 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.
......
...@@ -18151,7 +18151,7 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages, ...@@ -18151,7 +18151,7 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages,
" the zlib compression algorithm changes." " the zlib compression algorithm changes."
" When turned OFF, InnoDB will assume that the zlib" " When turned OFF, InnoDB will assume that the zlib"
" compression algorithm doesn't change.", " compression algorithm doesn't change.",
NULL, NULL, TRUE); NULL, NULL, FALSE);
static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size, static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
......
...@@ -76,7 +76,7 @@ UNIV_INTERN uint page_zip_level = DEFAULT_COMPRESSION_LEVEL; ...@@ -76,7 +76,7 @@ UNIV_INTERN uint page_zip_level = DEFAULT_COMPRESSION_LEVEL;
/* Whether or not to log compressed page images to avoid possible /* Whether or not to log compressed page images to avoid possible
compression algorithm changes in zlib. */ compression algorithm changes in zlib. */
UNIV_INTERN my_bool page_zip_log_pages = true; UNIV_INTERN my_bool page_zip_log_pages = false;
/* Please refer to ../include/page0zip.ic for a description of the /* Please refer to ../include/page0zip.ic for a description of the
compressed page format. */ compressed page format. */
......
...@@ -19254,7 +19254,7 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages, ...@@ -19254,7 +19254,7 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages,
" the zlib compression algorithm changes." " the zlib compression algorithm changes."
" When turned OFF, InnoDB will assume that the zlib" " When turned OFF, InnoDB will assume that the zlib"
" compression algorithm doesn't change.", " compression algorithm doesn't change.",
NULL, NULL, TRUE); NULL, NULL, FALSE);
static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size, static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
......
...@@ -77,7 +77,7 @@ UNIV_INTERN uint page_zip_level = DEFAULT_COMPRESSION_LEVEL; ...@@ -77,7 +77,7 @@ UNIV_INTERN uint page_zip_level = DEFAULT_COMPRESSION_LEVEL;
/* Whether or not to log compressed page images to avoid possible /* Whether or not to log compressed page images to avoid possible
compression algorithm changes in zlib. */ compression algorithm changes in zlib. */
UNIV_INTERN my_bool page_zip_log_pages = true; UNIV_INTERN my_bool page_zip_log_pages = false;
/* Please refer to ../include/page0zip.ic for a description of the /* Please refer to ../include/page0zip.ic for a description of the
compressed page format. */ compressed page format. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment