Reproducible MyISAM table corruption

Reproducible MyISAM table corruption

am 20.03.2003 12:02:58 von sistemas

I wrote from Ylos Hispania SL. Yesterday we upgraded the mysql server in our
development envirorment to the version 4.0.12-standard-log. After few minutes
working a table became corrupted, we repaired with myisamchk -r, but few
minutes later the error appeared again.

How-To-Repeat:
1..- Create an empty database
2.- Dump into the SQL sentences
(http://www2.ylos.com/myisamcorruption_ylos.sql.gz).
3.- Check the table integrity with myisamchk
4.- The result should be something like this:

# myisamchk /usr/local/mysql/data/cesar/logweb.MYI
Checking MyISAM file: /usr/local/mysql/data/cesar/logweb.MYI
Data records: 156 Deleted blocks: 457
/usr/local/mysql/bin/myisamchk: warning: 1 clients is using or hasn't closed
the table properly
- check file-size
- check key delete-chain
- check record delete-chain
/usr/local/mysql/bin/myisamchk: warning: Not used space is supposed to be:
25344 but is: 25292
/usr/local/mysql/bin/myisamchk: error: record delete-link-chain corrupted
- check index reference
- check record links
/usr/local/mysql/bin/myisamchk: warning: Found 613 parts
Should be: 614 parts
MyISAM-table '/usr/local/mysql/data/cesar/logweb.MYI' is corrupted
Fix it using switch "-r" or "-o"

Best regards

--
César Mauri
-Systems Manager-

Ylos Hispania SL
Paseo Prim, 27 bajos
43202 REUS-Tarragona
SPAIN

Web: http://www.ylos.com
Phone: +34 902 181 073
Fax: +34 977 331 114



------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13998@lists.mysql.com
To unsubscribe, e-mail

Re: Reproducible MyISAM table corruption

am 20.03.2003 12:19:34 von Alexander Keremidarski

Hola,

Dpto.Sistemas Ylos wrote:
> I wrote from Ylos Hispania SL. Yesterday we upgraded the mysql server in our
> development envirorment to the version 4.0.12-standard-log. After few minutes
> working a table became corrupted, we repaired with myisamchk -r, but few
> minutes later the error appeared again.

I was able to reproduce it, but this is not a bug at all. Read below.


> How-To-Repeat:
> 1..- Create an empty database
> 2.- Dump into the SQL sentences
> (http://www2.ylos.com/myisamcorruption_ylos.sql.gz).
> 3.- Check the table integrity with myisamchk

You should never run myisamchk while mysqld is running. Use mysqlcheck instead.

> 4.- The result should be something like this:
> # myisamchk /usr/local/mysql/data/cesar/logweb.MYI
> Checking MyISAM file: /usr/local/mysql/data/cesar/logweb.MYI
> Data records: 156 Deleted blocks: 457
> /usr/local/mysql/bin/myisamchk: warning: 1 clients is using or hasn't closed
> the table properly

As message said table is either *opened* or corrupted.

Try running your query then shutdown mysqld and check table with myisamchk and you
will see there is no corruption.

Prefer using mysqlcheck as it issues CHECK TABLE or REPAIR TABLE commands and
there is no risc to corrupt data.

Running myisamchk while myslqd is running in most cases leads to corruption.


> Best regards
>


--
MySQL Conference and Expo 2003 http://www.mysql.com/events/uc2003/index.html
For technical support contracts, visit https://order.mysql.com/?ref=msal
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexander Keremidarski
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
<___/ www.mysql.com




------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13999@lists.mysql.com
To unsubscribe, e-mail

Re: Reproducible MyISAM table corruption

am 20.03.2003 12:54:22 von sistemas

Ok. I tried stopping MySQL server before checking integrity and the result is
the same.

How-To-Repeat:
1.- Create an empty database
2.- Dump into the SQL sentences
(http://www2.ylos.com/myisamcorruption_ylos.sql.gz).
3.- Stop MySQL server
3.- Check the table integrity with myisamchk
4.- The result should be something like this:

# /usr/local/mysql/bin/myisamchk logweb.MYI
Checking MyISAM file: logweb.MYI
Data records: 156 Deleted blocks: 457
- check file-size
- check key delete-chain
- check record delete-chain
/usr/local/mysql/bin/myisamchk: warning: Not used space is supposed to be:
25344 but is: 25292
/usr/local/mysql/bin/myisamchk: error: record delete-link-chain corrupted
- check index reference
- check record links
/usr/local/mysql/bin/myisamchk: warning: Found 613 parts
Should be: 614 parts
MyISAM-table 'logweb.MYI' is corrupted
Fix it using switch "-r" or "-o"

--

With mysqlcheck the result is the following:

/usr/local/mysql/bin/mysqlcheck cesar
cesar.logweb
warning : Not used space is supposed to be: 25344 but is: 25292
error : record delete-link-chain corrupted
error : Corrupt


Best regards

On Thursday 20 March 2003 12:19, you wrote:
> Hola,
>
> Dpto.Sistemas Ylos wrote:
> > I wrote from Ylos Hispania SL. Yesterday we upgraded the mysql server in
> > our development envirorment to the version 4.0.12-standard-log. After few
> > minutes working a table became corrupted, we repaired with myisamchk -r,
> > but few minutes later the error appeared again.
>
> I was able to reproduce it, but this is not a bug at all. Read below.
>
> > How-To-Repeat:
> > 1..- Create an empty database
> > 2.- Dump into the SQL sentences
> > (http://www2.ylos.com/myisamcorruption_ylos.sql.gz).
> > 3.- Check the table integrity with myisamchk
>
> You should never run myisamchk while mysqld is running. Use mysqlcheck
> instead.
>
> > 4.- The result should be something like this:
> > # myisamchk /usr/local/mysql/data/cesar/logweb.MYI
> > Checking MyISAM file: /usr/local/mysql/data/cesar/logweb.MYI
> > Data records: 156 Deleted blocks: 457
> > /usr/local/mysql/bin/myisamchk: warning: 1 clients is using or hasn't
> > closed the table properly
>
> As message said table is either *opened* or corrupted.
>
> Try running your query then shutdown mysqld and check table with myisamchk
> and you will see there is no corruption.
>
> Prefer using mysqlcheck as it issues CHECK TABLE or REPAIR TABLE commands
> and there is no risc to corrupt data.
>
> Running myisamchk while myslqd is running in most cases leads to
> corruption.
>
> > Best regards

--
César Mauri
-Dpto. Sistemas-

Ylos Hispania SL
Paseo Prim, 27 bajos
43202 REUS-Tarragona
SPAIN

Web: http://www.ylos.com
Tel: +34 902 181073
Fax: +34 977 331114

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread14000@lists.mysql.com
To unsubscribe, e-mail

Re: Reproducible MyISAM table corruption

am 20.03.2003 14:06:48 von Alexander Keremidarski

Hi,

Dpto.Sistemas Ylos wrote:
> Ok. I tried stopping MySQL server before checking integrity and the result is
> the same.
>
> How-To-Repeat:
> 1.- Create an empty database
> 2.- Dump into the SQL sentences
> (http://www2.ylos.com/myisamcorruption_ylos.sql.gz).
> 3.- Stop MySQL server
> 3.- Check the table integrity with myisamchk
> 4.- The result should be something like this:
>
> # /usr/local/mysql/bin/myisamchk logweb.MYI
> Checking MyISAM file: logweb.MYI
> Data records: 156 Deleted blocks: 457
> - check file-size
> - check key delete-chain
> - check record delete-chain
> /usr/local/mysql/bin/myisamchk: warning: Not used space is supposed to be:
> 25344 but is: 25292
> /usr/local/mysql/bin/myisamchk: error: record delete-link-chain corrupted

Ok. I did more tests and you are right table becomes corrupted.
Thank you for a good bug report and perfect test case.

We will check it thourughly and willlet you know when it's fixed.

--
MySQL Conference and Expo 2003 http://www.mysql.com/events/uc2003/index.html
For technical support contracts, visit https://order.mysql.com/?ref=msal
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexander Keremidarski
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
<___/ www.mysql.com




------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread14001@lists.mysql.com
To unsubscribe, e-mail