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

Possible race condition between statistics and bulk insert

Details

    Description

      This issue was found during the testing of MDEV-24621, by an intermittent failure of the test innodb.insert_into_empty. The failure occurred during the ROLLBACK of an INSERT into a table that was empty.

      I was not able to repeat a failure on 10.6, but I think that a similar race condition is present. When we are computing statistics for an index tree, we failed to check whether an insert into an empty table is in progress by an active transaction. If yes, we should do what MVCC reads do: pretend that the table is empty.

      No crash or other problem is known in the current 10.6 or in 10.7, but I think that it is better to treat this situation in a safe and consistent manner.

      Attachments

        Issue Links

          Activity

            After conducting some research and developing a fix, I do think any ill effects of this are unlikely before MDEV-24621. With MDEV-24621, it is a completely different matter, because the B-tree could be in internally inconsistent state while the bulk index creation is in progress.

            Nevertheless, it is good to avoid unnecessary work and avoid statistics recomputation while we know that a bulk insert is in progress.

            marko Marko Mäkelä added a comment - After conducting some research and developing a fix, I do think any ill effects of this are unlikely before MDEV-24621 . With MDEV-24621 , it is a completely different matter, because the B-tree could be in internally inconsistent state while the bulk index creation is in progress. Nevertheless, it is good to avoid unnecessary work and avoid statistics recomputation while we know that a bulk insert is in progress.

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.