MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

- Addressing the format issue in deferred_dblwr() and changed the
function comment.
parent 18c335a3
......@@ -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. */
......
......@@ -797,7 +797,10 @@ static struct
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 @@ static struct
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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment