From e71bdbf3d97dce5a6c49fd8eb79407c86acfd79d Mon Sep 17 00:00:00 2001 From: Alessandro Vetere Date: Thu, 15 Oct 2026 12:10:06 +0200 Subject: [PATCH] MDEV-41557 Test encryption.innochecksum is flaky The test checks that sys.innodb_buffer_stats_by_table reports old pages (pages_old) after a server restart. InnoDB creates the old sublist of the buffer pool LRU list only when the list holds at least BUF_LRU_OLD_MIN_LEN (512) pages. After the restart, most of the pages in the list come from the buffer pool load at startup. This load runs asynchronously, and the server accepts connections before it completes. If the test runs the check first, the list can be shorter than 512 pages, no page is old, and the result shows 0 instead of 1. The option --innodb-buffer-pool-load-at-startup=0 disables the load. This is the extreme case of the race: the check always runs before any page of the dump is loaded. With this option, the test fails every time with innodb_page_size=4k and 16k. Wait for the buffer pool load to complete before the check, as other tests do. --- mysql-test/suite/encryption/t/innochecksum.test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test index e440e3d3344..d4a3d78a944 100644 --- a/mysql-test/suite/encryption/t/innochecksum.test +++ b/mysql-test/suite/encryption/t/innochecksum.test @@ -300,6 +300,16 @@ if (0 && $have_debug) { # these messages sometimes fail to appear --source include/start_mysqld.inc +# The check of pages_old needs old pages in the buffer pool LRU list. +# They exist only when the list holds at least BUF_LRU_OLD_MIN_LEN pages. +# Without the asynchronous load of the buffer pool dump, the list can be +# shorter than that. +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at ' + FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; +--source include/wait_condition.inc + --echo # Trigger AHI and test pages_hashed, pages_old as non zero from sys view SELECT STRAIGHT_JOIN COUNT(t6a.a)