Bug #32880 Repairing Archive table fails with internal error 144
Submitted: 30 Nov 2007 18:48 Modified: 7 Apr 2009 15:46
Reporter: Jerry Bonner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Archive storage engine Severity:S2 (Serious)
Version:5.1.22-rc, 5.1.31 OS:Linux (centos 5)
Assigned to: Satya B CPU Architecture:Any

[30 Nov 2007 18:48] Jerry Bonner
Description:
Checking or repairing crashed archive table, returns 144 internal error. Data seems irrecoverable.

5.1.22-rc-debug returns

mysql> check table mm_accounting_archive;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: radius

ERROR 2013 (HY000): Lost connection to MySQL server during query

0x8204802 handle_segfault + 574
0x91f402 (?)
0x435196d1 _end + 987539377
0x435113eb _end + 987505867
0x83d4867 _ZN10ha_archive10unpack_rowEP11azio_streamPh + 411
0x83d49d2 _ZN10ha_archive16get_row_version3EP11azio_streamPh + 96
0x83d6b84 _ZN10ha_archive7get_rowEP11azio_streamPh + 150
0x83d6cea _ZN10ha_archive5checkEP3THDP15st_ha_check_opt + 256
0x82f15de _ZN7handler8ha_checkEP3THDP15st_ha_check_opt + 114
0x8312807 _Z17mysql_admin_tableP3THDP10TABLE_LISTP15st_ha_check_optPKc13thr_lock_typebbjPFiS0_S2_S4_EM7handlerFiS0_S4_EPFiS0_S2_E + 3191
0x831341e _Z17mysql_check_tableP3THDP10TABLE_LISTP15st_ha_check_opt + 206
0x8214f97 _Z21mysql_execute_commandP3THD + 7335
0x821b022 _Z11mysql_parseP3THDPKcjPS2_ + 360
0x821c2b2 _Z16dispatch_command19enum_server_commandP3THDPcj + 3028
0x821d2ad _Z10do_commandP3THD + 625
0x820cd40 handle_one_connection + 256
0x4363d302 _end + 988734434
0x435be38e _end + 988214382

Version: '5.1.22-rc-debug-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
mysqld: ha_archive.cc:1080: int ha_archive::unpack_row(azio_stream*, uchar*): Assertion `row_len == read' failed.
071130 12:37:53 - mysqld got signal 6;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=16773120
max_used_connections=1
max_threads=500
threads_connected=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3810110 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0xa486b78
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xb3ba1a88, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x8204802
0x91f402
0x435196d1
0x435113eb
0x83d4867
0x83d49d2
0x83d6b84
0x83d6cea
0x82f15de
0x8312807
0x831341e
0x8214f97
0x821b022
0x821c2b2
0x821d2ad
0x820cd40
0x4363d302
0x435be38e
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html
and follow instructions on how to resolve the stack trace.
Resolved stack trace is much more helpful in diagnosing the
problem, so please do resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xa4d2548 = check table mm_accounting_archive
thd->thread_id=1

This table was affected by a crash (bug 32854), but this table was not directly being operated on by the queries that caused the crash (although inserts may have been occurring on this table).

How to repeat:
run check table or repair table on crashed data.
[2 Dec 2007 9:41] Sveta Smirnova
Thank you for the report.

Please attach crashed table: *.frm, *.ARZ and *.ARM files
[8 May 2008 16:42] MySQL Verification Team
Thank you for the feedback. Could you please test with latest released version
and if still you have the same problem it is possible to provide the files
with not large size but enough to do the test?. Thanks in advance.
[11 May 2008 9:35] Sveta Smirnova
Thank you for the provided tables.

Not need to test additionally: bug is repeatable with your tables and current development sources for me.
[25 May 2008 14:06] Gregory Haase
I too am affected by this.

Is there anyway we can up the severity here? When the tables become irrecoverable, we lose data. I believe that loss of data in a database is a somewhat critical error.
[13 Feb 2009 6:21] MySQL Verification Team
5.1.31 release cannot repair the table, and gives the error 144.
5.1.31-debug crashes: 

Version: '5.1.31-enterprise-gpl-pro-debug'  socket: 'sock'  port: 4444  MySQL Enterprise Server - Pro Edition Debug (GPL)
mysqld-debug: ha_archive.cc:1079: int ha_archive::unpack_row(azio_stream*, uchar*): Assertion `row_len == read' failed.
[25 Feb 2009 14: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/67551

2820 Satya B	2009-02-25
      Fix for BUG#32880 - Repairing Archive table fails with internal error 144
      
      Repairing Archive table fails as the row read from the corrupted archive 
      table is not equal the length at the time of insert
      
      The assertion is not valid anymore and removed it to avoid the server
      crash
      
      Corrupted Archive tables cannot be repaired.
      added:
        mysql-test/std_data/bug32880.ARN
        mysql-test/std_data/bug32880.ARZ
        mysql-test/std_data/bug32880.frm
      modified:
        mysql-test/r/archive.result
        mysql-test/t/archive.test
        storage/archive/ha_archive.cc
[27 Feb 2009 14:36] 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/67864

2820 Satya B	2009-02-27
      Fix for BUG#32880 - Repairing Archive table fails with internal error 144
            
      Repairing Archive table fails as the row read from the corrupted archive 
      table is not equal the length at the time of insert
            
      The assertion is not valid anymore and removed it to avoid the server
      crash
            
      added:
        mysql-test/std_data/bug32880.ARN
        mysql-test/std_data/bug32880.ARZ
        mysql-test/std_data/bug32880.frm
      modified:
        mysql-test/r/archive.result
        mysql-test/t/archive.test
        storage/archive/ha_archive.cc
[10 Mar 2009 10:04] 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/68745

2820 Satya B	2009-03-10
      Fix for BUG#32880 - Repairing Archive table fails with internal error 144
      
      Repairing Archive table fails as the row read from the 
      corrupted archive table is not equal the length at the time 
      of insert.
      
      Any statement reading corrupt archive data file
      (CHECK/REPAIR/SELECT/UPDATE/DELETE) may cause assertion
      failure in debug builds. This assertion has been removed
      and an error is returned instead.
      
      Also fixed that CHECK/REPAIR returns vague error message
      when it mets corruption in archive data file. This is
      fixed by returning proper error code.
      added:
        mysql-test/std_data/bug32880.ARN
        mysql-test/std_data/bug32880.ARZ
        mysql-test/std_data/bug32880.frm
      modified:
        mysql-test/r/archive.result
        mysql-test/t/archive.test
        storage/archive/ha_archive.cc
[17 Mar 2009 11:30] Sergey Vojtovich
Docs team note: it would be nice to document that archive engine doesn't support repair of corrupt data file now. It can only repair meta-data file.

A comment from the ha_archive.cc says:
If corruption is found in the data file then the meta file is not repaired.
At some point a recovery method for such a drastic case needs to be divised.
[18 Mar 2009 5: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/69524

2820 Satya B	2009-03-18
      Fix for BUG#32880 - Repairing Archive table fails with internal error 144
      
      Any statement reading corrupt archive data file
      (CHECK/REPAIR/SELECT/UPDATE/DELETE) may cause assertion
      failure in debug builds. This assertion has been removed
      and an error is returned instead.
      
      Also fixed that CHECK/REPAIR returns vague error message
      when it mets corruption in archive data file. This is
      fixed by returning proper error code.
      added:
        mysql-test/std_data/bug32880.ARN
        mysql-test/std_data/bug32880.ARZ
        mysql-test/std_data/bug32880.frm
      modified:
        mysql-test/r/archive.result
        mysql-test/t/archive.test
        storage/archive/ha_archive.cc
[27 Mar 2009 14:57] Bugs System
Pushed into 5.1.34 (revid:joro@sun.com-20090327143448-wuuuycetc562ty6o) (version source revid:leonard@mysql.com-20090316090622-sr8lylqvsl1jrcnv) (merge vers: 5.1.34) (pib:6)
[7 Apr 2009 15:46] Tony Bedford
An entry has been added to the 5.1.34 changelog:

An attempt to check or repair an ARCHIVE table that had been subjected to a server crash returned a 144 internal error. The data appeared to be irrecoverable.
[13 Apr 2009 9:21] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090413084402-snnrocwzktcl88ny) (version source revid:joro@sun.com-20090318165017-hx3v1ex8k6wnxyxx) (merge vers: 6.0.11-alpha) (pib:6)
[9 May 2009 16:41] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (merge vers: 5.1.34-ndb-6.2.18) (pib:6)
[9 May 2009 17:38] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (merge vers: 5.1.34-ndb-6.3.25) (pib:6)
[9 May 2009 18:36] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (merge vers: 5.1.34-ndb-7.0.6) (pib:6)
[13 Feb 2010 11:43] Sveta Smirnova
Bug #51083 was marked as duplicate of this one.