[MDEV-12711] backup may show corruption with custom innodb_data_file_path Created: 2017-05-06 Updated: 2020-08-25 Resolved: 2019-03-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup, mariabackup |
| Affects Version/s: | 10.1.23, 10.1.34, 10.2 |
| Fix Version/s: | 10.2.24, 10.1.39, 10.3.14, 10.4.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Andrii Nikitin (Inactive) | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Description |
|
E.g. backup of initial database in 10.1.23 with is showing corruption :
Full output:
|
| Comments |
| Comment by Marko Mäkelä [ 2017-05-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think that this is a design problem of the MariaDB encryption. In MySQL 5.7, the field was repurposed for FIL_RTREE_SPLIT_SEQ_NUM. This is the reason why MariaDB 10.2 will not support encryption in SPATIAL INDEX ( The problem here appears to be that xtrabackup is incorrectly mistaking the first page of the second data file of the system tablespace for an encrypted one, because the FIL_PAGE_FILE_FLUSH_LSN field is not 0. In xtrabackup, we should add a check that FIL_PAGE_FILE_FLUSH_LSN can be nonzero in an unencrypted system tablespace. Also, MariaDB 10.1 should probably stop writing FIL_PAGE_FILE_FLUSH_LSN at shutdown to the first page of other than the first system tablespace file (10.2 already stopped this because of the SPATIAL INDEX mentioned above), so that it will not make an encrypted page unaccessible by corrupting the encryption key ID. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2017-07-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just a note that this is still valid bug and with fix of
10.2 passes for innodb_page_size=16k , but innodb_page_size=32k fails with this error message (maybe related to
Let me know if this needs another bug report for such output in 10.2 or it will be fixed as part of this bug:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-07-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This should be fixed by | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2017-10-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've reopened | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Was this bug not fixed in Mariabackup 10.1.38 and 10.2.22 by | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I attempted to repeat this bug in 10.1.34 but failed. I hope that the issue will be repeatable by slightly modifying my attempts below. Note: MariaDB before 10.1.25 ( The first part of my patch is attempting to rewrite some dummy value to the FIL_PAGE_FILE_FLUSH_LSN field of the first page of the second data file. The test does not fail with mariadb-10.1.34, like I would have expected. The second part of the patch is writing that field in the clustered index root page of an .ibd file, and also that test fails to fail.
I think that we may have to analyze strace output to determine which exact page is being rejected, to rule out misleading diagnostic messages. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can repeat the problem. I checked out and build mariadb-10.1.23 release build. I run mysql_install_db script to empty datadir with my.cnf containing only innodb-data-file-path=ibdata1:10M;ibdata2:5M:autoextend (so no encryption configured or enabled). I checkout out mariadb-10.1.34 and build it release build. I started mysqld on datadir and mariabackup and received similar error messages as described above. I emptied backup directory and checket out latest 10.1 and build again release build. I see still :
Note that ibdata2 file can't be encrypted if there is no encryption metadata on ibdata1 file page 0. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Attached full datadir with my config. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can repeat this by ensuring that the first page of the second data file will be all zero:
A newer Mariabackup would actually dump the corrupted page:
|