[MDEV-32269] InnoDB after ALTER TABLE…IMPORT TABLESPACE may not be crash safe Created: 2023-09-27 Updated: 2023-12-05 Resolved: 2023-11-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.5.24, 10.6.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | crash, not-10.8, rr-profile-analyzed | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Today, I got a local test failure that looks much like this old failure:
In the core dump of my local failure, the IMPORT thread was waiting in mtr_t::commit():
The flush list validation was executing as part of a mtr_t::commit() in trx_purge_truncate_rseg_history(). That mini-transaction was only holding page latches on tablespace 0x44 (the tablespace that is being imported). The bpage in the assertion expression was page 344 in the system tablespace. The bpage->list.prev was page 13 in the tablespace that is being imported. Neither page was buffer-fixed or latched, and apparently no asynchronous page reads or writes were in progress:
Notably, the status of the previous page (13 in tablespace 0x44 in my case) is buf_page_t::FREED. While searching for failures in the cross-reference, I found several hangs during a test, and also the following assertion failure that could share a root cause with this one:
|
| Comments |
| Comment by Marko Mäkelä [ 2023-11-06 ] | |||||||||||||||||||||||||||||||||||
|
This was observed in another IMPORT TABLESPACE test: https://buildbot.mariadb.org/#/builders/534/builds/11223/steps/7/logs/stdio
| |||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-11-27 ] | |||||||||||||||||||||||||||||||||||
|
mleich was able to reproduce an rr replay trace of this. The following would seem to fix this:
As far as I can tell, this should be applicable to 10.5 too. The user impact on non-debug builds should be that the server may not be crash safe after an ALTER TABLE…IMPORT TABLESPACE I found a related failure on 10.5, which I think could be fixed by the above patch.
| |||||||||||||||||||||||||||||||||||
| Comment by Vladislav Lesin [ 2023-11-29 ] | |||||||||||||||||||||||||||||||||||
|
LGTM | |||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-11-30 ] | |||||||||||||||||||||||||||||||||||
|
In MariaDB Server 10.8 and later major releases, this code was last touched by
|