Skip to content

Commit

Permalink
MDEV-11927 InnoDB change buffer is not being merged
Browse files Browse the repository at this point in the history
to tables in the system tablespace

This is a regression caused by MDEV-11585, which accidentally
changed Tablespace::is_undo_tablespace() in an incorrect way,
causing the InnoDB system tablespace to be reported as a dedicated
undo tablespace, for which the change buffer is not applicable.

Tablespace::is_undo_tablespace(): Remove. There were only 2
calls from the function buf_page_io_complete(). Replace those
calls as appropriate.

Also, merge changes to tablespace import/export tests from
MySQL 5.7, and clean up the tests a little further, allowing
them to be run with any innodb_page_size.

Remove duplicated error injection instrumentation for the
import/export tests.  In MySQL 5.7, the error injection label
buf_page_is_corrupt_failure was renamed to
buf_page_import_corrupt_failure.

fil_space_extend_must_retry(): Correct a debug assertion
(tablespaces can be extended during IMPORT), and remove a
TODO comment about compressed temporary tables that was
already addressed in MDEV-11816.

dict_build_tablespace_for_table(): Correct a comment that
no longer holds after MDEV-11816, and assert that
ROW_FORMAT=COMPRESSED can only be used in .ibd files.
  • Loading branch information
dr-m committed Feb 24, 2017
1 parent b513e37 commit 78153cf
Show file tree
Hide file tree
Showing 14 changed files with 267 additions and 305 deletions.
2 changes: 0 additions & 2 deletions mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ galera_sst_xtrabackup-v2 : MDEV-11208
galera_sst_xtrabackup-v2_encrypt_with_key : MDEV-11208
mysql-wsrep#33 : TODO: investigate
galera_var_innodb_disallow_writes : MDEV-10949
galera_many_tables_pk : MDEV-11927
galera_many_tables_nopk : MDEV-11927
113 changes: 53 additions & 60 deletions mysql-test/suite/innodb/r/innodb-wl5522-debug.result

Large diffs are not rendered by default.

30 changes: 27 additions & 3 deletions mysql-test/suite/innodb/r/innodb-wl5522.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT.");
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
FLUSH TABLES;
CREATE TABLE t1
(a INT AUTO_INCREMENT PRIMARY KEY,
Expand Down Expand Up @@ -29,15 +30,19 @@ a b c
823 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
t1.frm
t1.ibd
# Restarting server
# Done restarting server
FLUSH TABLE t1 FOR EXPORT;
t2.frm
t2.ibd
FLUSH TABLE t1, t2 FOR EXPORT;
# List before copying files
t1.cfg
t1.frm
t1.ibd
t2.cfg
t2.frm
t2.ibd
UNLOCK TABLES;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
Expand All @@ -58,9 +63,13 @@ a b c
# List before t1 DISCARD
t1.frm
t1.ibd
t2.frm
t2.ibd
ALTER TABLE t1 DISCARD TABLESPACE;
# List after t1 DISCARD
t1.frm
t2.frm
t2.ibd
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
Expand All @@ -79,6 +88,8 @@ a b c
t1.cfg
t1.frm
t1.ibd
t2.frm
t2.ibd
SELECT COUNT(*) FROM t1;
COUNT(*)
640
Expand All @@ -93,6 +104,19 @@ a b c
822 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf
DROP TABLE t1;
ALTER TABLE t2 ROW_FORMAT=DYNAMIC;
ALTER TABLE t2 DISCARD TABLESPACE;
# List after t2 DISCARD
t2.frm
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x4 and the meta-data file has 0x1)
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.)
DROP TABLE t2;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
1
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
Expand Down

0 comments on commit 78153cf

Please sign in to comment.