[MDEV-11985] Make innodb_read_only shutdown more robust Created: 2017-02-03 Updated: 2017-11-09 Resolved: 2017-02-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0, 10.2.3 |
| Fix Version/s: | 10.0.30, 10.1.22, 10.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | recovery, shutdown, transactions | ||
| Issue Links: |
|
||||||||
| Description |
|
If InnoDB is started in innodb_read_only mode such that recovered incomplete transactions exist at startup (but the redo logs are clean), an assertion will fail at shutdown, because there would exist some non-prepared transactions.
Repeating this bug requires two restarts after ensuring that some InnoDB redo log has been written, making some changes of an incomplete transaction durable:
|
| Comments |
| Comment by Marko Mäkelä [ 2017-02-03 ] | ||||||||||||||||
|
https://github.com/MariaDB/server/commit/8b772150705d142a200805edc59365e979559020 | ||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-02-03 ] | ||||||||||||||||
|
Code changes ok to push, please add test case for embedded server that uses UNINSTALL PLUGIN statement (actually not sure if you can do that, if not ok). | ||||||||||||||||
| Comment by Marko Mäkelä [ 2017-02-03 ] | ||||||||||||||||
|
This issue affects 10.0 as well. The parameter innodb_read_only was introduced in 10.0.4, but there should be a shutdown hang already earlier when innodb_force_recovery=3 is used. That parameter existed already in MySQL 3.23.49, but back then, InnoDB shutdown did not wait transactions to be committed or rolled back. In 10.0 and 10.1, there would also be a hang on shutdown. There was a partial fix/workaround in MySQL 5.7, implemented in the function trx_sys_any_active_transactions():
This work-around should be reverted from 10.2, because it is no longer necessary. | ||||||||||||||||
| Comment by Marko Mäkelä [ 2017-02-03 ] | ||||||||||||||||
|
10.0 patch: https://github.com/MariaDB/server/commit/03ffe319b45a9dcc6efb2720f4692279ea10f4c8 | ||||||||||||||||
| Comment by Marko Mäkelä [ 2017-02-03 ] | ||||||||||||||||
|
Note: The added test innodb.read_only_recovery reveals that starting with MySQL 5.7 or MariaDB Server 10.2, innodb_read_only is hard-wiring the transaction isolation level to READ UNCOMMITTED. | ||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-02-06 ] | ||||||||||||||||
|
ok to push. |