[MDEV-14499] Mariabackup 10.2 fails to back up a multi-file InnoDB system tablespace Created: 2017-11-24  Updated: 2017-11-24  Resolved: 2017-11-24

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.2.7, 10.3.1
Fix Version/s: 10.2.11, 10.3.3

Type: Bug Priority: Blocker
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: backup

Issue Links:
Blocks
blocks MDEV-14447 mariabackup --incremental --prepare f... Closed
Problem/Incident
is caused by MDEV-12548 Add maria backup tool to MariaDB 10.2 Closed

 Description   

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. It turns out that we should just rely on the metadata that already exists in memory:

diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index e0f0df72611..f6e6fe43085 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -212,24 +212,7 @@ xb_fil_cur_open(
 
 	posix_fadvise(cursor->file, 0, 0, POSIX_FADV_SEQUENTIAL);
 
-	/* Determine the page size */
-	ulint	flags = xb_get_space_flags(cursor->file);
-	if (flags == ULINT_UNDEFINED) {
-		xb_fil_cur_close(cursor);
-		return(XB_FIL_CUR_SKIP);
-	}
-
-	if (!fsp_flags_is_valid(flags, cursor->space_id)) {
-		ulint cflags = fsp_flags_convert_from_101(flags);
-		if (cflags == ULINT_UNDEFINED) {
-			msg("[%02u] mariabackup: Error: Invalid "
-			    "tablespace flags: %x.\n", thread_n, uint(flags));
-			return(XB_FIL_CUR_SKIP);
-		}
-		flags = cflags;
-	}
-
-	const page_size_t page_size(flags);
+	const page_size_t page_size(cursor->node->space->flags);
 	cursor->page_size = page_size;
 
 	/* Allocate read buffer */


Generated at Thu Feb 08 08:14:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.