From c430aa72abbdccb1ece7f0d65b49a6b48e7c5ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 16 Sep 2021 20:10:42 +0300 Subject: [PATCH] MDEV-26626 InnoDB fails to advance the log checkpoint buf_flush_page_cleaner(): Always try to advance the log checkpoint, even when no pages were flushed during the latest batch. Maybe, since the previous batch, there was an LRU flush that removed the last dirty pages. Failure to advance the log checkpoint will cause unnecessary work in Mariabackup and on crash recovery. --- storage/innobase/buf/buf0flu.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 10a84d99a2e..fb687b4f51b 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -2266,6 +2266,15 @@ furious_flush: unemployed: buf_flush_async_lsn= 0; buf_pool.page_cleaner_set_idle(true); + + DBUG_EXECUTE_IF("ib_log_checkpoint_avoid", continue;); + + mysql_mutex_unlock(&buf_pool.flush_list_mutex); + + if (!recv_recovery_is_on() && srv_operation == SRV_OPERATION_NORMAL) + log_checkpoint(); + + mysql_mutex_lock(&buf_pool.flush_list_mutex); continue; }