[MDEV-11415] Remove excessive undo logging during ALTER TABLE…ALGORITHM=COPY Created: 2016-11-29 Updated: 2023-12-20 Resolved: 2018-01-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2 |
| Fix Version/s: | 10.2.13, 10.3.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | alter | ||
| Issue Links: |
|
||||||||||||||||||||
| Epic Link: | InnoDB fixes from MySQL | ||||||||||||||||||||
| Sprint: | 10.1.31 | ||||||||||||||||||||
| Description |
|
MySQL 5.6 introduced ALTER TABLE…ALGORITHM=INPLACE, which avoids writing undo log for individual records that are copied. No change was made for ALGORITHM=COPY.
The proper fix would be to disable the undo logging for the individual rows altogether. This would still leave an orphan #sql table (until crash-safe atomic DDL is implemented), which can be dropped by the user. That fix was implemented in MySQL 8.0, and MariaDB should backport it:
|
| Comments |
| Comment by Marko Mäkelä [ 2017-11-30 ] | ||||||||||||||||||||||||||||||||||
|
Actually, if | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-16 ] | ||||||||||||||||||||||||||||||||||
|
The initial version of the contribution would reduce Galera functionality with the following:
Because of this, LOAD DATA…INFILE would always be atomic in Galera, and the transaction could become too large for replication. This would be possibly fixed by | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-26 ] | ||||||||||||||||||||||||||||||||||
|
I revised the wsrep_load_data_splitting hack and compared the contributed code to the original MySQL 8.0 changes. The revised contribution is waiting for results from bb-10.3-marko. | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-26 ] | ||||||||||||||||||||||||||||||||||
|
I ported this to 10.2 as well. | ||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-01-29 ] | ||||||||||||||||||||||||||||||||||
|
This one seems to be happening only on bb-10.2-marko, but not on 10.2 95f39339444:
| ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-29 ] | ||||||||||||||||||||||||||||||||||
|
For ALTER IGNORE we must for now keep the undo logging enabled, so that the latest row can be rolled back in case of an error. | ||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-01-30 ] | ||||||||||||||||||||||||||||||||||
|
Other failures encountered on bb-10.2-marko 1670cfe7d7734b and bb-10.3-marko f2acc0efdc8591f appear to be unrelated. I've started another test run on bb-10.2-marko 72689ee5c with the fix for ALTER IGNORE problem above. The following bugs interfered with the previous test run and made many tests end prematurely (most likely will cause problems in the new run too):
| ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-30 ] | ||||||||||||||||||||||||||||||||||
|
Note: After this fix, ALTER IGNORE TABLE will allocate and write undo log for all written rows. This could be fixed as a follow-up change. We only need to remember the last written row so that it can be rolled back in case of an error, such as a duplicate key in
|