[MDEV-27852] InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2) Created: 2022-02-15 Updated: 2022-06-27 Resolved: 2022-06-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.4.22, 10.5.15 |
| Fix Version/s: | 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2, 10.10.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Manuel Arostegui | Assignee: | Marko Mäkelä |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
debian bullseye |
||
| Issue Links: |
|
||||||||||||
| Description |
|
This bug is similar than https://jira.mariadb.org/browse/MDEV-22627 but it happens also with an ALTER table. I am able to reproduce as soon as I try the alter table. Table:
ALTER:
Full trace:
|
| Comments |
| Comment by Manuel Arostegui [ 2022-02-15 ] | |||||||||||||||||||||
|
stack trace
| |||||||||||||||||||||
| Comment by Manuel Arostegui [ 2022-02-15 ] | |||||||||||||||||||||
|
More gbd:
And the relevant entry from show table status:
| |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-02-15 ] | |||||||||||||||||||||
|
It looks like the problem is a mismatch between the .frm file and the InnoDB data dictionary. InnoDB thinks that the table is in ROW_FORMAT=COMPACT (the default between MySQL 5.0.3 and MySQL 5.7.8), while the .frm file says ROW_FORMAT=COMPRESSED. I think that this table must have been created when the setting innodb_file_format=antelope was in effect, and thus the creation of COMPRESSED or DYNAMIC tables was forbidden. This setting was deprecated and ignored in MySQL 5.7 and MariaDB 10.2. You should be able to rebuild the table if you specify ALGORITHM=COPY or set old_alter_table=1 (or | |||||||||||||||||||||
| Comment by Manuel Arostegui [ 2022-02-16 ] | |||||||||||||||||||||
|
marko, first of all thanks a lot for all the live troubleshooting we did last night. Thanks for taking the time to look into this until you find what the issue was and provided a workaround. This was amazing to see and I am so grateful for it. I can now confirm that I left the workaround running and I have attempted to alter the tables again and replication is flowing normally - the tables are being altered after being rebuilt during the night and I am seeing no more crashes. It is certainly possible that those tables were created like that, as these hosts and their data are probably more than 10 years old, and went thru several migrations (including from mysql to mariadb). I have added a bit more details for our specific case in our internal tracking system: https://phabricator.wikimedia.org/T301313#7713692 Thanks a lot for the time spent yesterday, you were so helpful and dedicated. Much much much appreciated it. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-02-17 ] | |||||||||||||||||||||
|
Hi marostegui, I think that this is a bug that should be fixable in some way. A simple fix could be to refuse native ALTER TABLE when the ROW_FORMAT in the .frm file disagrees with the InnoDB definition. It should be possible to create an mtr test case for this, by moving some .frm files around to inject this kind of a fault. I do not promise anything, though. | |||||||||||||||||||||
| Comment by Manuel Arostegui [ 2022-02-21 ] | |||||||||||||||||||||
|
Thanks marko, if that is fixable or we can have a way to prevent the crashes that'd be great. Thank you! | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-06-27 ] | |||||||||||||||||||||
|
I finally took the time to figure out how to reproduce this, in |