server
server copied to clipboard
MDEV-34446 SIGSEGV on SET GLOBAL innodb_log_file_size with memory-mapped log file
- [x] The Jira issue number for this PR is: MDEV-34446
Description
log_t::resize_write(): Ensure that log_sys.resize_lsn will wrap around also when the initial target offset would be beyond the requested innodb_log_file_size. Previously, we only adjusted the offset but not the LSN. An incorrect LSN would cause log_sys.buf_free to be out of bounds when the log resizing completes.
Note: We must invoke std::atomic::fetch_add() to adjust log_sys.resize_lsn because multiple concurrent invocations are possible.
Release Notes
This is a race condition that is rather unlikely to trigger. Persistent memory is very rarely used. So, this does not need to be mentioned in release notes.
How can this PR be tested?
This is best tested in the stress test framework that reproduced the issue in the first place.
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.
- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.