1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-15325 Incomplete validation of missing tablespace during recovery

Problem:
=======
	During validation of missing tablespace, missing tablespace id is
being compared with hash table of redo logs (recv_sys->addr_hash). But if the
hash table ran out of memory then there is a possibility that it will not contain
the redo logs of all tablespace. In that case, Server will load the InnoDB
even though there is a missing tablespace.

Solution:
========
	If the recv_sys->addr_hash hash table ran out of memory then InnoDB needs
to scan the remaining redo log again to validate the missing tablespace.
This commit is contained in:
Thirunarayanan Balathandayuthapani
2018-03-27 13:47:56 +05:30
parent 60438451c3
commit 73af8af094
4 changed files with 230 additions and 83 deletions

View File

@ -1076,3 +1076,51 @@ drop table t1;
# no skip sort cases
--source suite/innodb/include/alter_table_pk_no_sort.inc
--echo #
--echo # MDEV-15325 Incomplete validation of missing tablespace during recovery
--echo #
--source include/no_checkpoint_start.inc
CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB;
CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB;
--let CLEANUP_IF_CHECKPOINT=DROP TABLE t1, t2;
--source include/no_checkpoint_end.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--echo # Wrong space_id in a dirty file and a missing file
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t0.ibd
--move_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
--source include/start_mysqld.inc
--eval $check_no_innodb
--source include/shutdown_mysqld.inc
--echo # Restore t1 and t2
--move_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
--move_file $MYSQLD_DATADIR/test/t0.ibd $MYSQLD_DATADIR/test/t1.ibd
--source include/start_mysqld.inc
SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t1, t2;
--disable_query_log
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*t[12].ibd.");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
--enable_query_log