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

Set innodb_adaptive_hash_index=OFF by default

Details

    Description

      Based on the performance testing that was conducted in MDEV-17492, the InnoDB adaptive hash index could only help performance in specific, almost-read-only workloads. It could slow down all kinds of workloads (especially DROP TABLE, TRUNCATE TABLE, ALTER TABLE, or DROP INDEX operations), and it can become corrupted, causing crashes (such as MDEV-18815, MDEV-20203) and possibly data corruption. Furthermore, the adaptive hash index consumes space from the InnoDB buffer pool, which could hurt performance when the working set would almost fit in the buffer pool.

      Given all this, it is best to disable the adaptive hash index.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]

            As observed in MDEV-19613, the adaptive hash index can significantly improve read performance in a scenario where there are relatively short bursts of writes interleaved with long periods of read-mostly access. For this reason, we probably should keep the adaptive hash index.

            However, according to MDEV-17492, in cases where reads and writes are interleaved more evenly, the adaptive hash index does not help. That (and the known open bugs) is why we will disable the adaptive hash index by default in MariaDB Server 10.5.

            marko Marko Mäkelä added a comment - As observed in MDEV-19613 , the adaptive hash index can significantly improve read performance in a scenario where there are relatively short bursts of writes interleaved with long periods of read-mostly access. For this reason, we probably should keep the adaptive hash index. However, according to MDEV-17492 , in cases where reads and writes are interleaved more evenly, the adaptive hash index does not help. That (and the known open bugs) is why we will disable the adaptive hash index by default in MariaDB Server 10.5.
            marko Marko Mäkelä made changes -
            Summary Remove the InnoDB adaptive hash index Set innodb_adaptive_hash_index=OFF by default
            marko Marko Mäkelä made changes -
            Description Based on the performance testing that was conducted in MDEV-17492, the InnoDB adaptive hash index could only help performance in specific, almost-read-only workloads. It could slow down all kinds of workloads (especially {{DROP TABLE}}, {{TRUNCATE TABLE}}, {{ALTER TABLE}}, or {{DROP INDEX}} operations), and it can become corrupted, causing crashes (such as MDEV-18815, MDEV-20203) and possibly data corruption. Furthermore, the adaptive hash index consumes space from the InnoDB buffer pool, which could hurt performance when the working set would almost fit in the buffer pool.

            Given all this, it is best to remove the adaptive hash index. For now, we will change the default value of the build option {{WITH_INNODB_AHI}} to {{OFF}} and adjust tests.
            Based on the performance testing that was conducted in MDEV-17492, the InnoDB adaptive hash index could only help performance in specific, almost-read-only workloads. It could slow down all kinds of workloads (especially {{DROP TABLE}}, {{TRUNCATE TABLE}}, {{ALTER TABLE}}, or {{DROP INDEX}} operations), and it can become corrupted, causing crashes (such as MDEV-18815, MDEV-20203) and possibly data corruption. Furthermore, the adaptive hash index consumes space from the InnoDB buffer pool, which could hurt performance when the working set would almost fit in the buffer pool.

            Given all this, it is best to disable the adaptive hash index.
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2019-10-23 20:01:32.0 2019-10-23 20:01:32.163
            marko Marko Mäkelä made changes -
            Fix Version/s 10.5.0 [ 23709 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -

            MDEV-20487-Remove-the-InnoDB-adaptive-hash-index.patch is based on 10.5 1c022aaf584e69531765ec6be97012ecf1252f5c and would change the build-time option to WITH_INNODB_AHI=OFF, to stop building the adaptive hash index by default. We might choose to apply it at a later time.

            marko Marko Mäkelä added a comment - MDEV-20487-Remove-the-InnoDB-adaptive-hash-index.patch is based on 10.5 1c022aaf584e69531765ec6be97012ecf1252f5c and would change the build-time option to WITH_INNODB_AHI=OFF , to stop building the adaptive hash index by default. We might choose to apply it at a later time.

            MDEV-22646 could cause corruption of the buffer pool after the buffer pool has been resized.

            marko Marko Mäkelä added a comment - MDEV-22646 could cause corruption of the buffer pool after the buffer pool has been resized.
            marko Marko Mäkelä made changes -
            sushma1 sushma k added a comment -

            Hi Marko,

            I understand to enable adaptive hash index the option is --innodb_adaptive_hash_index and to disable them the
            option is --skip-innodb_adaptive_hash_index.

            Can you please confirm if these settings will be persistent across boot and if not, is there any other way to achieve
            the same.

            sushma1 sushma k added a comment - Hi Marko, I understand to enable adaptive hash index the option is --innodb_adaptive_hash_index and to disable them the option is --skip-innodb_adaptive_hash_index. Can you please confirm if these settings will be persistent across boot and if not, is there any other way to achieve the same.
            danblack Daniel Black added a comment -

            Put these without – prefix in your confiugraiton file under section read by mariadb and they will be re-read on restart.

            danblack Daniel Black added a comment - Put these without – prefix in your confiugraiton file under section read by mariadb and they will be re-read on restart.
            sushma1 sushma k added a comment -

            Thank you Daniel Black for the reply. So we need to place it in my.cfg file the below lines:
            skip-innodb_adaptive_hash_index

            sushma1 sushma k added a comment - Thank you Daniel Black for the reply. So we need to place it in my.cfg file the below lines: skip-innodb_adaptive_hash_index
            danblack Daniel Black added a comment -

            yes

            danblack Daniel Black added a comment - yes
            sushma1 sushma k added a comment -

            Hi Daniel,

            Is there any way that i can check if the innodb_adaptive_hash_index is enabled or not ? by using any cli command.

            sushma1 sushma k added a comment - Hi Daniel, Is there any way that i can check if the innodb_adaptive_hash_index is enabled or not ? by using any cli command.
            danblack Daniel Black added a comment -

            yes. `show global variables like 'innodb_adaptive_hash_index'`.

            Please use https://dba.stackexchange.com/ or https://mariadb.zulipchat.com for further questions. This site isn't a support forum.

            danblack Daniel Black added a comment - yes. `show global variables like 'innodb_adaptive_hash_index'`. Please use https://dba.stackexchange.com/ or https://mariadb.zulipchat.com for further questions. This site isn't a support forum.
            sushma1 sushma k added a comment -

            Okay Thank you .

            sushma1 sushma k added a comment - Okay Thank you .
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 99397 ] MariaDB v4 [ 134082 ]
            marko Marko Mäkelä made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            marko Marko Mäkelä made changes -

            People

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