diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-12-12 15:09:59 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-12-12 15:09:59 +0530 |
commit | 660cfe4782380bbb10ab844014b82f4d5c2fee50 (patch) | |
tree | 65b7c74173d4cda5454bba5d0c2ee292475db84f | |
parent | 18c335a39e0ca15a6490e4b00a041072bcd1c70e (diff) | |
download | mariadb-git-660cfe4782380bbb10ab844014b82f4d5c2fee50.tar.gz |
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
- Addressing the format issue in deferred_dblwr() and changed the
function comment.
-rw-r--r-- | storage/innobase/fsp/fsp0file.cc | 5 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 6546b862302..d775fd9c657 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -438,10 +438,7 @@ Datafile::validate_for_recovery() } if (restore_from_doublewrite()) { - if (m_defer) { - return err; - } - return(DB_CORRUPTION); + return m_defer ? err : DB_CORRUPTION; } /* Free the previously read first page and then re-validate. */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index b23b48022d7..dd3ce42c794 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -797,7 +797,10 @@ processed: return space; } - /* Recover the page0 of deferred tablespace from doublewrite buffer.*/ + /** Attempt to recover pages from the doublewrite buffer. + This is invoked if we found neither a valid first page in the + data file nor redo log records that would initialize the first + page. */ void deferred_dblwr() { for (auto d= defers.begin(); d != defers.end(); ) @@ -832,10 +835,10 @@ processed: space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT); space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); fil_node_t *node= UT_LIST_GET_FIRST(space->chain); - if (!space->acquire()) + if (!space->acquire()) goto next_item; if (os_file_write(IORequestWrite, node->name, node->handle, - page, 0, fil_space_t::physical_size(flags) != + page, 0, fil_space_t::physical_size(flags) != DB_SUCCESS)) { space->release(); |