summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-29 15:48:44 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-29 15:48:44 +0300
commitc1e3fc0e0dcbc8275b46916fb5247e9e7635d072 (patch)
tree7bca4d5c401b554b9dfa7dca67512bfb87a06316
parent2fa3ada07202bfd8764cff0bf2e5bbf8a805f8c7 (diff)
downloadmariadb-git-c1e3fc0e0dcbc8275b46916fb5247e9e7635d072.tar.gz
MDEV-28977: mariabackup.huge_lsn,strict_full_crc32 fails in 10.8
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.
-rw-r--r--storage/innobase/log/log0recv.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index fa3b268cf2f..8d28eacb3ee 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -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
@@ -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();
}