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

Show InnoDB's internal background threads in SHOW ENGINE INNODB STATUS

Details

    Description

      InnoDB uses internal background threads for a few different things. For example:

      • It uses a background thread to update persistent statistics.
      • It uses one or more background threads (determined by innodb_encryption_threads) to encrypt/decrypt tables where ENCRYPTED=DEFAULT.

      https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_encryption_threads

      • It uses one or more background threads (determined by innodb_purge_threads) to purge unneeded undo logs.

      https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_purge_threads

      • It uses one or more background threads (determined by either innodb_mtflush_threads or innodb_page_cleaners) to flush dirty pages from the buffer pool.

      https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_mtflush_threads

      https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_page_cleaners

      • It uses one or more background threads (determined by innodb_read_io_threads) to read pages from disk.

      https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_read_io_threads

      • It uses one or more background threads (determined by innodb_write_io_threads) to write pages to disk.

      https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_write_io_threads

      • Supposedly it uses some kind of background thread to implement some kind of "DROP TABLE" queue (based on the comments of MDEV-8069).

      It would probably make sense to show some or all of these threads in SHOW ENGINE INNODB STATUS output, since they can hold semaphores and cause or exacerbate concurrency issues.

      Attachments

        Issue Links

          Activity

            Starting with MDEV-16264 in MariaDB Server 10.5, InnoDB uses fewer dedicated threads, and instead the work is being performed in tasks that are invoked by a thread pool where threads can be created and destroyed based on demand.

            The innodb_mtflush was removed in MariaDB 10.2, and 10.1 will soon reach its end of life.

            The background DROP TABLE is executed by the InnoDB master thread. Starting with 10.5, we no longer have change buffer merge in the background (MDEV-19514) or any background activity related to scrubbing (MDEV-15528, MDEV-21870).

            10.5 still uses dedicated page I/O threads as well as dedicated threads for the following:

            • page cleaner (at least until MDEV-16526)
            • recv_writer_thread for recovery, likely to be removed in MDEV-16526 or MDEV-14481
            • fil_crypt_thread for encryption key rotation (should be rewritten as task, and maybe optimized to prevent unnecessary writes)
            • trx_rollback_all_recovered for rolling back recovered incomplete transactions, until MDEV-21169 is fixed
            marko Marko Mäkelä added a comment - Starting with MDEV-16264 in MariaDB Server 10.5, InnoDB uses fewer dedicated threads, and instead the work is being performed in tasks that are invoked by a thread pool where threads can be created and destroyed based on demand. The innodb_mtflush was removed in MariaDB 10.2, and 10.1 will soon reach its end of life. The background DROP TABLE is executed by the InnoDB master thread. Starting with 10.5, we no longer have change buffer merge in the background ( MDEV-19514 ) or any background activity related to scrubbing ( MDEV-15528 , MDEV-21870 ). 10.5 still uses dedicated page I/O threads as well as dedicated threads for the following: page cleaner (at least until MDEV-16526 ) recv_writer_thread for recovery, likely to be removed in MDEV-16526 or MDEV-14481 fil_crypt_thread for encryption key rotation (should be rewritten as task, and maybe optimized to prevent unnecessary writes) trx_rollback_all_recovered for rolling back recovered incomplete transactions, until MDEV-21169 is fixed

            People

              marko Marko Mäkelä
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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