MDEV-29282 atomic.rename_trigger fails occasionally

This reverts part of commit 212994f704496d01881f377e34e04bd007e5e298
(MDEV-28974) and implements a better fix that works in that special case
while avoiding other failures.

fil_name_process(): Do not rename the tablespace in deferred_spaces;
it already contains the latest name for the space id.

deferred_spaces::create(): In mariadb-backup --prepare,
replace absolute data directory file path with short name
relative to the backup directory and store it as filename while
deferring tablespace file creation.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2022-08-18 16:21:31 +05:30 committed by Marko Mäkelä
parent 01f9c81237
commit 4feb9df105
2 changed files with 23 additions and 17 deletions

View File

@ -1,13 +0,0 @@
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################
rename_trigger : MDEV-29282 atomic.rename_trigger fails occasionly

View File

@ -829,7 +829,29 @@ processed:
fil_space_t *space= fil_space_t::create(it->first, flags,
FIL_TYPE_TABLESPACE, crypt_data);
ut_ad(space);
space->add(name.c_str(), OS_FILE_CLOSED, size, false, false);
const char *filename= name.c_str();
if (srv_operation == SRV_OPERATION_RESTORE)
{
const char* tbl_name = strrchr(filename, '/');
#ifdef _WIN32
if (const char *last = strrchr(filename, '\\'))
{
if (last > tbl_name)
tbl_name = last;
}
#endif
if (tbl_name)
{
while (--tbl_name > filename &&
#ifdef _WIN32
*tbl_name != '\\' &&
#endif
*tbl_name != '/');
if (tbl_name > filename)
filename= tbl_name + 1;
}
}
space->add(filename, OS_FILE_CLOSED, size, false, false);
space->recv_size= it->second.size;
space->size_in_header= size;
return space;
@ -1227,9 +1249,6 @@ static void fil_name_process(const char *name, ulint len, uint32_t space_id,
d->deleted = true;
goto got_deleted;
}
if (ftype == FILE_RENAME) {
d->file_name= fname.name;
}
goto reload;
}