[MDEV-22929] MariaBackup option to report and/or continue when corruption is encountered Created: 2020-06-17 Updated: 2021-04-13 Resolved: 2020-12-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | mariabackup |
| Fix Version/s: | 10.2.37, 10.3.28, 10.4.18, 10.5.9, 10.6.0 |
| Type: | Task | Priority: | Critical |
| Reporter: | Juan | Assignee: | Vladislav Lesin |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | corruption, mariabackup | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Currently Mariabackup aborts when it detects any InnoDB corruption. Needs an option to complete the backup and flag or log the corruption rather than leaving the entire server with no backup. In situations where Mariabackup detects corruption while taking a backup, it currently aborts where InnoDB would assert, making backing up a corrupted server impossible. This is obviously not practical when corruption in one table prevents making backups of the entire server. Would it be possible to address this need by adding a force option like innodb_focre_recovery=1 to mariabackup, for instance? ------------------- The new option --log-innodb-page-corruption is introduced. When this option is set, backup is not interrupted if innodb corrupted For incremental backup corrupted pages are also copied to .delta file, During --prepare, corrupted pages list is read from the file just after For incremental --prepare corrupted pages from .delta files are applied If DDL happens during backup, it is also processed at the end of backup |
| Comments |
| Comment by Vladislav Lesin [ 2020-08-20 ] |
|
|
| Comment by Vladislav Lesin [ 2020-08-20 ] |
|
I would not use mariabackup as a corruption detection tool. The backup tool must not be used for unintended purposes. We have another tools for it. CHECK TABLE, innochecksum, for example. It's better to add this functionality to one of those tools. See also this https://jira.mariadb.org/browse/MDEV-21109?focusedCommentId=160912&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-160912 comment. |
| Comment by Vladislav Lesin [ 2020-08-20 ] |
|
I have some doubts in necessity of such option implementation. This option can potentially lead to data inconsistency in restored data. We already have such dangerous option like --no-lock, which I would like to remove, because our customers use it, then ask us to find the problem in backup, while documentation says the option does not guarantee data consistency. I think, if we implement it, it will add work for support and engineering, as it will be harder to diagnose the issues. |
| Comment by Sergei Golubchik [ 2020-10-03 ] |
|
Not that it matters much, but the "corruption_found" flag seems a bit redundant. The sheer presence of the "backup_corrupted" file with the list of corrupted tables already means that the corruption was found, doesn't it? |
| Comment by Vladislav Lesin [ 2020-10-08 ] |
|
If we decide to implement it, then we could also check during --prepare if corrupted page is allocated or not in tablespace, and zero out it if it is not allocated, and does not treat it as corrupted page. In |
| Comment by Vladislav Lesin [ 2020-10-28 ] |
|
According to our discussion in slack, this and So we introduce new --log-innodb-pages-corruption. When this option is used, mariabackup do not stop backup process if innodb page corruption is detected, it continues backup and logs corrupted pages in "backup_corrupted" file in backup destination directory, after backup is taken, mariabackup finishes execution with error and error message in backup log. On --prepare phase, mariabackup checks each page from the list in "backup_corrupted" file, if the page is not allocated in the tablespace, it's zeroed out, flushed to data file, and removed from corrupted pages list, the corresponding message is logged to backup log(stdout). If all pages from the list were restored successfully with such a manner, "backup_corrupted" file is deleted and "mariabackup --prepare" returns success. Otherwise "backup_corrupted" file will contain list of pages, which were not restored, "mariabackup --prepare" will be finished with error and error message in backup log. |
| Comment by Vladislav Lesin [ 2020-11-22 ] |
|
I pushed bb-10.2- |
| Comment by Vladislav Lesin [ 2020-11-24 ] |
|
Testing looks good to me: https://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.2-MDEV-22929-log_corrupted_pages |
| Comment by Vladislav Vaintroub [ 2020-11-24 ] |
|
Looks fine. |
| Comment by Ian Gilfillan [ 2020-12-23 ] |
|
This needs to be documented - created |