mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-13869 MariaDB slow start
When code from MySQL 5.7.9 was merged to MariaDB 10.2.2
in commit 2e814d4702
an assignment validate=true was inadvertently added to the function
dict_check_sys_tables().
This causes InnoDB to open every single .ibd file on startup, even
when no crash recovery was needed.
Simply removing the assignment would make some tests fail. We do the
best to retain almost the same level of inconsistency detection.
In the test innodb.table_flags, access to one of the tables will not
be blocked despite inconsistent flags.
dict_check_sys_tables(): Remove the problematic assignment, and skip
validation in normal startup.
dict_load_table_one(): If the .ibd file cannot be opened, mark the
table as corrupted and unreadable.
fil_node_open_file(): Validate FSP_SPACE_FLAGS with the expected
flags. If reading the tablespace fails, invalidate node->handle
instead of letting it remain stale. This bug was caught by a
fil_validate() assertion failure.
fsp_flags_try_adjust(): If the tablespace file is invalid, do nothing.
This commit is contained in:
@@ -116,14 +116,21 @@ SHOW CREATE TABLE tr;
|
||||
ERROR 42S02: Table 'test.tr' doesn't exist in engine
|
||||
SHOW CREATE TABLE tc;
|
||||
ERROR 42S02: Table 'test.tc' doesn't exist in engine
|
||||
SELECT * FROM tc;
|
||||
ERROR 42S02: Table 'test.tc' doesn't exist in engine
|
||||
SHOW CREATE TABLE td;
|
||||
ERROR 42S02: Table 'test.td' doesn't exist in engine
|
||||
Table Create Table
|
||||
td CREATE TABLE `td` (
|
||||
`a` int(11) NOT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
SELECT * FROM td;
|
||||
a
|
||||
SHOW CREATE TABLE tz;
|
||||
ERROR 42S02: Table 'test.tz' doesn't exist in engine
|
||||
SHOW CREATE TABLE tp;
|
||||
ERROR 42S02: Table 'test.tp' doesn't exist in engine
|
||||
FOUND 6 /InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649/ in mysqld.1.err
|
||||
FOUND 2 /InnoDB: Refusing to load '\..test.td\.ibd' \(id=3, flags=0x1?[2ae]1\); dictionary contains id=3, flags=0x10[01][2ae]1\b/ in mysqld.1.err
|
||||
FOUND 7 /InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649/ in mysqld.1.err
|
||||
FOUND 2 /InnoDB: Table `test`\.`tr` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=65 SYS_TABLES\.MIX_LEN=4294967295\b/ in mysqld.1.err
|
||||
Restoring SYS_TABLES clustered index root page (8)
|
||||
SHOW CREATE TABLE tr;
|
||||
|
Reference in New Issue
Block a user