Bug #17028 random table crashes when replace command is used
Submitted: 1 Feb 2006 23:55 Modified: 3 Feb 2006 9:58
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.18 OS:Linux (linux (debian))
Assigned to: CPU Architecture:Any

[1 Feb 2006 23:55] [ name withheld ]
Description:
MyIsam Tables get randomly crashed.
Happens mostly on large (2 mil. records) tables with irregular sizes (texts)

Tables become marked as crashed and can not be accessed until fixed with mysqlcheck:
error    : Table './aaa/aaatext' is marked as crashed and should be repaired

Repairing tables

or this error:
error    : Key in wrong position at page 61041664
error    : Corrupt
Repairing tables

Plz help.

How to repeat:
Happens seemingly at random.
Tables get accessed a lot, with concurrent queries and inserts and delayed inserts. Same user.

MySQL on localhost (5.0.18-Debian_7-log)                                                                up 0+05:28:13 [01:55:25]
 Queries: 1.0M   qps:   55 Slow:     0.0         Se/In/Up/De(%):    18/00/00/00
             qps now:    8 Slow qps: 0.0  Threads:    5 (   2/   0) 10/00/00/00
 Key Efficiency: 99.2%  Bps in/out:   0.0/  0.6   Now in/out:   8.4/ 1.2k
[1 Feb 2006 23:58] [ name withheld ]
Note that table does not get structurely altered, nor any stored procedures are used (thats what a bug report suggest - so this is not the case).
[2 Feb 2006 11:29] [ name withheld ]
I've noticed that the tables crashed all get REPLACE INTO used on them.

Could this be it?
[2 Feb 2006 11:43] Valeriy Kravchuk
Thank you for a problem report. Are these tables created in 5.0.18 or in previos (4.x.y) version of MySQL?
[2 Feb 2006 12:55] [ name withheld ]
tables were all created in an old version. probably 3. something.
these problems started when upgrading from 4.0 to 5.0
[2 Feb 2006 13:21] Valeriy Kravchuk
So, the tables just remain "as is" from MySQL < 5.0, you had not dumped and restred them, as recoomended, right? Send, please, the SHOW CREATE TABLE results for one of these tables.
[2 Feb 2006 16:59] [ name withheld ]
CREATE TABLE `remark_text` (
  `rid` int(11) NOT NULL default '0',
  `text` text NOT NULL,
  PRIMARY KEY  (`rid`),
  UNIQUE KEY `rid_2` (`rid`),
  KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 

this is after i've removed a FULLTEXT index as suggested by one comment on upgrading. problem is possibly fixed. im still running tests.
[3 Feb 2006 9:58] Valeriy Kravchuk
Sorry, but it is expected behaviour for such binary upgrade. Please, do dump and restore for tables with FULLTEXT indexes (and, if possible, for all of them) when upgrading from pre 5.0.x version to 5.0.x.