Skip to content

Commit 58888e2

Browse files
author
Jan Lindström
committed
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).
1 parent 2d2d11f commit 58888e2

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SET @start_global_value = @@global.innodb_log_compressed_pages;
22
SELECT @start_global_value;
33
@start_global_value
4-
1
4+
0
55
'#---------------------BS_STVARS_028_01----------------------#'
66
SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
77
COUNT(@@GLOBAL.innodb_log_compressed_pages)
@@ -66,4 +66,4 @@ ERROR 42S22: Unknown column 'innodb_log_compressed_pages' in 'field list'
6666
SET @@global.innodb_log_compressed_pages = @start_global_value;
6767
SELECT @@global.innodb_log_compressed_pages;
6868
@@global.innodb_log_compressed_pages
69-
1
69+
0

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,9 +1141,9 @@ READ_ONLY NO
11411141
COMMAND_LINE_ARGUMENT OPTIONAL
11421142
VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
11431143
SESSION_VALUE NULL
1144-
GLOBAL_VALUE ON
1144+
GLOBAL_VALUE OFF
11451145
GLOBAL_VALUE_ORIGIN COMPILE-TIME
1146-
DEFAULT_VALUE ON
1146+
DEFAULT_VALUE OFF
11471147
VARIABLE_SCOPE GLOBAL
11481148
VARIABLE_TYPE BOOLEAN
11491149
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.

storage/innobase/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18151,7 +18151,7 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages,
1815118151
" the zlib compression algorithm changes."
1815218152
" When turned OFF, InnoDB will assume that the zlib"
1815318153
" compression algorithm doesn't change.",
18154-
NULL, NULL, TRUE);
18154+
NULL, NULL, FALSE);
1815518155

1815618156
static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
1815718157
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,

storage/innobase/page/page0zip.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ UNIV_INTERN uint page_zip_level = DEFAULT_COMPRESSION_LEVEL;
7676

7777
/* Whether or not to log compressed page images to avoid possible
7878
compression algorithm changes in zlib. */
79-
UNIV_INTERN my_bool page_zip_log_pages = true;
79+
UNIV_INTERN my_bool page_zip_log_pages = false;
8080

8181
/* Please refer to ../include/page0zip.ic for a description of the
8282
compressed page format. */

storage/xtradb/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19254,7 +19254,7 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages,
1925419254
" the zlib compression algorithm changes."
1925519255
" When turned OFF, InnoDB will assume that the zlib"
1925619256
" compression algorithm doesn't change.",
19257-
NULL, NULL, TRUE);
19257+
NULL, NULL, FALSE);
1925819258

1925919259
static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
1926019260
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,

storage/xtradb/page/page0zip.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ UNIV_INTERN uint page_zip_level = DEFAULT_COMPRESSION_LEVEL;
7777

7878
/* Whether or not to log compressed page images to avoid possible
7979
compression algorithm changes in zlib. */
80-
UNIV_INTERN my_bool page_zip_log_pages = true;
80+
UNIV_INTERN my_bool page_zip_log_pages = false;
8181

8282
/* Please refer to ../include/page0zip.ic for a description of the
8383
compressed page format. */

0 commit comments

Comments
 (0)