mariadb/mysql-test/suite/innodb/r/mem_pressure.result
Daniel Black eb29190398 MDEV-34753 memory pressure - erroneous termination condition
The 'if (!m_abort) break' condition was inverted by accident.

Constrain the test case to environments where there is cgroupv2
runtime environment which is the same case that will pass a memory
pressure initialization.

Remove the explicit garbage_collection trigger as it hides the abnormal
termination error on the event loop for memory pressure. This
also means there is no support in non-cgroupv2 environments
(possibly some container environments).

As the trigger to memory pressure is via a different thread we
need to wait until a "[mM]emory pressure" log message is there to
know it has succeeded or failed.

Thanks Kristian Nielsen for noticing and review.
2024-10-19 17:20:27 +11:00

26 lines
1.1 KiB
Text

#
# MDEV-24670 avoid OOM by linux kernel co-operative memory management
#
set @save_dbug=@@debug_dbug;
set @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
set GLOBAL innodb_max_purge_lag_wait=0;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET STATEMENT unique_checks=0, foreign_key_checks=0 FOR
INSERT INTO t1 SELECT * FROM seq_1_to_1000;
SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
DROP TABLE t1;
SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
set debug_dbug="d,trigger_garbage_collection";
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size;
FOUND 1 /[Mm]emory pressure.*/ in mysqld.1.err
SELECT CAST(VARIABLE_VALUE AS INTEGER) < @dirty_prev AS LESS_DIRTY_IS_GOOD
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
LESS_DIRTY_IS_GOOD
1
FOUND 1 /InnoDB: Memory pressure event freed.*/ in mysqld.1.err
set debug_dbug=@save_dbug;
# End of 10.11 tests