[MDEV-27774] Reduce scalability bottlenecks in mtr_t::commit() Created: 2022-02-08 Updated: 2024-01-22 Resolved: 2022-02-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.8.1 |
| Fix Version/s: | 10.8.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
A prominent bottleneck was identified to be log_sys.mutex between log_sys.append_prepare() and log_close(). To protect the copying of data to log_sys.buf, we only need a shared log_sys.latch, which can replace log_sys.mutex and log_sys.flush_order_mutex. The log_sys.lsn and the position of log_sys.buf needs to be protected by a new log_sys.lsn_lock. Writes of log_sys.buf to the file system will have to acquire exclusive log_sys.latch. While working on this code, we can also make mtr_t::commit() invoke buf_pool.page_cleaner_wakeup() and update Innodb_buffer_pool_write_requests at most once per call. |
| Comments |
| Comment by Marko Mäkelä [ 2022-02-10 ] |
|
Thanks to wlad for the idea, and for further optimization suggestions. |
| Comment by Marko Mäkelä [ 2022-02-10 ] |
|
greenman, please note that with this change, the minimum value of innodb_log_file_size will increase from 1M to 4M. That was done in order to remove a very unlikely startup error condition, as well as a very unlikely error message output from log_sys.append(). |
| Comment by Ian Gilfillan [ 2022-02-11 ] |
|
Thanks, updated |