mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 23:25:34 +02:00
MDEV-23720 Change innodb_log_optimize_ddl=OFF by default
MariaDB 10.2.2 inherited from MySQL 5.7 a perceived optimization of ALTER TABLE, which skips the writing of redo log records. In MDEV-16809 we introduced a parameter that allows the redo log to be written, so that Mariabackup would not be impacted, but we kept the MySQL 5.7 behaviour enabled by default (innodb_log_optimize_ddl=ON). As noted in MDEV-19747 (Deprecate and ignore innodb_log_optimize_ddl, implemented in MariaDB 10.5.1), omitting the redo log writes can actually reduce performance, because we will have to wait for the data pages to be written out. When the redo log file is configured to be large enough, it actually can be much faster to write the redo log and avoid the extra page flushing. When the redo log is omitted (innodb_log_optimize_ddl=ON), also Mariabackup may have to perform a lot of extra work, to re-copy the entire data file if it is possible that any log was omitted during the backup. Starting with MariaDB 10.5.1, the parameter innodb_log_optimize_ddl is deprecated and ignored. We hereby deprecate (but will not ignore) the parameter in earlier versions as well.
This commit is contained in:
parent
4e987b1c6b
commit
987df9b37a
4 changed files with 8 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
|
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
|
||||||
INSERT INTO t1(a) SELECT * from seq_1_to_10000;
|
INSERT INTO t1(a) SELECT * from seq_1_to_10000;
|
||||||
|
SET GLOBAL innodb_log_optimize_ddl=ON;
|
||||||
# xtrabackup backup
|
# xtrabackup backup
|
||||||
t1.frm
|
t1.frm
|
||||||
t1.ibd
|
t1.ibd
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
|
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
|
||||||
INSERT INTO t1(a) SELECT * from seq_1_to_10000;
|
INSERT INTO t1(a) SELECT * from seq_1_to_10000;
|
||||||
|
SET GLOBAL innodb_log_optimize_ddl=ON;
|
||||||
|
|
||||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1568,10 +1568,10 @@ READ_ONLY YES
|
||||||
COMMAND_LINE_ARGUMENT REQUIRED
|
COMMAND_LINE_ARGUMENT REQUIRED
|
||||||
VARIABLE_NAME INNODB_LOG_OPTIMIZE_DDL
|
VARIABLE_NAME INNODB_LOG_OPTIMIZE_DDL
|
||||||
SESSION_VALUE NULL
|
SESSION_VALUE NULL
|
||||||
DEFAULT_VALUE ON
|
DEFAULT_VALUE OFF
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
VARIABLE_TYPE BOOLEAN
|
VARIABLE_TYPE BOOLEAN
|
||||||
VARIABLE_COMMENT Reduce redo logging when natively creating indexes or rebuilding tables. Setting this OFF avoids delay due to page flushing and allows concurrent backup.
|
VARIABLE_COMMENT DEPRECATED. Ignored in MariaDB 10.5. Reduce redo logging when natively creating indexes or rebuilding tables. Enabling this may slow down backup and cause delay due to page flushing.
|
||||||
NUMERIC_MIN_VALUE NULL
|
NUMERIC_MIN_VALUE NULL
|
||||||
NUMERIC_MAX_VALUE NULL
|
NUMERIC_MAX_VALUE NULL
|
||||||
NUMERIC_BLOCK_SIZE NULL
|
NUMERIC_BLOCK_SIZE NULL
|
||||||
|
|
|
||||||
|
|
@ -20245,10 +20245,10 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages,
|
||||||
|
|
||||||
static MYSQL_SYSVAR_BOOL(log_optimize_ddl, innodb_log_optimize_ddl,
|
static MYSQL_SYSVAR_BOOL(log_optimize_ddl, innodb_log_optimize_ddl,
|
||||||
PLUGIN_VAR_OPCMDARG,
|
PLUGIN_VAR_OPCMDARG,
|
||||||
"Reduce redo logging when natively creating indexes or rebuilding tables."
|
"DEPRECATED. Ignored in MariaDB 10.5."
|
||||||
" Setting this OFF avoids delay due to page flushing and"
|
" Reduce redo logging when natively creating indexes or rebuilding tables."
|
||||||
" allows concurrent backup.",
|
" Enabling this may slow down backup and cause delay due to page flushing.",
|
||||||
NULL, NULL, TRUE);
|
NULL, NULL, FALSE);
|
||||||
|
|
||||||
static MYSQL_SYSVAR_ULONG(autoextend_increment,
|
static MYSQL_SYSVAR_ULONG(autoextend_increment,
|
||||||
sys_tablespace_auto_extend_increment,
|
sys_tablespace_auto_extend_increment,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue