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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
#
# WL6117 : Resize the InnoDB Buffer Pool Online
# (concurrent sql; allocation fail;)
#
--source include/have_innodb.inc
--source include/have_debug.inc
--disable_query_log
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set @old_innodb_file_per_table = @@innodb_file_per_table;
set @old_innodb_thread_concurrency = @@innodb_thread_concurrency;
set @old_innodb_thread_sleep_delay = @@innodb_thread_sleep_delay;
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
--enable_query_log
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
let $wait_timeout = 180;
set global innodb_file_per_table=ON;
set global innodb_thread_concurrency=20;
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connect (con3,localhost,root,,);
connect (con4,localhost,root,,);
connect (con5,localhost,root,,);
connect (con6,localhost,root,,);
connect (con7,localhost,root,,);
connect (con8,localhost,root,,);
create table t2 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t2 (c1, c2) values (1, 1);
create table t3 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t3 (c1, c2) values (1, 1);
create table t4 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t4 (c1, c2) values (1, 1);
create table t5 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t5 (c1, c2) values (1, 1);
create table t6 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t6 (c1, c2) values (1, 1);
create database test2;
create table test2.t7 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into test2.t7 (c1, c2) values (1, 1);
drop table test2.t7;
connection con1;
set @save_dbug=@@global.debug_dbug;
set global debug_dbug="+d,ib_buf_pool_resize_wait_before_resize";
set global innodb_buffer_pool_size = 12*1024*1024;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 30) = 'Latching whole of buffer pool.'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
# trying to update innodb_buffer_pool_size
--error ER_WRONG_ARGUMENTS
set global innodb_buffer_pool_size = 8*1024*1024;
select @@global.innodb_buffer_pool_size;
# trying to control adaptive hash index
select @@global.innodb_adaptive_hash_index;
set global innodb_adaptive_hash_index = ON;
select @@global.innodb_adaptive_hash_index;
set global innodb_adaptive_hash_index = OFF;
select @@global.innodb_adaptive_hash_index;
# - create table
--send create table t1 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB
connection con2;
# - analyze table
--send analyze table t2
connection con3;
# - alter table ... algorithm=inplace
--send alter table t3 algorithm=inplace, add index idx (c1)
connection con4;
# - alter table ... rename to
--send alter table t4 rename to t0
connection con5;
# - drop table
--send drop table t5
connection con6;
# - alter table ... discard tablespace
--send alter table t6 discard tablespace
connection con7;
# - drop database
--send drop database test2
connection con8;
# information schema INNODB_BUFFER_PAGE
--send select count(*) > 0 from information_schema.innodb_buffer_page
connection default;
set global debug_dbug=@save_dbug;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
connection con1;
--reap
connection con2;
--reap
connection con3;
--reap
connection con4;
--reap
connection con5;
--reap
connection con6;
--reap
connection con7;
--reap
connection con8;
--reap
connection default;
disconnect con3;
disconnect con4;
disconnect con5;
disconnect con6;
disconnect con7;
disconnect con8;
disconnect con1;
disconnect con2;
# fails to allocate new chunks
call mtr.add_suppression("\\[ERROR\\] InnoDB: buffer pool 0 : failed to allocate new memory.");
connection default;
set global debug_dbug="+d,ib_buf_chunk_init_fails";
set global innodb_buffer_pool_size = 16*1024*1024;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 27) = 'Resizing buffer pool failed'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global debug_dbug=@save_dbug;
# can be used as usual, even if failed to allocate
create table t8 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t8 (c1, c2) values (1, 1);
drop table t8;
drop table t1;
drop table t2;
drop table t3;
drop table t0;
drop table t6;
--disable_query_log
set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
set global innodb_file_per_table = @old_innodb_file_per_table;
set global innodb_thread_concurrency = @old_innodb_thread_concurrency;
set global innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
--enable_query_log
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
# Wait till all disconnects are completed]
--source include/wait_until_count_sessions.inc
--echo #
--echo # BUG#23590280 NO WARNING WHEN REDUCING INNODB_BUFFER_POOL_SIZE INSIZE THE FIRST CHUNK
--echo #
SET @save_disable = @@GLOBAL.innodb_disable_background_merge;
SET GLOBAL innodb_disable_background_merge = ON;
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
set @before_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change'
FROM information_schema.global_status
WHERE VARIABLE_NAME = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size * 2;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 9) = 'Completed'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 9) = 'Completed'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
SET GLOBAL innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
SET GLOBAL innodb_disable_background_merge = @save_disable;
|