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

purge_sys_t::close_and_reopen() can busy loop for a long time

Details

    Description

      monty noted that the function purge_sys_t::close_and_reopen() may busy loop for a long time, depending on the workload. This might only be reproducible with the MDEV-25292 related changes that he was working on. The symptoms were that in a Valgrind Memcheck run when using the default scheduling options, a test would seem to hang after some 30 seconds, because purge_sys_t::close_and_reopen() would loop without yielding to another thread.

      Completely avoiding this loop is tricky. The reason why the InnoDB purge subsystem acquires a metadata lock (MDL) is to prevent any race condition with a DDL operation that is running concurrently with the current purge batch.

      The way how the undo log is structured and the multi-threaded purge (re)implemented in MDEV-32050 would not easily allow a purge batch to skip a particular table and to return to it later.

      When it comes to evaluating the values of indexed virtual columns (MDEV-5800 until MDEV-17598 has been implemented), the MDL may be unavoidable. For preventing other cases of conflicts between purge and DDL, it might be possible to acquire a latch inside an InnoDB dict_table_t object.

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

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