List:Bugs« Previous MessageNext Message »
From:sasha Date:September 25 2000 3:30pm
Subject:Re: MYISAMCHK does not recognises broken files:
View as plain text  
Peter Zaitsev wrote:
> 
> Hello bugs,
> 
> I found the strange mysql (3.23.24) behavior on linux, then a table data filetype is
> wrong - in my case
> file was dammaged somehow because of the disk crash:
> 
> pr-S-wx-wx    1 65280    8475            0 Sep 24 17:08 g01stat_enginekw.MYD
> -rw-rw----    1 root     spylog-b     2048 Sep 23 15:12 g01stat_enginekw.MYI
> -rw-r--r--    1 root     root         8664 Sep 20 08:46 g01stat_enginekw.frm
> 
> The thing is even "echo . > g01stat_enginekw.MYD" hanges, so it's not the bug in
> mysqld - but may be it's
> a point to add some checks to myisamchk.
> Then attempting to check the file I have:
> 
> [root@rat badfile]# myisamchk -cm *.MYI
> Checking MyISAM file: g01stat_enginekw.MYI
> Data records:    2294   Deleted blocks:       8
> myisamchk: warning: 1 clients is using or hasn't closed the table properly
> - check file-size
> myisamchk: warning: Size of indexfile is: 2048          Should be: 1024
> myisamchk: warning: Size of datafile is: 18446744073709551615       Should be: 48342
> myisamchk: warning: Datafile is almost full, 18446744073709551615 of 90194313214
> used
> - check key delete-chain
> - check record delete-chain
> myisamchk: error: Can't read delete-link at filepos: 14532
> - check index reference
> - check data record references index: 1
> myisamchk: error: Can't read indexpage from filepos: 18446744073709551615
> - check record links
> Segmentation fault
> 
> So myisamchk segfaults and as I run it in the script I even do not note the problem.
> In my case it was quite hard to find the problem as I have several
> thousand tables :)

Yes, checks for read errors and proper handling of those need to be done. Can
you run myisamchk compiled with debugging in gdb and see where it coredumps (
make sure to do bt )?

-- 
Sasha Pachev

+------------------------------------------------------------------+
|      ____  __     _____   _____  ___     http://www.mysql.com    |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sasha Pachev            |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     sasha@stripped         |
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Provo, Utah, USA        |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                         |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                        |
|             /*/             \*\ Developers Team                  |
+------------------------------------------------------------------+
Thread
MYISAMCHK does not recognises broken files:Peter Zaitsev24 Sep
  • Re: MYISAMCHK does not recognises broken files:sasha25 Sep
  • MYISAMCHK does not recognises broken files:Michael Widenius26 Sep