| 1 |
--source include/have_debug.inc |
| 2 |
--source include/not_embedded.inc |
| 3 |
--source include/have_innodb.inc |
| 4 |
--source include/have_sequence.inc |
| 5 |
--source include/word_size.inc |
| 6 |
|
| 7 |
--echo # |
| 8 |
--echo # MDEV-24670 avoid OOM by linux kernel co-operative memory management |
| 9 |
--echo # |
| 10 |
|
| 11 |
set @save_dbug=@@debug_dbug; |
| 12 |
|
| 13 |
set @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug; |
| 14 |
# Wait for the undo logs to be empty from previous tests. |
| 15 |
# This is not an actual parameter, so there is no need to restore it. |
| 16 |
set GLOBAL innodb_max_purge_lag_wait=0; |
| 17 |
|
| 18 |
SET @innodb_buffer_pool_size= @@GLOBAL.innodb_buffer_pool_size; |
| 19 |
SET @innodb_buffer_pool_size_min= @@GLOBAL.innodb_buffer_pool_size_auto_min; |
| 20 |
SELECT |
| 21 |
@@GLOBAL.innodb_buffer_pool_size, |
| 22 |
@@GLOBAL.innodb_buffer_pool_size_auto_min, |
| 23 |
@@GLOBAL.innodb_buffer_pool_size_max; |
| 24 |
|
| 25 |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB CHARSET=latin1; |
| 26 |
SET GLOBAL innodb_limit_optimistic_insert_debug=2; |
| 27 |
SET STATEMENT unique_checks=0, foreign_key_checks=0 FOR |
| 28 |
INSERT INTO t1 SELECT * FROM seq_1_to_1000; |
| 29 |
|
| 30 |
SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit; |
| 31 |
|
| 32 |
DROP TABLE t1; |
| 33 |
|
| 34 |
SET STATEMENT debug_dbug="d,trigger_garbage_collection" FOR |
| 35 |
SET GLOBAL innodb_buffer_pool_size=@innodb_buffer_pool_size; |
| 36 |
|
| 37 |
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 38 |
let SEARCH_PATTERN= Memory pressure event disregarded.*; |
| 39 |
let SEARCH_WAIT= FOUND; |
| 40 |
--source include/search_pattern_in_file.inc |
| 41 |
|
| 42 |
SET STATEMENT debug_dbug="d,trigger_garbage_collection" FOR |
| 43 |
SET GLOBAL innodb_buffer_pool_size_auto_min= |
| 44 |
CAST(@innodb_buffer_pool_size/2 AS UNSIGNED), |
| 45 |
innodb_buffer_pool_size=@innodb_buffer_pool_size; |
| 46 |
|
| 47 |
# The garbage collection happens asynchronously after trigger, in a background |
| 48 |
# thread. So wait for it to happen to avoid sporadic failure. |
| 49 |
let $wait_condition= |
| 50 |
select @@global.innodb_buffer_pool_size < @innodb_buffer_pool_size; |
| 51 |
--source include/wait_condition.inc |
| 52 |
eval $wait_condition; |
| 53 |
let SEARCH_PATTERN= InnoDB: Memory pressure event shrunk.*; |
| 54 |
let SEARCH_WAIT= FOUND; |
| 55 |
--source include/search_pattern_in_file.inc |
| 56 |
|
| 57 |
set debug_dbug=@save_dbug; |
| 58 |
SET GLOBAL innodb_buffer_pool_size= @innodb_buffer_pool_size; |
| 59 |
SET GLOBAL innodb_buffer_pool_size_auto_min=@innodb_buffer_pool_size_min; |
| 60 |
|
| 61 |
--echo # End of 10.11 tests |