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

Server may hang when innodb_undo_log_truncate=ON

    XMLWordPrintable

Details

    Description

      MDEV-27058 introduced a deadlock between trx_purge_truncate_history() and buf_pool_t::release_freed_page(). The former function is holding buf_pool.flush_list_mutex while waiting for a page X-latch:

          mysql_mutex_lock(&buf_pool.flush_list_mutex);
       
          for (buf_page_t *bpage= UT_LIST_GET_LAST(buf_pool.flush_list); bpage; )
          {
              bpage->lock.x_lock();
      

      At the same time, buf_pool_t::release_freed_page() may hold a U-latch on this page while waiting for buf_pool.flush_list_mutex.

      Before MDEV-27058, there was no problem here, because we would first buffer-fix the block, then release buf_pool.flush_list_mutex and only then acquire the block X-latch.

      To fix this, we may invoke bpage->lock.x_lock_try() instead. If it fails, we may release and reacquire buf_pool.flush_list_mutex and restart the scan.

      Because MDEV-27058 was not part of any release yet, this regression does not affect any release.

      Attachments

        Issue Links

          Activity

            People

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