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

Large grain of dict_sys lock by table creation affects performance

    XMLWordPrintable

Details

    Description

      Our test guys tried to create tables with 500 concurrent sessions (each session 200 tables)and cause slow queries.
      I used pstack to inspect the stacks and found most threads are waiting for the mutex of global variable dict_sys

      I viewed the related codes in method
      ha_innobase::create
      and think the lock range is too large.

      row_mysql_lock_data_dictionary / row_mysql_unlock_data_dictionary between
      error = info.create_table(own_trx)

      In create_table_info_t::create_table, there are a lot of object allocation or simply setting members in those objects before attaching them to the cache of global variable dict_sys. IMO those steps don't require mutex of global dict.

      Would it be better if we make the mutex dict_sys fine-grained instead of locking whole process of create_table_info_t::create_table

      Attachments

        Issue Links

          Activity

            People

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