Skip to content

Commit

Permalink
Bug #23590280 NO WARNING WHEN REDUCING INNODB_BUFFER_POOL_SIZE INSIZE
Browse files Browse the repository at this point in the history
		THE FIRST CHUNK

PROBLEM

If we are scaling down innodb_buffer_pool_size inside the first chunk,
no resize operation is performed which is the correct behaviour . But
no warning is given to the client and no warning is included in the
error log . So to the user it looks as though the incorrect value has
been used to resize the buffer pool.

FIX

The above resize operation returns a warning to user.

Reviewed by: Jimmy and satya
RB: 17812
  • Loading branch information
sachinagarwal1111 committed Nov 20, 2017
1 parent bd1c46a commit 29d37f1
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mysql-test/suite/innodb/r/innodb_buffer_pool_resize_debug.result
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,18 @@ drop table t2;
drop table t3;
drop table t0;
drop table t6;
#
# BUG#23590280 NO WARNING WHEN REDUCING INNODB_BUFFER_POOL_SIZE INSIZE THE FIRST CHUNK
#
SET GLOBAL innodb_fast_shutdown = 0;
# restart: --innodb-buffer-pool-size=24M --innodb-buffer-pool-chunk-size=24M
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 div 2;
Warnings:
Warning 1210 InnoDB: Cannot resize buffer pool to lesser than chunk size of 25165824 bytes.
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size * 2;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
51 changes: 51 additions & 0 deletions mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,54 @@ let $wait_condition =

# 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 #

# Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0;
let $restart_parameters = restart: --innodb-buffer-pool-size=24M --innodb-buffer-pool-chunk-size=24M;
--source include/restart_mysqld.inc

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 div 2;

let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change'
FROM performance_schema.global_status
WHERE LOWER(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 performance_schema.global_status
WHERE LOWER(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 performance_schema.global_status
WHERE LOWER(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 performance_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
--source include/wait_condition.inc

set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
11 changes: 11 additions & 0 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21195,6 +21195,7 @@ innodb_buffer_pool_size_validate(
"Cannot update innodb_buffer_pool_size,"
" because innodb_disable_resize_buffer_pool_debug"
" is set.");

ib::warn() << "Cannot update innodb_buffer_pool_size,"
" because innodb_disable_resize_buffer_pool_debug"
" is set.";
Expand Down Expand Up @@ -21222,13 +21223,23 @@ innodb_buffer_pool_size_validate(
return(1);
}

if (srv_buf_pool_size == static_cast<ulint>(intbuf)) {
buf_pool_mutex_exit_all();
/* nothing to do */
return(0);
}

ulint requested_buf_pool_size
= buf_pool_size_align(static_cast<ulint>(intbuf));

*static_cast<longlong*>(save) = requested_buf_pool_size;

if (srv_buf_pool_size == requested_buf_pool_size) {
buf_pool_mutex_exit_all();
push_warning_printf(thd, Sql_condition::SL_WARNING,
ER_WRONG_ARGUMENTS,
"InnoDB: Cannot resize buffer pool to lesser than"
" chunk size of %lu bytes.", srv_buf_pool_chunk_unit);
/* nothing to do */
return(0);
}
Expand Down

0 comments on commit 29d37f1

Please sign in to comment.