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

InnoDB may still hang when temporarily running out of buffer pool

    XMLWordPrintable

Details

    Description

      The test encryption.innochecksum very often hangs, timing out in 900 seconds (15 minutes). I found it while working on MDEV-29445, but I see that the test fails also in other branches. The following (refining something that was modified in MDEV-33053) would fix the hang for me:

      diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
      index 5ecaa513f41..fa833d96476 100644
      --- a/storage/innobase/buf/buf0lru.cc
      +++ b/storage/innobase/buf/buf0lru.cc
      @@ -449,24 +449,18 @@ buf_block_t *buf_LRU_get_free_block(bool have_mutex)
       			goto got_block;
       		}
       		const bool wake = buf_pool.need_LRU_eviction();
      -		mysql_mutex_unlock(&buf_pool.mutex);
       		mysql_mutex_lock(&buf_pool.flush_list_mutex);
      -		const auto n_flush = buf_pool.n_flush();
       		if (wake && !buf_pool.page_cleaner_active()) {
       			buf_pool.page_cleaner_wakeup(true);
       		}
       		mysql_mutex_unlock(&buf_pool.flush_list_mutex);
      -		mysql_mutex_lock(&buf_pool.mutex);
      -		if (!n_flush) {
      -			goto not_found;
      -		}
      -		if (!buf_pool.try_LRU_scan) {
      +		if (wake) {
       			my_cond_wait(&buf_pool.done_free,
       				     &buf_pool.mutex.m_mutex);
       		}
       	}
       
      -not_found:
      +	IF_DBUG(not_found:,);
       	if (n_iterations > 1) {
       		MONITOR_INC( MONITOR_LRU_GET_FREE_WAITS );
       	}
      

      It looks like this hang was introduced in MDEV-26827. The above fix would depend on the fix of MDEV-33053.

      Attachments

        Issue Links

          Activity

            People

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