summaryrefslogtreecommitdiff
path: root/storage/innobase/dict/dict0load.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-02-12 13:35:07 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-02-12 14:06:04 +0200
commit33f70c4d9c42b6e4da062312e1e4a4fb370313df (patch)
tree470da84efdb0c461857cd3d0865c79e684074f30 /storage/innobase/dict/dict0load.cc
parent7a106d19614cb052ecf245e3825b9510e8029ba0 (diff)
downloadmariadb-git-33f70c4d9c42b6e4da062312e1e4a4fb370313df.tar.gz
MDEV-13869 MariaDB slow start
When code from MySQL 5.7.9 was merged to MariaDB 10.2.2 in commit 2e814d4702d71a04388386a9f591d14a35980bfe 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.
Diffstat (limited to 'storage/innobase/dict/dict0load.cc')
-rw-r--r--storage/innobase/dict/dict0load.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 15e14b9d9f7..3606b902510 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2017, MariaDB Corporation.
+Copyright (c) 2016, 2018, 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
@@ -1471,8 +1471,6 @@ dict_check_sys_tables(
char* filepath = dict_get_first_path(space_id);
/* Check that the .ibd file exists. */
- validate = true; /* Encryption */
-
dberr_t err = fil_ibd_open(
validate,
!srv_read_only_mode && srv_log_file_size != 0,
@@ -3078,6 +3076,12 @@ err_exit:
} else {
dict_mem_table_fill_foreign_vcol_set(table);
table->fk_max_recusive_level = 0;
+
+ if (table->space
+ && !fil_space_get_size(table->space)) {
+ table->corrupted = true;
+ table->file_unreadable = true;
+ }
}
} else {
dict_index_t* index;