Commit bfde65c0 authored by Elena Stepanova's avatar Elena Stepanova

MDEV-10651, MDEV-14196 sys_vars.innodb_buffer_pool_* tests fail

- innodb_buffer_pool_dump_now_basic is modified to make sure it
  really performs a dump and waits till it completion, to avoid
  the apparent or hidden failure similar to MDEV-9713 / MDEV-10651
- innodb_buffer_pool_dump_pct_basic is modified to re-use the new
  code from innodb_buffer_pool_dump_now_basic and thus avoid
  the failure MDEV-10651
- innodb_buffer_pool_load_now_basic is re-written to simplify
  the logic by re-using the code innodb_buffer_pool_dump_now_basic
  and is given an opt file to avoid race conditions with
  buffer pool load performed upon server startup, which causes
  MDEV-14196 failure
parent 5e5adfa7
SET @orig = @@global.innodb_buffer_pool_dump_now;
SELECT @orig;
@orig
SELECT @@global.innodb_buffer_pool_dump_now;
@@global.innodb_buffer_pool_dump_now
0
SELECT variable_value INTO @old_dump_status FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
SET GLOBAL innodb_buffer_pool_dump_now = ON;
SELECT @@global.innodb_buffer_pool_dump_now;
@@global.innodb_buffer_pool_dump_now
......
......@@ -2,7 +2,8 @@ SET @orig = @@global.innodb_buffer_pool_dump_pct;
SELECT @orig;
@orig
100
SET GLOBAL innodb_buffer_pool_dump_pct=3, GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_dump_pct=3;
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_pct=0;
SELECT @@global.innodb_buffer_pool_dump_pct;
@@global.innodb_buffer_pool_dump_pct
......
SET @orig = @@global.innodb_buffer_pool_load_now;
SELECT @orig;
@orig
SELECT @@global.innodb_buffer_pool_load_now;
@@global.innodb_buffer_pool_load_now
0
SET GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_load_now = ON;
SELECT variable_value
FROM information_schema.global_status
......
......@@ -5,8 +5,31 @@
-- source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_dump_now;
SELECT @orig;
SELECT @@global.innodb_buffer_pool_dump_now;
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- error 0,1
-- remove_file $file
SELECT variable_value INTO @old_dump_status 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.
# We should have had a smart wait condition here, like the commented one below,
# let $wait_condition =
# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
# -- source include/wait_condition.inc
# ... but we can't because of MDEV-9867, so there will be just sleep instead.
# And it might be not enough to sleep one second, so we'll have to sleep two.
if (`SELECT variable_value LIKE '%completed at%' FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`)
{
-- sleep 2
}
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
......@@ -15,11 +38,11 @@ SELECT @@global.innodb_buffer_pool_dump_now;
# 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_dump_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
# Confirm that the dump file has been created
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- file_exists $file
......@@ -8,19 +8,15 @@
SET @orig = @@global.innodb_buffer_pool_dump_pct;
SELECT @orig;
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_pct=3, GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_dump_pct=3;
# Wait for the dump to complete
let $wait_condition =
SELECT 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
--echo # Do the dump
# Confirm that the dump file has been created
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- file_exists $file
--disable_query_log
--disable_result_log
--source innodb_buffer_pool_dump_now_basic.test
--enable_result_log
--enable_query_log
--disable_warnings
SET GLOBAL innodb_buffer_pool_dump_pct=0;
......
......@@ -5,42 +5,22 @@
-- source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_load_now;
SELECT @orig;
SELECT @@global.innodb_buffer_pool_load_now;
let $old_status= `SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;
# Make sure there is a dump file to load
# 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.
# We should have had a smart wait condition here, like the commented one below,
# but we can't because of MDEV-9867, so there will be just sleep instead.
# And it might be not enough to sleep one second, so we'll have to sleep two.
# let $wait_condition =
# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
# -- source include/wait_condition.inc
if (`SELECT variable_value LIKE '%dump completed at%' FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`)
{
-- sleep 2
}
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
# Wait for the dump to complete
let $wait_condition =
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
# Confirm the file is really created
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- error 0,1
-- file_exists $file
if ($errno)
{
# Dump file does not exist, get it created
--disable_query_log
--disable_result_log
--source innodb_buffer_pool_dump_now_basic.test
--enable_result_log
--enable_query_log
}
# Load the dump
SET GLOBAL innodb_buffer_pool_load_now = ON;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment