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

'show global status' can cause lock contention on LOCK_thread_count

    XMLWordPrintable

Details

    Description

      calc_sum_of_all_status() holds the LOCK_thread_count mutex for the whole duration of its calculations, which can take a while when having many active connections, so blocking other threads waiting on the same mutex.

      In MySQL 5.7 this is fixed by taking copies of relevant THD object data first (while holding the LOCK_thread_count), and only then doing the actual calculations after releasing the mutex again.

      See MySQL bug #42930 and changeset 034c40f4baeff1a1d2dd637f6a1f2c2720a4d26f

      https://bugs.mysql.com/bug.php?id=42930

      https://github.com/mysql/mysql-server/commit/034c40f4baeff1a1d2dd637f6a1f2c2720a4d26f

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              hholzgra Hartmut Holzgraefe
              Votes:
              3 Vote for this issue
              Watchers:
              10 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.