File: innodb_buffer_pool_resize.test

package info (click to toggle)
mariadb 1%3A11.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 765,428 kB
  • sloc: ansic: 2,382,827; cpp: 1,803,532; asm: 378,315; perl: 63,176; sh: 46,496; pascal: 40,776; java: 39,363; yacc: 20,428; python: 19,506; sql: 17,864; xml: 12,463; ruby: 8,544; makefile: 6,059; cs: 5,855; ada: 1,700; lex: 1,193; javascript: 1,039; objc: 80; tcl: 73; awk: 46; php: 22
file content (79 lines) | stat: -rw-r--r-- 2,681 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--source include/have_innodb.inc
--source include/have_sequence.inc

--echo #
--echo # MDEV-29445: Reorganize buffer pool (and remove chunks)
--echo #

--disable_query_log
call mtr.add_suppression("InnoDB: Over 67 percent of the buffer pool is occupied by lock heaps");
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
--enable_query_log

set global innodb_adaptive_hash_index=ON;

select @@innodb_buffer_pool_size;

# Expand buffer pool
set global innodb_buffer_pool_size = 9437184;
set global innodb_buffer_pool_size = 10485760;

select @@innodb_buffer_pool_size;
let $kbs=`SELECT CAST(@@innodb_page_size / 1024 AS INT)`;

# fill buffer pool
--disable_query_log
SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
create table t1 (id int primary key, val int not null)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
evalp create table t2 (id int primary key, val int not null)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$kbs;

SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144;
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384;

--disable_query_log
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
--enable_query_log

# Attempt to shrink the buffer pool. This may occasionally fail.
--error 0,ER_WRONG_USAGE
set global innodb_buffer_pool_size = 7340032;

select count(val) from t1;
select count(val) from t2;

set global innodb_adaptive_hash_index=OFF;

# Expand buffer pool to 23 and then 24 MiB (requesting 25 MiB)
set global innodb_buffer_pool_size = 24117248;
set global innodb_buffer_pool_size = 26214400;

select @@innodb_buffer_pool_size;

select count(val) from t1;
select count(val) from t2;

drop table t1,t2;

SET GLOBAL innodb_max_purge_lag_wait = 0;
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;

SET GLOBAL innodb_max_dirty_pages_pct_lwm = 0.0;
SET GLOBAL innodb_max_dirty_pages_pct = 0.0;
let $wait_condition =
SELECT variable_value = 0
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
--source include/wait_condition.inc
SET GLOBAL innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm;