[MDEV-11939] innochecksum mistakes a file for an encrypted one (page 0 invalid) Created: 2017-01-30 Updated: 2023-11-29 Resolved: 2017-08-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1.21 |
| Fix Version/s: | 10.1.26, 10.2.8 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jean Weisbuch | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | innochecksum | ||
| Environment: |
Debian Wheezy amd64 |
||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | 10.1.22, 10.2.6-2, 10.2.6-3 | ||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
innochecksum returns an error message when ran on ibdata1 on a server that is working fine (a check on all tables has been done without finding anything) :
This server was previously running on 10.0 and was just upgraded to 10.1 and it is not using tablespace encryption. |
| Comments |
| Comment by Marko Mäkelä [ 2017-01-30 ] | ||||||||||||||||||
|
jb-boin Which 10.1 version was the 10.0 server upgraded to, and which version of innochecksum was invoked? | ||||||||||||||||||
| Comment by Jean Weisbuch [ 2017-01-30 ] | ||||||||||||||||||
|
It was previously running 10.0.29-MariaDB-1~wheezy.
The innodb_page_size value has never been modified on this server. | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-01-30 ] | ||||||||||||||||||
|
Can you attach the first 16384 bytes of the ibdata1 file?
| ||||||||||||||||||
| Comment by Jean Weisbuch [ 2017-01-30 ] | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-01-30 ] | ||||||||||||||||||
|
I can repeat the failure with the attached file and with the Debian 9.0 packaged innochecksum (mariadb-server-core-10.1). Curiously, the 10.2 innochecksum is silent, but that is probably due to an unrelated issue: because the FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION field is nonzero (it contains the shutdown LSN), the 10.2 innochecksum wrongly thinks that the file is encrypted and does not report anything. The cause must be something else than | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-01-30 ] | ||||||||||||||||||
|
According to jplindst, the innochecksum fix in 10.2 is waiting for | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-01-31 ] | ||||||||||||||||||
|
Because the field FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION is not protected by the page checksum, I did a simple experiment, zeroing out the field:
After I zeroed out the FLUSH_LSN field, the 10.1 innochecksum will treat the page as valid. | ||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-03-13 ] | ||||||||||||||||||
|
I used attached page to verify that we do not anymore mistake. https://github.com/MariaDB/server/commit/43815fe08fecd4dcdb45c71e2d0906b91ab0ea9d | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-03-13 ] | ||||||||||||||||||
|
Please submit the 10.2 patch as well. In 10.2, the bug is different: a corrupted (unencrypted) page is not reported as such, provided that the FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION field is nonzero. | ||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-08-03 ] | ||||||||||||||||||
|
10.1: commit 8b019f87dd51b1d2755655d2f136d5429fc47e1f Always read full page 0 to determine does tablespace contain buf_page_is_checksum_valid_crc32 buf_page_is_corrupted fil0crypt.cc fil0crypt.h univ.i page_zip_verify_checksum innochecksum.cc Added test case where we corrupt intentionally | ||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-08-08 ] | ||||||||||||||||||
|
10.2: commit 34eef269eb93ee42c0e5e1894781c61f66cb6f14 Always read full page 0 to determine does tablespace contain buf_page_is_checksum_valid_crc32 fil0crypt.cc fil0crypt.h univ.i page_zip_verify_checksum innochecksum.cc Added test case where we corrupt intentionally |