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

Do not hold mutex while calling que_graph_free()

Details

    Description

      Ever since InnoDB table cache eviction was implemented, it became necessary to invoke dict_table_close() to release table handles. Because this call requires the dict_sys->mutex to be held, the mutex currently needs to be held also while invoking que_graph_free(). This feels very inefficient and cumbersome. Could we streamline dict_table_close() further, so that no mutex is needed in this case? Note: dict_table_t::release() already uses atomic memory operations.

      Attachments

        Issue Links

          Activity

            MDEV-19505-WIP.patch is a starting point, against 10.4 as of this writing. It will crash at InnoDB startup because of a dict_table_close() call.

            marko Marko Mäkelä added a comment - MDEV-19505-WIP.patch is a starting point, against 10.4 as of this writing. It will crash at InnoDB startup because of a dict_table_close() call.

            This is about removing technical debt, or improving performance. Because I expect this to be a rather large change, I do not think that it is safe to apply in any GA version.

            marko Marko Mäkelä added a comment - This is about removing technical debt, or improving performance. Because I expect this to be a rather large change, I do not think that it is safe to apply in any GA version.

            This came up while I was working on MDEV-25919.

            This appears to be trivial to implement after all. In sym_tab_free_private() it is not necessary to hold a data dictionary latch; we can simply invoke dict_table_t::release().

            There is some special handling in dict_table_close(), for ensuring that InnoDB persistent statistics are deinitialized on FLUSH TABLES (presumably so that a manual update of mysql.innodb_table_stats and mysql.innodb_index_stats would take effect). I do not think that the access to tables by the InnoDB internal SQL parser should interfere with that.

            marko Marko Mäkelä added a comment - This came up while I was working on MDEV-25919 . This appears to be trivial to implement after all. In sym_tab_free_private() it is not necessary to hold a data dictionary latch; we can simply invoke dict_table_t::release() . There is some special handling in dict_table_close() , for ensuring that InnoDB persistent statistics are deinitialized on FLUSH TABLES (presumably so that a manual update of mysql.innodb_table_stats and mysql.innodb_index_stats would take effect). I do not think that the access to tables by the InnoDB internal SQL parser should interfere with that.

            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.