1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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

@ -163,9 +163,9 @@ DROP TABLE t1,t2;
CREATE TABLE t1 (a INT KEY) ENGINE=InnoDB;
--error 0,1193
--error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @save_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug;
--error 0,1193
--error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
BEGIN;
@ -289,4 +289,30 @@ CREATE TABLE t1(a INT KEY)ENGINE=InnoDB
INSERT INTO t1 VALUES(1);
UPDATE t1 SET a = 2 WHERE a = 1;
DROP TABLE t1;
--echo #
--echo # MDEV-34265 Possible hang during IO burst with innodb_flush_sync enabled
--echo #
CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB;
--error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @save_dbug=@@GLOBAL.debug_dbug;
--error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @@GLOBAL.debug_dbug='+d,ib_page_cleaner_sleep';
if ($have_debug) {
SET STATEMENT debug_dbug='+d,ib_free_page_sleep' FOR
INSERT INTO t1 VALUES(REPEAT(1, 8459264));
}
if (!$have_debug) {
--echo SET STATEMENT debug_dbug='+d,ib_free_page_sleep' FOR
INSERT INTO t1 VALUES(REPEAT(1, 8459264));
}
--error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @@GLOBAL.debug_dbug=@save_dbug;
SELECT length(f1) FROM t1;
DROP TABLE t1;
--echo # End of 10.6 tests