1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-34265 Possible hang during IO burst with innodb_flush_sync enabled

When checkpoint age goes beyond the sync flush threshold and
buf_flush_sync_lsn is set, page cleaner enters into "furious flush"
stage to aggressively flush dirty pages from flush list and pull
checkpoint LSN above safe margin. In this stage, page cleaner skips
doing LRU flush and eviction.

In 10.6, all other threads entirely rely on page cleaner to generate
free pages. If free pages get over while page cleaner is busy in
"furious flush" stage, a session thread could wait for free page in the
middle of a min-transaction(mtr) while holding latches on other pages.

It, in turn, can prevent page cleaner to flush such pages preventing
checkpoint LSN to move forward creating a deadlock situation. Even
otherwise, it could create a stall and hang like situation for large BP
with plenty of dirty pages to flush before the stage could finish.

Fix: During furious flush, check and evict LRU pages after each flush
iteration.
This commit is contained in:
mariadb-DebarunBanerjee
2024-05-30 17:14:01 +05:30
parent b204817986
commit b12c14e3b4
4 changed files with 138 additions and 56 deletions

View File

@@ -268,4 +268,17 @@ PARTITION BY KEY(a) PARTITIONS 16;
INSERT INTO t1 VALUES(1);
UPDATE t1 SET a = 2 WHERE a = 1;
DROP TABLE t1;
#
# MDEV-34265 Possible hang during IO burst with innodb_flush_sync enabled
#
CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB;
SET @save_dbug=@@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug='+d,ib_page_cleaner_sleep';
SET STATEMENT debug_dbug='+d,ib_free_page_sleep' FOR
INSERT INTO t1 VALUES(REPEAT(1, 8459264));
SET @@GLOBAL.debug_dbug=@save_dbug;
SELECT length(f1) FROM t1;
length(f1)
8459264
DROP TABLE t1;
# End of 10.6 tests