Details
Description
mariabackup may overlook file corruptions as shown in steps below:
1. Start MySQL Server with Encryption enabled
2. Create tables, insert data as below:
use test; |
create table t(a varchar(128)) engine=innodb; |
create table t1(a varchar(128)) engine=innodb; |
insert into t select repeat('a',100); |
insert into t1 select repeat('a',100); |
3. Wait some time to make sure that all pages are flushed and query below shows 0 dirty pages:
SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_dirty'; |
4. Corrupt t.ibd with commands below (replace data_directory with actual data directory):
cd data_directory |
printf '\xAA\xAA\xAA\xAA' | dd of=test/t.ibd seek=16384 count=4 bs=1 conv=notrunc |
5. Create backup , observe no errors :
170223 09:53:10 [01] Copying ./test/t.ibd to /bkup/test/t.ibd
|
170223 09:53:10 [01] ...done
|
..
|
170223 09:53:14 completed OK!
|
6. Check table with innochecksum to confirm that it is really corrupted:
> innochecksum dt/test/t.ibd |
InnoDB offline file checksum utility. |
Table is uncompressed
|
Page size is 16384
|
Fail; page 1 invalid (fails old style checksum)
|
7. (optional) make sure innochecksum doesn't complain about the other table t1:
innochecksum test/t1.ibd |
Without rest encryption the same steps result in backup error:
170223 10:17:22 [01] Copying ./test/t.ibd to /bkup/test/t.ibd
|
[01] xtrabackup: Database page corruption detected at page 1, retrying...
|
...
|
[01] xtrabackup: Error: failed to read page after 10 retries. File ./test/t.ibd seems to be corrupted.
|
[01] xtrabackup: Error: xtrabackup_copy_datafile() failed.
|
[01] xtrabackup: Error: failed to copy datafile.
|
xtrabackup based on MariaDB server 10.1.22-MariaDB Linux (x86_64)
|
...
|
xtrabackup: Error: cannot open ./xtrabackup_checkpoints
|
xtrabackup: Error: failed to read metadata from './xtrabackup_checkpoints'
|
Attachments
Issue Links
- causes
-
MDEV-18105 Mariabackup fails to copy encrypted InnoDB system tablespace if LSN>4G
-
- Closed
-
-
MDEV-34772 Overuse of big stackvariables results in stackoverflows
-
- Stalled
-
- is duplicated by
-
MDEV-20983 Page 38:4016 may be corrupted. Post encryption checksum 3690179534 stored
-
- Closed
-
- relates to
-
MDEV-18025 Mariabackup fails to detect corrupted page_compressed=1 tables
-
- Closed
-
-
MDEV-18097 Indicate which InnoDB data files are zero-initialized
-
- Closed
-
-
MDEV-18128 Simplify .ibd file creation
-
- Closed
-
-
MDEV-18129 Backup fails for encrypted tables: mariabackup: Database page corruption detected at page 1
-
- Closed
-
-
MDEV-12711 backup may show corruption with custom innodb_data_file_path
-
- Closed
-
-
MDEV-13542 Crashing on a corrupted page is unhelpful
-
- Closed
-
-
MDEV-17638 Improve error message about corruption of encrypted page
-
- Closed
-
-
MDEV-18529 InnoDB wrongly skips decryption of encrypted page if unencrypted and post-encrypted checksums match
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 10.1 [ 16100 ] |
Affects Version/s | 10.2.9 [ 22611 ] | |
Affects Version/s | 10.1.28 [ 22610 ] |
Fix Version/s | 10.2 [ 14601 ] |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Assignee | Jan Lindström [ jplindst ] | Thirunarayanan Balathandayuthapani [ thiru ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Comment |
[ {code}
266 xb_fil_cur_result_t 267 xb_fil_cur_read( 268 /*============*/ 269 xb_fil_cur_t* cursor) /*!< in/out: source file cursor */ ................. ............. ................ 342 /* check pages for corruption and re-read if necessary. i.e. in case of 343 partially written pages */ 344 for (page = cursor->buf, i = 0; i < npages; 345 page += page_size, i++) { 346 ulint page_no = cursor->buf_page_no + i; 347 348 if (cursor->space_id == TRX_SYS_SPACE && 349 page_no >= FSP_EXTENT_SIZE && 350 page_no < FSP_EXTENT_SIZE * 3) { 351 /* We ignore the doublewrite buffer pages */ 352 } else if (!fil_space_verify_crypt_checksum( 353 page, cursor->page_size, space->id, page_no) 354 && buf_page_is_corrupted(true, page, 355 cursor->page_size, 356 space)) { {code} Basically mariabackup checks whether it is un-encrypted and corrupted. It blindly reads the encrypted page and doesn't check whether the page is corrupted. ] |
Link |
This issue relates to |
Assignee | Thirunarayanan Balathandayuthapani [ thiru ] | Marko Mäkelä [ marko ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
issue.field.resolutiondate | 2018-12-14 14:25:31.0 | 2018-12-14 14:25:31.121 |
Fix Version/s | 10.4.1 [ 23228 ] | |
Fix Version/s | 10.1.38 [ 23209 ] | |
Fix Version/s | 10.2.20 [ 23212 ] | |
Fix Version/s | 10.3.12 [ 23214 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue causes |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue is duplicated by |
Workflow | MariaDB v3 [ 79727 ] | MariaDB v4 [ 151740 ] |
Link | This issue causes MDEV-34772 [ MDEV-34772 ] |
added 10.2 to version list, still relevant in current 10.1