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

buf_LRU_scan_and_free_block() fails to stop at first freed block

    XMLWordPrintable

    Details

      Description

      MDEV-15053 refactored the InnoDB buffer pool and page flushing. It unfortunately included one unintended functional change that seriously hurts performance in workloads where the buffer pool is big, but the working set is even bigger. The termination condition for a loop was misplaced:

      diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
      index 5d9a39b0c9e..5e36a51690a 100644
      --- a/storage/innobase/buf/buf0lru.cc
      +++ b/storage/innobase/buf/buf0lru.cc
      @@ -570,8 +570,9 @@ static bool buf_LRU_free_from_common_LRU_list(bool scan_all)
       				ever being accessed. This gives us a measure of
       				the effectiveness of readahead */
       				++buf_pool.stat.n_ra_pages_evicted;
      -				break;
       			}
      +
      +			break;
       		}
       	}
       
      

      This bug will cause a permanent drop of throughput when a write-heavy database instance starts thrashing.

      MDEV-23399 is suggesting larger changes to data structures and algorithms that could be beneficial in such workloads.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: