[MDEV-30983] ALTER TABLE times out, but does not roll back the operation Created: 2023-04-01 Updated: 2024-01-02 Resolved: 2024-01-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 11.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Nikita Malyavin |
| Resolution: | Cannot Reproduce | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
In the test case below, one connection performs ALTER, while another has something to do with statistical tables. Every ones in a while, ALTER fails with a timeout. Apparently the timeout concerns statistical tables, as there seems to be no other relation between connections. Even though the ALTER fails, the modification it performed remains, e.g. in this case the column remains renamed. The practical effect is, for example, further replication discrepancy: since ALTER fails, it is not written in the binlog, so table remains unchanged on the slave, which causes further discrepancies. Notes:
|
| Comments |
| Comment by Nikita Malyavin [ 2023-04-06 ] | |||||||||||||||||||||||||
|
This happens under INPLACE:
| |||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2023-04-06 ] | |||||||||||||||||||||||||
|
This was successfully reproduced on the most recent common with 11.0 commit: 799f7595 bump the maturity | |||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2023-04-06 ] | |||||||||||||||||||||||||
|
I've also reproduced it on fresh 11.0 8e55d7ea4a2f9. After failure, c298_renamed was visible to SHOW CREATE. I didn't investigate which versions are affected. marko please adjust the priority of your choice | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-04-11 ] | |||||||||||||||||||||||||
|
nikitamalyavin, can you please reproduce an rr replay trace of this on a shared machine so that it can be analyzed further? I failed to reproduce any failure with the posted mtr test case on a 11.1 based branch, even after adjusting the test to create InnoDB tables. Note: The ANALYZE TABLE t1 PERSISTENT FOR ALL is not InnoDB statistics, but "engine independent table statistics". If there is a locking problem, it likely resides somewhere outside InnoDB. Related to InnoDB persistent statistics, there is a bug MDEV-29566, which might play a role here. To rule it out, please try creating the tables with STATS_PERSISTENT=0. | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-04-12 ] | |||||||||||||||||||||||||
|
Actually, in the end I too reproduced this on a 11.1 based branch once, but without rr record. | |||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2023-05-16 ] | |||||||||||||||||||||||||
|
This bug wasn't related to innodb's inplace, but to a generic inplace (as it shows up, myisam and maria can also do renaming), and, as predicted by marko, is related to "engine independent table statistics". The lock timeout is reported, because the stat table is opened by ANALYZE TABLE, and a table was still ALTERed, because the proper error handling was missing in the alter table code. | |||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2023-05-16 ] | |||||||||||||||||||||||||
|
serg can we just ignore the error from rename_column_in_stat_tables? I see that thd->clear_error() was there until commit 313855766f3c | |||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2023-05-22 ] | |||||||||||||||||||||||||
|
Note: the fix with a proper handing (bailout) is here the deterministic test:
| |||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2024-01-02 ] | |||||||||||||||||||||||||
|
It was likely fixed by |