Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24402

CHECK TABLE may miss some cases of index inconsistencies

Details

    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

          Activity

            Transition Time In Source Status Execution Times
            Julien Fritsch made transition -
            Open Confirmed
            254d 20h 19m 1
            Thirunarayanan Balathandayuthapani made transition -
            Confirmed In Progress
            39d 20h 27m 1
            Thirunarayanan Balathandayuthapani made transition -
            In Progress Stalled
            194d 20h 3m 1
            Marko Mäkelä made transition -
            Stalled In Progress
            150d 52m 1
            Marko Mäkelä made transition -
            In Progress In Review
            35d 6h 23m 1
            Vladislav Lesin made transition -
            In Review Stalled
            16h 23m 1
            Marko Mäkelä made transition -
            Stalled Closed
            1h 3m 1

            People

              marko Marko Mäkelä
              hholzgra Hartmut Holzgraefe
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.