[MDEV-678] LP:881383 - Corrupt ARCHIVE tables failing to repair Created: 2011-10-25 Updated: 2022-09-08 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.1.67, 5.2.14, 5.3.12, 5.5.36, 10.0.9 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Dreas van Donselaar (Inactive) | Assignee: | Michael Widenius |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | Launchpad, upstream | ||
| Attachments: |
|
| Description |
|
We regularly have corrupt ARCHIVE engine tables that fail to repair:
================================ I'm unsure what causes the corruption, but a repair shouldn't be failing I presume? I'll upload a copy of an example table to FTP. |
| Comments |
| Comment by Sergei Golubchik [ 2012-03-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Corrupt ARCHIVE tables failing to repair | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2012-03-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Corrupt ARCHIVE tables failing to repair There seems to be a workaround which allows to fix the corrupted tables: run REPAIR TABLE <tablename> EXTENDED twice on the table. See the output below (`t` it's pretty much a copy of one of your tables). Both 'EXTENDED' and 'twice' is important. The second attempt of REPAIR .. EXTENDED takes much longer, and after that the table starts being usable again. I've seen the same effect on other tables you uploaded. Please try it out. MariaDB [test]> check table t;
-------
------- MariaDB [test]> repair table t;
-------
------- MariaDB [test]> check table t;
-------
------- MariaDB [test]> insert into t select * from corrupt_archive_tables.t1; MariaDB [test]> repair table t extended;
-------
------- MariaDB [test]> check table t;
-------
------- MariaDB [test]> repair table t extended;
-------
------- MariaDB [test]> check table t;
-------
------- MariaDB [test]> insert into t select * from corrupt_archive_tables.t1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2012-03-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Corrupt ARCHIVE tables failing to repair from IRC: One observation that seems to be an error rather than a limitation (I already mentioned it in the previous comment, will put in more details now, and with test SQL to reproduce instead of tables uploaded to our FTP). After an archive table gets corrupted due to server being killed while writing into the table, REPAIR TABLE does not help, it leaves the table in the same corrupted state, no matter how many times we try. However, REPAIR TABLE .. EXTENDED does help, but only if it's executed twice. In the manual test below steps are described as comments, and actual SQL as commands, so you can copy-paste it into your client in two chunks (before and after server restart). I tried MariaDB 5.2.10 and MariaDB 5.5.21, got the same results on both.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-03-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Launchpad bug id: 881383 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-03-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also attached an MTR testcase mdev678.test, but depending on the version, sleep_time value (the first line) should be tuned. It's the time between issuing INSERT and killing the server, it needs to be adjusted so that some rows get already inserted into the table, but INSERT is not finished yet. Could also reproduce the problem on MySQL 5.1/5.5, but not on MySQL 5.6 – it just loses whatever was inserted, but technically REPAIR works. |