[MDEV-12700] Allow innodb_read_only startup without prior slow shutdown Created: 2017-05-05 Updated: 2023-06-07 Resolved: 2023-06-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0 |
| Fix Version/s: | 11.0.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | backup, database-import, recovery, xtrabackup | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
The parameter innodb_read_only which first appeared in MySQL 5.6 and MariaDB Server 10.0 disallows startup if the redo log is not logically empty or if the change buffer is not empty. It is technically possible to apply the needed changes in memory only, without writing them back to the data files. If MariaDB does that, it will be possible to check hot backups in a read-only fashion without any preparatory steps. |
| Comments |
| Comment by Marko Mäkelä [ 2019-11-05 ] | ||||||||||||
|
There are several things that slow shutdown would do, compared to simply killing the server:
Even with Another stumbling stone would be that the redo log might not be empty. We can fix both issues, by simply being prepared to apply buffered changes or redo log records at any time when an affected page is added to the buffer pool. We would not write any redo log or add anything to buf_pool_t::flush_list. Note: Obviously, we cannot remove anything from recv_sys.pages in this mode, and neither would we modify any change buffer tree or bitmap pages, not even in the buffer pool. If a page is evicted from the buffer pool and reloaded later, we must apply the buffered changes or log records again. We may have to refuse startup if the buffer pool is not sufficiently large for buffering all redo log records that were written since the latest checkpoint. The usable capacity of the buffer pool would depend on the size of log that was written since the previous checkpoint. | ||||||||||||
| Comment by Marko Mäkelä [ 2019-11-05 ] | ||||||||||||
|
I think that the redo log related part of this depends on | ||||||||||||
| Comment by Marko Mäkelä [ 2022-12-15 ] | ||||||||||||
|
Note: This limitation can manifest itself in non-obvious ways. Here is a recent example:
The server error log shows a more complete picture:
For an unknown reason (due to some bug), the server process failed to shut down, and it the process was forcibly kill -ABRT’ed by the test harness. Subsequently, InnoDB refused to start up, because the option innodb_read_only prevents all writes, including any that might be executed by crash recovery. Once the change buffer is removed ( | ||||||||||||
| Comment by Marko Mäkelä [ 2023-05-15 ] | ||||||||||||
|
Here is a recent occurrence of sql_sequence.read_only failure:
This stack trace is from a hang on shutdown, caused by the earlier test main.kill_debug that had been executed on the same worker earlier:
This is being tracked as | ||||||||||||
| Comment by Marko Mäkelä [ 2023-06-07 ] | ||||||||||||
|
The change buffer related part of this was fixed in The redo log related part will not be done. See |