Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2.31
Description
Looks as if some cases of InnoDB index inconsistencies – see e.g. MDEV-22373 – are missed by CHECK TABLE.
InnoDB currently ignores any other CHECK TABLE attributes than QUICK (which will suppress the time-consuming checks of the upper levels of the index trees).
Most importantly, InnoDB is ignoring the attribute EXTENDED, and is essentially only performing a MVCC COUNT(*) in each index. A verified case exists where the record counts in the indexes would match, yet the records do not match between the indexes. A true EXTENDED check should report any mismatch between the clustered index (primary key) and the secondary index records.
Note: By the design of InnoDB MVCC (see MDEV-17598 for some discussion), secondary indexes may contain multiple copies of a record, while in the clustered index the multiple versions are formed via a singly-linked list that the undo log pages are part of.
An extremely extended test would have to check that in any possible read view, the secondary indexes match the clustered index, instead of only checking the current read view.
It may turn out that only a special ‘locking’ variant of CHECK TABLE would be able to detect truly any type of mismatch.
Attachments
Issue Links
- blocks
-
MDEV-28349 Provide "crash safe" options for CHECK TABLE and ALTER TABLE ... CHECK PARTITION ...
-
- Open
-
- causes
-
MDEV-29886 Assertion `!index->table->is_temporary()' failed in trx_undo_prev_version_build upon CHECK
-
- Closed
-
-
MDEV-29978 Corruption errors upon CHECK on temporary InnoDB table
-
- Closed
-
-
MDEV-35227 Executing CHECK TABLE...EXTENDED right after server startup may attempt to access too old history
-
- Confirmed
-
- relates to
-
MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows
-
- Closed
-
-
MDEV-29593 Purge misses a chance to free not-yet-reused undo pages
-
- Closed
-
-
MDEV-29666 InnoDB fails to purge secondary index records when indexed virtual columns exist
-
- Closed
-
-
MDEV-29823 Secondary index records may never be purged after rollback
-
- Confirmed
-
-
MDEV-36612 Implement CHECK TABLE…EXTENDED for SPATIAL INDEX
-
- Open
-
-
MDEV-9663 InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX, or !cursor->index->is_committed()
-
- Closed
-
-
MDEV-11802 innodb.innodb_bug14676111 fails in buildbot due to InnoDB purge failing to start when there is work to do
-
- Closed
-
-
MDEV-22373 Unable to find a record to delete-mark ends up crashing mysqld process after upgrading from 10.1.43 to 10.4
-
- Closed
-
-
MDEV-29954 Unique hash key on column prefix is computed incorrectly
-
- Closed
-
-
MDEV-30129 MySQL 5.7 --> MariaDB 10.8 switch: mysqlcheck --check --extended hangs on table
-
- Closed
-
Activity
Link |
This issue relates to |
Description |
Looks as if some cases of InnoDB index inconsistencies -- see e.g. |
Looks as if some cases of InnoDB index inconsistencies -- see e.g. InnoDB currently ignores any other {{CHECK TABLE}} attributes than {{QUICK}} (which will suppress the time-consuming checks of the upper levels of the index trees). Most importantly, InnoDB is ignoring the attribute {{EXTENDED}}, and is essentially only performing a MVCC {{COUNT\(*\)}} in each index. A verified case exists where the record counts in the indexes would match, yet the records do not match between the indexes. A true {{EXTENDED}} check should report any mismatch between the clustered index (primary key) and the secondary index records. Note: By the design of InnoDB MVCC (see MDEV-17598 for some discussion), secondary indexes may contain multiple copies of a record, while in the clustered index the multiple versions are formed via a singly-linked list that the undo log pages are part of. An extremely extended test would have to check that in any possible read view, the secondary indexes match the clustered index, instead of only checking the current read view. It may turn out that only a special ‘locking’ variant of {{CHECK TABLE}} would be able to detect truly any type of mismatch. |
Labels | check corruption |
Assignee | Marko Mäkelä [ marko ] |
Fix Version/s | 10.2 [ 14601 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Link |
This issue relates to |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Assignee | Marko Mäkelä [ marko ] | Thirunarayanan Balathandayuthapani [ thiru ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Workflow | MariaDB v3 [ 116857 ] | MariaDB v4 [ 144579 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Assignee | Thirunarayanan Balathandayuthapani [ thiru ] | Marko Mäkelä [ marko ] |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] |
Fix Version/s | 10.2 [ 14601 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Link | This issue is blocked by MDEV-22718 [ MDEV-22718 ] |
Link | This issue is blocked by MDEV-22718 [ MDEV-22718 ] |
Link |
This issue relates to |
Link |
This issue relates to |
Link | This issue relates to MDEV-29823 [ MDEV-29823 ] |
Assignee | Marko Mäkelä [ marko ] | Vladislav Lesin [ vlad.lesin ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Vladislav Lesin [ vlad.lesin ] | Marko Mäkelä [ marko ] |
issue.field.resolutiondate | 2022-10-21 07:46:57.0 | 2022-10-21 07:46:57.117 |
Fix Version/s | 10.6.11 [ 28441 ] | |
Fix Version/s | 10.7.7 [ 28442 ] | |
Fix Version/s | 10.8.6 [ 28443 ] | |
Fix Version/s | 10.9.4 [ 28444 ] | |
Fix Version/s | 10.10.2 [ 28410 ] | |
Fix Version/s | 10.11.1 [ 28454 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue causes |
Link | This issue blocks MDEV-28349 [ MDEV-28349 ] |
Link |
This issue causes |
Link |
This issue relates to |
Link |
This issue causes |
Link |
This issue causes |
Link |
This issue relates to |
Link |
This issue relates to |
Zendesk Related Tickets | 187185 138029 |
Link | This issue causes MDEV-35227 [ MDEV-35227 ] |
Link | This issue relates to MDEV-36612 [ MDEV-36612 ] |
CHECK TABLE…QUICK currently essentially performs SELECT COUNT(*) in each index of the table, using concurrent read, and complains if the counts differ.
MDEV-25459was a bug in the MVCC implementation of secondary indexes that would also cause false alarms in CHECK TABLE.CHECK TABLE without any attributes or with any other attributes than QUICK would be the same, but additionally check all pointers in the non-leaf pages of the index trees.