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

InnoDB hang in buf_flush_wait_LRU_batch_end()

    XMLWordPrintable

Details

    Description

      mleich provided rr replay traces of a 10.6 based testing branch where InnoDB shutdown would hang after shrinking the InnoDB buffer pool was initiated.

      This might have been caused by MDEV-26827 in 10.6.13. The fix of MDEV-32029 did refactor some related code, but I don’t think the hang should be related to that. The reason for the hang is that buf_flush_wait_LRU_batch_end() (invoked by buf_pool_t::withdraw_blocks() when shrinking the buffer pool) would wait indefinitely for buf_pool.done_flush_LRU, and the buf_flush_page_cleaner() would wait indefinitely for buf_pool.do_flush_list. I think that the fix (to be tested by mleich) would be as follows:

      diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
      index 9826320a358..06670e317a4 100644
      --- a/storage/innobase/buf/buf0flu.cc
      +++ b/storage/innobase/buf/buf0flu.cc
      @@ -2295,6 +2295,7 @@ static void buf_flush_page_cleaner()
           set_idle:
             buf_pool.page_cleaner_set_idle(true);
           set_almost_idle:
      +      pthread_cond_broadcast(&buf_pool.done_flush_LRU);
             pthread_cond_broadcast(&buf_pool.done_flush_list);
             if (UNIV_UNLIKELY(srv_shutdown_state > SRV_SHUTDOWN_INITIATED))
               break;
      

      Attachments

        Issue Links

          Activity

            People

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