MDEV-34446 SIGSEGV on SET GLOBAL innodb_log_file_size with memory-mapped log file
log_t::resize_write(): Advance log_sys.resize_lsn and reset the resize_log offset to START_OFFSET whenever the memory-mapped buffer would wrap around. Previously, in case the initial target offset would be beyond the requested innodb_log_file_size, 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. The log_sys.lsn_lock will cover the entire duration of replicating memory-mapped log for resizing. We just need a mutex that is compatible with the caller holding log_sys.latch. While the choice of mtr_t::finisher (for normal log writes) depends on mtr_t::spin_wait_delay, replicating the log during resizing is a rare operation where we can afford possible additional context switching overhead.
Showing
Please register or sign in to comment