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

lock_print_info_summary() should work even when trx_sys.mutex is locked

    XMLWordPrintable

Details

    Description

      The lock_print_info_summary() function currently requires trx_sys.mutex, since it calls the trx_sys_get_max_trx_id() function.

      https://github.com/mariadb/server/blob/mariadb-10.2.30/storage/innobase/lock/lock0lock.cc#L4910

      https://github.com/MariaDB/server/blob/mariadb-10.2.30/storage/innobase/include/trx0sys.ic#L400

      This causes a couple different problems:

      1.) This means that SHOW ENGINE INNODB STATUS will hang if it can't lock trx_sys.mutex.

      2.) If there is a long semaphore wait on trx_sys.mutex, then the sync_array_print_long_waits() function will be called, which will set srv_print_innodb_monitor. This will cause the InnoDB monitor thread to call the lock_print_info_summary() function, so that the InnoDB status information will be written to the error log. If the lock_print_info_summary() function requires trx_sys.mutex, then the monitor thread will not be able to write the InnoDB status information to the error log.

      https://github.com/MariaDB/server/blob/mariadb-10.2.30/storage/innobase/sync/sync0arr.cc#L1081

      https://github.com/MariaDB/server/blob/mariadb-10.2.30/storage/innobase/srv/srv0srv.cc#L1756

      Both of the above problems cause issues when users are attempting to diagnose long semaphore waits on trx_sys.mutex.

      Maybe the lock_print_info_summary() function should print dirty data with a warning if it can't lock trx_sys.mutex?

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              8 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.