Skip to content

Commit 660cfe4

Browse files
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
- Addressing the format issue in deferred_dblwr() and changed the function comment.
1 parent 18c335a commit 660cfe4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

storage/innobase/fsp/fsp0file.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,7 @@ Datafile::validate_for_recovery()
438438
}
439439

440440
if (restore_from_doublewrite()) {
441-
if (m_defer) {
442-
return err;
443-
}
444-
return(DB_CORRUPTION);
441+
return m_defer ? err : DB_CORRUPTION;
445442
}
446443

447444
/* Free the previously read first page and then re-validate. */

storage/innobase/log/log0recv.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,10 @@ static struct
797797
return space;
798798
}
799799

800-
/* Recover the page0 of deferred tablespace from doublewrite buffer.*/
800+
/** Attempt to recover pages from the doublewrite buffer.
801+
This is invoked if we found neither a valid first page in the
802+
data file nor redo log records that would initialize the first
803+
page. */
801804
void deferred_dblwr()
802805
{
803806
for (auto d= defers.begin(); d != defers.end(); )
@@ -832,10 +835,10 @@ static struct
832835
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
833836
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
834837
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
835-
if (!space->acquire())
838+
if (!space->acquire())
836839
goto next_item;
837840
if (os_file_write(IORequestWrite, node->name, node->handle,
838-
page, 0, fil_space_t::physical_size(flags) !=
841+
page, 0, fil_space_t::physical_size(flags) !=
839842
DB_SUCCESS))
840843
{
841844
space->release();

0 commit comments

Comments
 (0)