Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5, 10.6, 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
CHECK TABLE needs to be able to detect at least the same corruption as innochecksum. This is necessary because the server must be stopped for innochecksum whereas CHECK TABLE does not.
This is related to MDEV-21109, but distinct in that MDEV-21109 is specific to mariabackup (at least per the "Component" field whereas this was a feature request to enhance CHECK TABLE.
Edit: Marko Mäkelä thinks that it is more feasible to improve innochecksum so that it will ignore data pages that have been marked freed in the tablespace files.
The innochecksum tool is mostly operating on single pages only and can only find pages with invalid checksum. CHECK TABLE can find more, such as broken links between B+ tree pages, or some inconsistency between B+ tree indexes.
Freed pages should never be accessed by the server, be it by CHECK TABLE or elsewhere. We do not want CHECK TABLE to load every page of the data file into the buffer pool, because that could make CHECK TABLE extremely slow for tables that are stored in the InnoDB system tablespace. Furthermore, loading freed pages to the buffer pool could cause MariaDB tablespace encryption to mark corrupted pages as dirty. We should simply tolerate corrupted pages that are freed.
As a further enhancement to innochecksum, we could implement an option that would zero out pages that have been marked as freed (similar to what MariaDB 10.5 would do if innodb_immediate_scrub_data_uncompressed=ON). That would also make data files compress better.
Note: innochecksum already includes a call to xdes_is_free(), but it is currently only invoked for the -S and -D options that output data on page types.
Attachments
Issue Links
- causes
-
MDEV-31641 innochecksum dies with Floating point exception
- Closed
- relates to
-
MDEV-21109 Table corruption not detected with CHECK TABLE or innochecksum, only with mariabackup
- Closed