MDEV-25967: Correctly extend deferred-recovery files

recv_sys_t::recover_deferred(): Set the file size to match the number
of pages. Mariabackup might copy the file while it was being extended.
This commit is contained in:
Marko Mäkelä 2021-06-23 13:37:11 +03:00
parent 592a925c0c
commit b3e8788009

View file

@ -837,13 +837,18 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
block->unfix();
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
node->deferred= true;
if (space->acquire())
if (!space->acquire())
goto fail;
if (!os_file_set_size(node->name, node->handle,
size * fil_space_t::physical_size(flags),
space->is_compressed()))
{
node->deferred= false;
space->release();
return false;
goto fail;
}
goto fail;
node->deferred= false;
space->release();
return false;
}
block->unfix();