[MDEV-13057] innodb_read_only=1 should avoid creating buf_flush_page_cleaner_thread Created: 2017-06-12 Updated: 2018-01-23 Resolved: 2018-01-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - XtraDB |
| Affects Version/s: | 10.0 |
| Fix Version/s: | 10.1.25, 10.0.32 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.0.34 | ||||||||
| Description |
|
When the server is started in innodb_read_only mode, there cannot be any writes to persistent InnoDB/XtraDB files. Just like the creation of buf_flush_page_cleaner_thread is skipped in this case, also the creation of the XtraDB-specific buf_flush_lru_manager_thread should be skipped. |
| Comments |
| Comment by Laurynas Biveinis [ 2017-06-12 ] | |||||||||||||||||||||||||
|
I believe we have worked out the correct conditions for starting/not starting page cleaners / LRU managers in the latest XtraDB source. Specifically, LRU manager has to be started on innodb_read_only too - it evicts in addition to flushing, and so without it, a --innodb-empty-free-list-algorithm=backoff would starve InnoDB of free pages. | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-22 ] | |||||||||||||||||||||||||
|
I noticed that I had forgotten to update this ticket when I committed the change to MariaDB 10.0.32, 10.1.25. In MariaDB 10.2 there is no buf_flush_lru_manager_thread. laurynas, thank you for the hint. It looks like I should revert this change, or otherwise if innodb_read_only in combination with innodb_empty_free_list_algorithm=backoff may cause the buffer pool to run out. I will construct and run a test case. | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-23 ] | |||||||||||||||||||||||||
|
I tried and failed to reproduce the buffer pool starvation. It turns out that when the buf_flush_lru_manager_thread is not running, buf_LRU_get_free_block() will choose the legacy algorithm:
The condition buf_lru_manager_is_active would not hold, because innobase_start_or_create_for_mysql() will not set the variable unless it is starting the buf_flush_lru_manager_thread.
By default, innodb_buffer_pool_instances would be 0, which would be replaced with 8 if the innodb_buffer_pool_size is large enough. | |||||||||||||||||||||||||
| Comment by Laurynas Biveinis [ 2018-01-23 ] | |||||||||||||||||||||||||
|
That is correct, I had forgotten about the added && buf_lru_manager_is_active condition. |