| 1 |
--source include/have_innodb.inc |
| 2 |
--source include/have_sequence.inc |
| 3 |
--source include/not_embedded.inc # there are no messages in mysqld.1.err |
| 4 |
|
| 5 |
--echo # |
| 6 |
--echo # MDEV-29445: Reorganize buffer pool (and remove chunks) |
| 7 |
--echo # |
| 8 |
|
| 9 |
--disable_query_log |
| 10 |
call mtr.add_suppression("InnoDB: Over 67 percent of the buffer pool is occupied by lock heaps"); |
| 11 |
call mtr.add_suppression("innodb_buffer_pool_size change aborted"); |
| 12 |
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size; |
| 13 |
set @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index; |
| 14 |
--enable_query_log |
| 15 |
|
| 16 |
set global innodb_adaptive_hash_index=ON; |
| 17 |
|
| 18 |
select @@innodb_buffer_pool_size; |
| 19 |
|
| 20 |
# Expand buffer pool |
| 21 |
set global innodb_buffer_pool_size = 9437184; |
| 22 |
set global innodb_buffer_pool_size = 10485760; |
| 23 |
|
| 24 |
select @@innodb_buffer_pool_size; |
| 25 |
let $kbs=`SELECT CAST(@@innodb_page_size / 1024 AS INT)`; |
| 26 |
|
| 27 |
# fill buffer pool |
| 28 |
--disable_query_log |
| 29 |
SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed; |
| 30 |
SET GLOBAL innodb_read_only_compressed=OFF; |
| 31 |
--enable_query_log |
| 32 |
create table t1 (id int primary key, val int not null) |
| 33 |
ENGINE=InnoDB ROW_FORMAT=COMPRESSED; |
| 34 |
evalp create table t2 (id int primary key, val int not null) |
| 35 |
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$kbs; |
| 36 |
|
| 37 |
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR |
| 38 |
INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144; |
| 39 |
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR |
| 40 |
INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384; |
| 41 |
|
| 42 |
--disable_query_log |
| 43 |
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed; |
| 44 |
--enable_query_log |
| 45 |
|
| 46 |
SELECT @@GLOBAL.innodb_adaptive_hash_index; |
| 47 |
--error 0,ER_WRONG_USAGE |
| 48 |
SET STATEMENT max_statement_time=1e-9 FOR |
| 49 |
SET GLOBAL innodb_buffer_pool_size = 7340032; |
| 50 |
SELECT @@GLOBAL.innodb_adaptive_hash_index; |
| 51 |
|
| 52 |
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 53 |
--let SEARCH_PATTERN= InnoDB: Trying to shrink innodb_buffer_pool_size=7m |
| 54 |
--let SEARCH_PATTERN= innodb_buffer_pool_size=7m.*resized from|innodb_buffer_pool_size change aborted |
| 55 |
--source include/search_pattern_in_file.inc |
| 56 |
|
| 57 |
# Attempt to shrink the buffer pool. This may occasionally fail. |
| 58 |
--error 0,ER_WRONG_USAGE |
| 59 |
set global innodb_buffer_pool_size = 7340032; |
| 60 |
|
| 61 |
select count(val) from t1; |
| 62 |
select count(val) from t2; |
| 63 |
|
| 64 |
set global innodb_adaptive_hash_index=OFF; |
| 65 |
|
| 66 |
# Expand buffer pool to 23 and then 24 MiB (requesting 25 MiB) |
| 67 |
set global innodb_buffer_pool_size = 24117248; |
| 68 |
set global innodb_buffer_pool_size = 26214400; |
| 69 |
|
| 70 |
select @@innodb_buffer_pool_size; |
| 71 |
|
| 72 |
select count(val) from t1; |
| 73 |
select count(val) from t2; |
| 74 |
|
| 75 |
drop table t1,t2; |
| 76 |
|
| 77 |
SET GLOBAL innodb_max_purge_lag_wait = 0; |
| 78 |
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct; |
| 79 |
SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm; |
| 80 |
|
| 81 |
SET GLOBAL innodb_max_dirty_pages_pct_lwm = 0.0; |
| 82 |
SET GLOBAL innodb_max_dirty_pages_pct = 0.0; |
| 83 |
let $wait_condition = |
| 84 |
SELECT variable_value = 0 |
| 85 |
FROM information_schema.global_status |
| 86 |
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'; |
| 87 |
--source include/wait_condition.inc |
| 88 |
SET GLOBAL innodb_buffer_pool_size = @old_innodb_buffer_pool_size; |
| 89 |
SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index; |
| 90 |
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct; |
| 91 |
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm; |