summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-16 20:10:42 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-16 20:10:42 +0300
commitc430aa72abbdccb1ece7f0d65b49a6b48e7c5ba7 (patch)
tree84771067814d4ee96f8142bc04bef2314726bc99
parent65cce297beea09afc8132efc91372aaee1c70f7c (diff)
downloadmariadb-git-c430aa72abbdccb1ece7f0d65b49a6b48e7c5ba7.tar.gz
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.
-rw-r--r--storage/innobase/buf/buf0flu.cc9
1 files changed, 9 insertions, 0 deletions
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;
}