Skip to content

Commit

Permalink
MDEV-9713 Sporadic test failure: sys_vars.innodb_buffer_pool_load_now…
Browse files Browse the repository at this point in the history
…_basic

It could have happened that one of previous tests already executed
buffer pool dump and set the status variable value, so when it's been
checked, the check passes too early, before the dump starts and
the dump file is created. See more detailed explanation in MDEV-9713.

Fixed by waiting for the current time to change in case it equals
to the timestamp in the status variable, and then checking that
the status variable not only matches the expected pattern, but also
differs from the previous value, whatever it was.
  • Loading branch information
elenst committed Mar 12, 2016
1 parent 8103526 commit 0125e58
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -8,12 +8,24 @@
SET @orig = @@global.innodb_buffer_pool_load_now;
SELECT @orig;

let $old_status= `SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;

# A previous test could have run buffer pool dump already;
# in this case we want to make sure that the current time is different
# from the timestamp in the status variable

let $wait_condition =
SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
-- source include/wait_condition.inc

# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;

# Wait for the dump to complete
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
SELECT variable_value != '$old_status'
AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
Expand Down

0 comments on commit 0125e58

Please sign in to comment.