diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result index 0dc873b99ab..f1b75b05219 100644 --- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result +++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result @@ -1,6 +1,8 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted; key_version=1"); call mtr.add_suppression("InnoDB: Recovery failed to read page"); -call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]"); +call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[12]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]"); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test/t[12]\\.ibd' page \\[page id: space=[1-9][0-9]*, page number=3\\]"); +call mtr.add_suppression("InnoDB: File '.*test/t[12]\\.ibd' is corrupted"); call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted"); # Restart mysqld --file-key-management-filename=keys2.txt # restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test index 12d061a852f..a47db8e64e2 100644 --- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test @@ -6,7 +6,9 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted; key_version=1"); call mtr.add_suppression("InnoDB: Recovery failed to read page"); -call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]"); +call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[12]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]"); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test/t[12]\\.ibd' page \\[page id: space=[1-9][0-9]*, page number=3\\]"); +call mtr.add_suppression("InnoDB: File '.*test/t[12]\\.ibd' is corrupted"); call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted"); --echo # Restart mysqld --file-key-management-filename=keys2.txt diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 99143e810ed..7796d1dfa00 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -3769,7 +3769,7 @@ release_page: if (recovery && !recv_recover_page(node.space, this)) return DB_PAGE_CORRUPTED; - const bool ibuf_may_exist= frame && !recv_no_ibuf_operations && + const bool ibuf_may_exist= !recv_no_ibuf_operations && (!expected_id.space() || !is_predefined_tablespace(expected_id.space())) && fil_page_get_type(read_frame) == FIL_PAGE_INDEX && page_is_leaf(read_frame); diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index f05bb96aaa0..6e509b77141 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -449,30 +449,22 @@ read_ahead: return count; } -/** High-level function which reads a page from a file to buf_pool -if it is not already there. Sets the io_fix and an exclusive lock -on the buffer frame. The flag is cleared and the x-lock -released by the i/o-handler thread. -@param[in] page_id page id -@retval DB_SUCCESS if the page was read and is not corrupted -@retval DB_SUCCESS_LOCKED_REC if the page was not read -@retval DB_PAGE_CORRUPTED if page based on checksum check is corrupted -@retval DB_DECRYPTION_FAILED if page post encryption checksum matches but -after decryption normal page checksum does not match. -@retval DB_TABLESPACE_DELETED if tablespace .ibd file is missing */ dberr_t buf_read_page(const page_id_t page_id) { fil_space_t *space= fil_space_t::get(page_id.space()); - if (!space) + if (UNIV_UNLIKELY(!space)) { - ib::info() << "trying to read page " << page_id - << " in nonexisting or being-dropped tablespace"; + sql_print_information("InnoDB: trying to read page " + "[page id: space=" UINT32PF + ", page number=" UINT32PF "]" + " in nonexisting or being-dropped tablespace", + page_id.space(), page_id.page_no()); return DB_TABLESPACE_DELETED; } buf_LRU_stat_inc_io(); /* NOT protected by buf_pool.mutex */ return buf_read_page_low(space, true, BUF_READ_ANY_PAGE, - page_id, space->zip_size(), false); + page_id, space->zip_size(), true); } /** High-level function which reads a page asynchronously from a file to the diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h index 32296720c79..36d1bb132d7 100644 --- a/storage/innobase/include/buf0rea.h +++ b/storage/innobase/include/buf0rea.h @@ -29,10 +29,8 @@ Created 11/5/1995 Heikki Tuuri #include "buf0buf.h" -/** High-level function which reads a page asynchronously from a file to the -buffer buf_pool if it is not already there. Sets the io_fix flag and sets -an exclusive lock on the buffer frame. The flag is cleared and the x-lock -released by the i/o-handler thread. +/** Read a page synchronously from a file. buf_page_t::read_complete() +will be invoked on read completion. @param page_id page id @retval DB_SUCCESS if the page was read and is not corrupted @retval DB_SUCCESS_LOCKED_REC if the page was not read