[MDEV-13039] innodb_fast_shutdown=0 may fail to purge all undo logs Created: 2017-06-08 Updated: 2017-10-05 Resolved: 2017-06-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2.3, 10.2.4, 10.2.5, 10.3.0, 10.2.6 |
| Fix Version/s: | 10.1.25, 10.0.32, 10.2.7, 10.3.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | shutdown | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
When a slow shutdown is performed soon after creating some activity for fts_optimize_thread(), it is possible that the optimize thread is starting new transactions after the purge has finished. This is violating the specification of innodb_fast_shutdown, namely that the purge must be completed. (None of the history of new transactions would be purged.) The proper fix would seem to declare a flag that indicates whether undo-log-generating background threads are active:
As long as this flag is set, srv_purge_should_exit() must return false. |
| Comments |
| Comment by Marko Mäkelä [ 2017-06-08 ] |
|
bb-10.2-marko |
| Comment by Jan Lindström (Inactive) [ 2017-06-08 ] |
|
patch is ok to push, but these shutdown changes are hard as so many timing things can happen, buildbot has not yet tested this thoroughly, please wait that first. |
| Comment by Marko Mäkelä [ 2017-06-08 ] |
|
This is also related to |
| Comment by Marko Mäkelä [ 2017-06-08 ] |
|
Revised fix (with test) on bb-10.2-marko |
| Comment by Jan Lindström (Inactive) [ 2017-06-09 ] |
|
Changes look otherwise good expect based on bb that checkpoint writing on startup should be restored. |
| Comment by Marko Mäkelä [ 2017-06-09 ] |
|
Thanks. I filed a follow-up task: |
| Comment by Marko Mäkelä [ 2017-06-09 ] |
|
In all InnoDB versions, the background DROP TABLE queue (which is blatantly breaking ACID properties) is potentially interfering with the purge at slow shutdown. Starting with MariaDB 10.0, the dict_stats_thread() and fts_optimize_thread() could create undo log records that would fail to be purged at slow shutdown. |