server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-34753 memory pressure - erroneous termination condition

Open grooverdan opened this issue 1 year ago • 2 comments
trafficstars

  • [x] The Jira issue number for this PR is: MDEV-34753

Description

The 'if (!m_abort) break' condition was inverted by accident.

Thanks Kristian Nielsen for noticing.

Release Notes

Linux memory pressure events are now correctly handled.

How can this PR be tested?

innodb.mem_pressure tests shows the handling:

Version: '10.11.10-MariaDB-debug-log' socket: '/home/dan/repos/build-mariadb-server-10.11-debug/mysql-test/var/tmp/mysqld.1.sock' port: 19000 Source distribution 2024-08-14 8:23:29 4 [Note] InnoDB: Memory pressure event freed 146 pages 2024-08-14 8:23:29 0 [Note] InnoDB: Memory pressure event freed 0 pages

If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.

Basing the PR against the correct MariaDB version

  • [ ] This is a new feature or a refactoring, and the PR is based against the latest MariaDB development branch.
  • [X] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • [X] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [X] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

grooverdan avatar Aug 13 '24 22:08 grooverdan

Updated existing innodb.mem_pressure to trigger the same event loop that would have come from the OS.

grooverdan avatar Aug 14 '24 07:08 grooverdan

Thanks, Daniel.

The most important question from before still remains: was this ever tested (eg. manually) on actual OOM conditions? This is complex logic interacting with linux kernel interfaces and logic, I think it needs to be tested at least once that this code can actually do something sensible in the actual condition it is intended to handle, even if that condition cannot be set up in mysql-test-run.

Also see additional comments.

  • Kristian.

Tests where done in https://jira.mariadb.org/browse/MDEV-25341. It wasn't until later I discovered eventfds and implemented #2864 that the bug disabled the functionality.

grooverdan avatar Aug 15 '24 09:08 grooverdan

Suggested patch to fix the race in the test case (goes on top of the current commit in this pull request): https://github.com/MariaDB/server/commit/28e2e02c8b8fa79982785ce9000db49d53ce11e0 Ok to push/merge with this fix (or some variant or other way to fix the test case if you prefer).

knielsen avatar Oct 18 '24 17:10 knielsen

merge other variant before I saw this one. Thanks @knielsen

grooverdan avatar Oct 19 '24 07:10 grooverdan