Skip to content

Commit

Permalink
MDEV-28977: mariabackup.huge_lsn,strict_full_crc32 fails in 10.8
Browse files Browse the repository at this point in the history
recv_sys_t::recover_deferred(): Hold the exclusive page latch until
the tablespace has been set up. Otherwise, the write of the page
may be lost due to non-existent tablespace. This race only affects
the recovery of the first page in a newly created tablespace.

This race condition was introduced in MDEV-24626.
  • Loading branch information
dr-m committed Jun 29, 2022
1 parent 2fa3ada commit c1e3fc0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions storage/innobase/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -946,17 +946,13 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
(fil_space_t::zip_size(flags),
page), size);
if (!space)
{
block->page.lock.x_unlock();
goto fail;
}
goto release_and_fail;
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
block->page.lock.x_unlock();
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
node->deferred= true;
if (!space->acquire())
goto fail;
goto release_and_fail;
fil_names_dirty(space);
const bool is_compressed= fil_space_t::is_compressed(flags);
#ifdef _WIN32
Expand All @@ -973,14 +969,16 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
~4095ULL, is_sparse))
{
space->release();
goto fail;
goto release_and_fail;
}
node->deferred= false;
space->release();
it->second.space= space;
block->page.lock.x_unlock();
return false;
}

release_and_fail:
block->page.lock.x_unlock();
}

Expand Down

0 comments on commit c1e3fc0

Please sign in to comment.