Skip to content

Commit

Permalink
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
Browse files Browse the repository at this point in the history
- Replaced the pointer parameter of validate_for_recovery() with uint32_t
  • Loading branch information
Thirunarayanan committed Dec 1, 2021
1 parent cab8f4b commit e0e24b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2576,7 +2576,8 @@ fil_ibd_load(

/* Read and validate the first page of the tablespace.
Assign a tablespace name based on the tablespace type. */
switch (file.validate_for_recovery(&space_id)) {
switch (file.validate_for_recovery(
static_cast<uint32_t>(space_id))) {
os_offset_t minimum_size;
case DB_SUCCESS:
deferred_space = file.m_defer;
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/fsp/fsp0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ reopen it in write mode and ry to restore that page.
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
m_is_valid is also set true on success, else false. */
dberr_t
Datafile::validate_for_recovery(ulint *space_id)
Datafile::validate_for_recovery(uint32_t space_id)
{
dberr_t err;

Expand Down Expand Up @@ -438,7 +438,7 @@ Datafile::validate_for_recovery(ulint *space_id)
if (empty_tablespace && space_id) {
/* Set space id to find out whether
the page exist in double write buffer */
m_space_id = *space_id;
m_space_id = space_id;
}

if (restore_from_doublewrite()) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/fsp0file.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Datafile {
@param space_id space id to validate for recovery
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
m_is_valid is also set true on success, else false. */
dberr_t validate_for_recovery(ulint *space_id=nullptr)
dberr_t validate_for_recovery(uint32_t space_id=0)
MY_ATTRIBUTE((warn_unused_result));

/** Checks the consistency of the first page of a datafile when the
Expand Down

0 comments on commit e0e24b1

Please sign in to comment.