summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-08-18 16:21:31 +0530
committerMarko Mäkelä <marko.makela@mariadb.com>2022-08-23 08:47:59 +0300
commit4feb9df105158eab216395db36ad5387d09d5cea (patch)
tree65e82f686823a6acc4f4837b37d1f3954d33a1df
parent01f9c81237b1d096e3011a4af8d87d2ba81558a3 (diff)
downloadmariadb-git-4feb9df105158eab216395db36ad5387d09d5cea.tar.gz
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.
-rw-r--r--mysql-test/suite/atomic/disabled.def13
-rw-r--r--storage/innobase/log/log0recv.cc27
2 files changed, 23 insertions, 17 deletions
diff --git a/mysql-test/suite/atomic/disabled.def b/mysql-test/suite/atomic/disabled.def
deleted file mode 100644
index 6d8defe344a..00000000000
--- a/mysql-test/suite/atomic/disabled.def
+++ /dev/null
@@ -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
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 9b6f778b859..fc2d50da62c 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -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;
}