Bug #25289 | repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" | ||
---|---|---|---|
Submitted: | 27 Dec 2006 4:17 | Modified: | 30 Mar 2007 19:41 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S6 (Debug Builds) |
Version: | 5.0.34bk | OS: | Linux (suse 9.3 x86) |
Assigned to: | Ingo Strüwing | CPU Architecture: | Any |
Tags: | debug assertion, my_seek, repair table |
[27 Dec 2006 4:17]
Shane Bester
[27 Dec 2006 4:17]
MySQL Verification Team
also see related bug #23010
[5 Jan 2007 17:57]
MySQL Verification Team
I found out that this is probably the same bug as http://bugs.mysql.com/bug.php?id=25433 The debug binary crashes with assertion here. In bug #25433, I used release binaries, which didn't crash, but instead reported corruption in the tables. Hence the same testcase1.c that causes corruption in bug #25433 will reproduce this bug report's crash in a debug binary. Marking as duplicate of #25433.
[8 Mar 2007 10:16]
Ingo Strüwing
Server crash verified on 5.1.17, using testcase1.c from bug #25433.
[8 Mar 2007 16:36]
Ingo Strüwing
The false assertion in my_seek() has nothing to do with a similar bug that was fixed some time ago. (I believed so initially.) The problem is that we try to repeat a failed repair under some circumstances. We did not take into account that the first repair could fail so that the table is not open any more (fd == -1).
[9 Mar 2007 12:10]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/21589 ChangeSet@1.2608, 2007-03-09 12:51:32+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult repair situations the server could crash. Under some circumstances the server retries a repair with more elaborate options. But it did not check if the first repair failed so badly that a second attempt must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433.
[9 Mar 2007 14:38]
Ingo Strüwing
Other places where repair is retried may be affected too.
[9 Mar 2007 16:55]
Ingo Strüwing
The automatic of the bug database is broken again. http://lists.mysql.com/commits/21620 ChangeSet@1.2608, 2007-03-09 16:07:25+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult optimize/repair situations the server could crash. Under some circumstances the server retries an optimize/repair with more elaborate options. But it did not check if the first attempt failed so badly that a second one must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433.
[9 Mar 2007 17:19]
Sergey Vojtovich
I do not see better way to fix this problem. Patch is approved.
[9 Mar 2007 17:39]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/21620 ChangeSet@1.2608, 2007-03-09 16:07:25+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult optimize/repair situations the server could crash. Under some circumstances the server retries an optimize/repair with more elaborate options. But it did not check if the first attempt failed so badly that a second one must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433.
[14 Mar 2007 16:04]
Ingo Strüwing
The new patch (I hope the bug databse will find it soon) does now print a note. In the error log you can find something like this: 070314 16:54:43 [Note] Retrying repair of: './test/t1' with keycache 070314 16:54:43 [Note] Retrying repair of: './test/t1' failed. Please try REPAIR EXTENDED or myisamchk Magnuns, plese check the updated fix when the bug database finds it. Regards, Ingo
[14 Mar 2007 16:44]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/21895 ChangeSet@1.2472, 2007-03-14 16:45:57+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" After merge fix
[14 Mar 2007 16:46]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/21896 ChangeSet@1.2422, 2007-03-14 16:41:57+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" After merge fix
[14 Mar 2007 17:09]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/21904 ChangeSet@1.2608, 2007-03-14 15:54:37+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult optimize/repair situations the server could crash. Under some circumstances the server retries an optimize/repair with more elaborate options. But it did not check if the first attempt failed so badly that a second one must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433.
[14 Mar 2007 17:13]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/21903 ChangeSet@1.2608, 2007-03-14 16:27:37+01:00, istruewing@chilla.local +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult optimize/repair situations the server could crash. Under some circumstances the server retries an optimize/repair with more elaborate options. But it did not check if the first attempt failed so badly that a second one must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433.
[16 Mar 2007 14:47]
Ingo Strüwing
Queued to 5.1-engines, 5.0-engines, 4.1-engines.
[30 Mar 2007 17:28]
Bugs System
Pushed into 5.1.18-beta
[30 Mar 2007 17:30]
Bugs System
Pushed into 5.0.40
[30 Mar 2007 17:53]
Ingo Strüwing
Pushed to 4.1.23
[30 Mar 2007 19:41]
Paul DuBois
Noted in 4.1.23, 5.0.40, 5.1.18 changelogs. Difficult repair or optimization operations could cause an assertion failure, resulting in a server crash.