[MDEV-17158] TRUNCATE is not atomic after MDEV-13564 Created: 2018-09-07 Updated: 2018-09-26 Resolved: 2018-09-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Tests |
| Affects Version/s: | 10.3.10 |
| Fix Version/s: | 10.3.10, 10.2.19 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | recovery | ||
| Issue Links: |
|
||||||||||||
| Description |
|
I observed this both on 10.2 and 10.3 when testing
The reason for this appears to be that the following call does not always guarantee a write to the redo log:
Such a call is present in all callers of fil_name_write_rename_low(), yet sometimes we end up with losing the table, because no undo log was persisted for the incomplete transaction despite this call. |
| Comments |
| Comment by Elena Stepanova [ 2018-09-07 ] | |||||
|
The test fails for me like this:
If it's not an indication of the reported problem, then could you please paste the output which does indicate it? | |||||
| Comment by Marko Mäkelä [ 2018-09-10 ] | |||||
|
I made a wrong diagnosis. log_write_up_to() appears to behave as it should. The actual problem is in | |||||
| Comment by Marko Mäkelä [ 2018-09-10 ] | |||||
|
It turned out that there were multiple InnoDB transaction commits inside ha_innobase::truncate() before the completion of ha_innobase::create(). Also the crash recovery had to be revised a bit, because the new empty file has to be deleted before the old non-empty table can be renamed back to the old file. |