| 1 |
# |
| 2 |
# Basic test for innodb_buffer_pool_load_now |
| 3 |
# |
| 4 |
|
| 5 |
|
| 6 |
# Restart mysqld to ensure that the status variables below do not contain |
| 7 |
# stale value from previous executions of this or other tests. The following |
| 8 |
# race could happen without this restart: |
| 9 |
# 0. innodb_buffer_pool_load_status is 'Buffer pool(s) load completed ...' |
| 10 |
# 1. SET innodb_buffer_pool_load_now = ON |
| 11 |
# (1. does not start executing yet) |
| 12 |
# 2. Wait for innodb_buffer_pool_load_status to become '... completed ...', |
| 13 |
# the condition is satisfied immediately |
| 14 |
# (1. starts executing now) |
| 15 |
# 3. Query innodb_buffer_pool_load_status, expecting 'completed', but it |
| 16 |
# contains something like 'Loading page 100/150' |
| 17 |
|
| 18 |
|
| 19 |
# Check the default value |
| 20 |
SET @orig = @@global.innodb_buffer_pool_load_now; |
| 21 |
SELECT @orig; |
| 22 |
|
| 23 |
# Do the dump |
| 24 |
SET GLOBAL innodb_buffer_pool_dump_now = ON; |
| 25 |
|
| 26 |
# Wait for the dump to complete |
| 27 |
let $wait_condition = |
| 28 |
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at ' |
| 29 |
FROM performance_schema.global_status |
| 30 |
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'; |
| 31 |
--disable_warnings |
| 32 |
-- source include/wait_condition.inc |
| 33 |
--enable_warnings |
| 34 |
|
| 35 |
# Confirm the file is really created |
| 36 |
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)` |
| 37 |
-- file_exists $file |
| 38 |
|
| 39 |
SET GLOBAL innodb_fast_shutdown=0; |
| 40 |
-- source include/restart_mysqld.inc |
| 41 |
|
| 42 |
# Load the dump |
| 43 |
SET GLOBAL innodb_buffer_pool_load_now = ON; |
| 44 |
|
| 45 |
# Wait for the load to complete |
| 46 |
let $wait_timeout= 900; |
| 47 |
let $wait_condition = |
| 48 |
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at ' |
| 49 |
FROM performance_schema.global_status |
| 50 |
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; |
| 51 |
--disable_warnings |
| 52 |
-- source include/wait_condition.inc |
| 53 |
--enable_warnings |
| 54 |
|
| 55 |
# Show the status, interesting if the above timed out |
| 56 |
--disable_warnings |
| 57 |
-- replace_regex /^Buffer pool\(s\) load completed.*|^Loading buffer pool\(s\) from.*|^Loaded .*pages.*/Buffer pool load completed or still running/ |
| 58 |
SELECT variable_value |
| 59 |
FROM performance_schema.global_status |
| 60 |
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; |
| 61 |
--enable_warnings |
| 62 |
|