[MDEV-23484] Rollback unnecessarily acquires dict_operation_lock for every row Created: 2020-08-14 Updated: 2021-07-30 Resolved: 2021-07-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.6.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance, rr-profile-analyzed | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
InnoDB transaction rollback includes an unnecessary work-around for a data corruption bug that was fixed by me in MySQL 5.6.12. By acquiring and releasing dict_operation_lock in shared mode, row_undo() hopes to prevent the table from being dropped while the undo log record is being rolled back. But, thanks to the fix, the rollback is guaranteed to be protected by transactional locks (table IX lock, in addition to implicit or explicit exclusive locks on the records that had been modified). In one test case for which I analyzed rr replay, this unnecessary contention on dict_operation_lock seems to slow down the rollback of a CREATE…SELECT statement. As mentioned in While the root cause of the problem is to be addressed in |
| Comments |
| Comment by Matthias Leich [ 2020-08-14 ] | |||||||||||||||||||||
|
The RQG testing on actual 10.5+a patch for | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-10-20 ] | |||||||||||||||||||||
|
I think that we must revert this until
Here, we are starting an online ALTER TABLE operation, even though a rollback of a previous ALTER TABLE is in progress. This would be prevented by the dict_operation_lock that we removed. I think that the only way to fix this is to acquire an InnoDB table S lock at the start of ALTER TABLE. Also | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-07-27 ] | |||||||||||||||||||||
|
Now that the CREATE…SELECT was fixed in |