Skip to content

Commit 6979d20

Browse files
committed
MDEV-14499 Mariabackup 10.2 fails to back up a multi-file InnoDB system tablespace
When Mariabackup is invoked on an instance that uses a multi-file InnoDB system tablespace, it may fail to other files of the system tablespace than the first one. This was revealed by the MDEV-14447 test case. The offending code is assuming that the first page of each data file is page 0. But, in multi-file system tablespaces that is not the case. xb_fil_cur_open(): Instead of re-reading the first page of the file, rely on the fil_space_t metadata that already exists in memory. xb_get_space_flags(): Remove.
1 parent 5915036 commit 6979d20

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

extra/mariabackup/fil_cur.cc

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -212,24 +212,7 @@ xb_fil_cur_open(
212212

213213
posix_fadvise(cursor->file, 0, 0, POSIX_FADV_SEQUENTIAL);
214214

215-
/* Determine the page size */
216-
ulint flags = xb_get_space_flags(cursor->file);
217-
if (flags == ULINT_UNDEFINED) {
218-
xb_fil_cur_close(cursor);
219-
return(XB_FIL_CUR_SKIP);
220-
}
221-
222-
if (!fsp_flags_is_valid(flags, cursor->space_id)) {
223-
ulint cflags = fsp_flags_convert_from_101(flags);
224-
if (cflags == ULINT_UNDEFINED) {
225-
msg("[%02u] mariabackup: Error: Invalid "
226-
"tablespace flags: %x.\n", thread_n, uint(flags));
227-
return(XB_FIL_CUR_SKIP);
228-
}
229-
flags = cflags;
230-
}
231-
232-
const page_size_t page_size(flags);
215+
const page_size_t page_size(cursor->node->space->flags);
233216
cursor->page_size = page_size;
234217

235218
/* Allocate read buffer */

extra/mariabackup/xtrabackup.cc

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,28 +2137,6 @@ check_if_skip_table(
21372137
return(FALSE);
21382138
}
21392139

2140-
/** @return the tablespace flags from a given data file
2141-
@retval ULINT_UNDEFINED if the file is not readable */
2142-
ulint xb_get_space_flags(pfs_os_file_t file)
2143-
{
2144-
byte *buf;
2145-
byte *page;
2146-
ulint flags;
2147-
2148-
buf = static_cast<byte *>(malloc(2 * UNIV_PAGE_SIZE));
2149-
page = static_cast<byte *>(ut_align(buf, UNIV_PAGE_SIZE));
2150-
2151-
if (os_file_read(IORequestRead, file, page, 0, UNIV_PAGE_SIZE)) {
2152-
flags = fsp_header_get_flags(page);
2153-
} else {
2154-
flags = ULINT_UNDEFINED;
2155-
}
2156-
2157-
free(buf);
2158-
2159-
return(flags);
2160-
}
2161-
21622140
const char*
21632141
xb_get_copy_action(const char *dflt)
21642142
{

extra/mariabackup/xtrabackup.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ void xtrabackup_io_throttling(void);
149149
my_bool xb_write_delta_metadata(const char *filename,
150150
const xb_delta_info_t *info);
151151

152-
/** @return the tablespace flags from a given data file
153-
@retval ULINT_UNDEFINED if the file is not readable */
154-
ulint xb_get_space_flags(pfs_os_file_t file);
155-
156152
/************************************************************************
157153
Checks if a table specified as a name in the form "database/name" (InnoDB 5.6)
158154
or "./database/name.ibd" (InnoDB 5.5-) should be skipped from backup based on

0 commit comments

Comments
 (0)