Skip to content
Permalink
Browse files
MDEV-19747: Deprecate and ignore innodb_log_optimize_ddl
During native table rebuild or index creation, InnoDB used to skip
redo logging and write MLOG_INDEX_LOAD records to inform crash recovery
and Mariabackup of the gaps in redo log. This is fragile and prohibits
some optimizations, such as skipping the doublewrite buffer for
newly (re)initialized pages (MDEV-19738).

row_merge_write_redo(): Remove. We do not write MLOG_INDEX_LOAD
records any more. Instead, we write full redo log.

FlushObserver: Remove.

fseg_free_page_func(): Remove the parameter log. Redo logging
cannot be disabled.

fil_space_t::redo_skipped_count: Remove.

We cannot remove buf_block_t::skip_flush_check, because PageBulk
will temporarily generate invalid B-tree pages in the buffer pool.
  • Loading branch information
dr-m committed Feb 11, 2020
1 parent 8ccb3ca commit fc2f2fa
Show file tree
Hide file tree
Showing 46 changed files with 127 additions and 964 deletions.

This file was deleted.

@@ -13,7 +13,7 @@ ALTER TABLE t1 DROP INDEX b, ADD INDEX (b), LOCK=SHARED;
# Kill the server
# restart: --debug=d,ib_log
FOUND 2 /scan \d+: multi-log rec MLOG_FILE_CREATE2 len \d+ page \d+:0/ in mysqld.1.err
FOUND 3 /scan \d+: log rec MLOG_INDEX_LOAD/ in mysqld.1.err
NOT FOUND /scan \d+: log rec MLOG_INDEX_LOAD/ in mysqld.1.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK

This file was deleted.

@@ -30,11 +30,10 @@ ALTER TABLE t1 DROP INDEX b, ADD INDEX (b), LOCK=SHARED;
--source include/start_mysqld.inc

let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_ABORT=NOT FOUND;
# ensure that we have exactly 2 records there.
let SEARCH_PATTERN=scan \d+: multi-log rec MLOG_FILE_CREATE2 len \d+ page \d+:0;
--source include/search_pattern_in_file.inc
# ensure that we have exactly 3 records there.
# ensure that we have 0 records there.
let SEARCH_PATTERN=scan \d+: log rec MLOG_INDEX_LOAD;
--source include/search_pattern_in_file.inc

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -7,7 +7,11 @@ ERROR HY000: Variable 'innodb_log_optimize_ddl' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_log_optimize_ddl INTO @innodb_log_optimize_ddl_save;
SET @@GLOBAL.innodb_log_optimize_ddl = ON;
Warnings:
Warning 138 The parameter innodb_log_optimize_ddl is deprecated and has no effect.
SET @@GLOBAL.innodb_log_optimize_ddl = OFF;
Warnings:
Warning 138 The parameter innodb_log_optimize_ddl is deprecated and has no effect.
SET @@GLOBAL.innodb_log_optimize_ddl = 13;
ERROR 42000: Variable 'innodb_log_optimize_ddl' can't be set to the value of '13'
SET @@GLOBAL.innodb_log_optimize_ddl = 'ABC';
@@ -34,3 +38,5 @@ Expected error 'Variable is a GLOBAL variable'
SELECT innodb_log_optimize_ddl;
ERROR 42S22: Unknown column 'innodb_log_optimize_ddl' in 'field list'
SET GLOBAL innodb_log_optimize_ddl = @innodb_log_optimize_ddl_save;
Warnings:
Warning 138 The parameter innodb_log_optimize_ddl is deprecated and has no effect.
@@ -1259,10 +1259,10 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LOG_OPTIMIZE_DDL
SESSION_VALUE NULL
DEFAULT_VALUE ON
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
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 parameter with no effect.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -2,7 +2,7 @@
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2014, 2019, MariaDB Corporation.
Copyright (c) 2014, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -747,7 +747,7 @@ void btr_page_free(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
: PAGE_HEADER + PAGE_BTR_SEG_TOP];
fseg_free_page(seg_header,
index->table->space, block->page.id.page_no(),
block->index != NULL, !block->page.flush_observer, mtr);
block->index != NULL, mtr);

/* The page was marked free in the allocation bitmap, but it
should remain exclusively latched until mtr_t::commit() or until it

0 comments on commit fc2f2fa

Please sign in to comment.