Bug #32472 Enabling keys after inserts: Warning: Enabling keys got errno 22
Submitted: 17 Nov 2007 17:17 Modified: 20 Nov 2007 13:02
Reporter: Thomas Auge Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0.45 OS:Linux (Fedora 6 2.6.22.9-61)
Assigned to: CPU Architecture:Any
Tags: alter, errno 22, insert, keys

[17 Nov 2007 17:17] Thomas Auge
Description:
Upon inserting a database dump I got the following errors in the log:

071117 17:10:56 [Warning] Warning: Enabling keys got errno 22 on warfacts0.worlds, retrying
071117 17:13:51 [Warning] Warning: Enabling keys got errno 22 on warfacts0b_veryold.worlds_bak070112, retrying
071117 17:14:30 [Warning] Warning: Enabling keys got errno 22 on warfacts0b_veryold.worlds_bak07122, retrying
071117 17:15:02 [Warning] Warning: Enabling keys got errno 22 on warfacts0b_veryold.worlds_genbak, retrying
071117 17:29:19 [Warning] Warning: Enabling keys got errno 22 on warfacts0r6.worlds, retrying
071117 17:30:30 [Warning] Warning: Enabling keys got errno 22 on warfacts0r6.worlds_genbak, retrying
071117 17:39:14 [Warning] Warning: Enabling keys got errno 22 on warfacts2.worlds, retrying
071117 17:39:43 [Warning] Warning: Enabling keys got errno 22 on warfacts2.worlds_trash, retrying
071117 17:46:56 [Warning] Warning: Enabling keys got errno 22 on warfacts3.worlds, retrying

These tables all have the same structures. There were plenty of other tables inserted, so this seems to be table specific.

 CREATE TABLE `worlds` (
  `ID` int(11) NOT NULL auto_increment,
  `name` char(42) NOT NULL,
  `named` tinyint(4) NOT NULL default '0',
  `system` mediumint(9) NOT NULL default '0',
  `special` enum('','shelter','sanctuary','haven','abrigo','terran','core','aminosre') NOT NULL default '',
  `x` tinyint(3) unsigned NOT NULL default '0',
  `y` tinyint(3) unsigned NOT NULL default '0',
  `z` tinyint(4) NOT NULL default '0',
  `class` enum('terrestrial','gaseous','oceanic','tundral','geothermal','metallic','mountaineous','desert','barren','ice','alien') NOT NULL default 'terrestrial',
  `age` smallint(5) unsigned NOT NULL default '0',
  `atmosphere` enum('none','oxygen','carbon dioxide','acidic','hydrogen') NOT NULL default 'none',
  `size` mediumint(8) unsigned NOT NULL default '0',
  `landmass` bigint(20) unsigned NOT NULL default '0',
  `gravity` float unsigned NOT NULL default '0',
  `temperature` smallint(6) NOT NULL default '0',
  `weather` enum('steady','mild','unstable','harsh','violent') NOT NULL,
  `water` tinyint(3) unsigned NOT NULL default '0',
  `carbon` tinyint(3) unsigned NOT NULL default '0',
  `iron` tinyint(3) unsigned NOT NULL default '0',
  `copper` tinyint(3) unsigned NOT NULL default '0',
  `silver` tinyint(3) unsigned NOT NULL default '0',
  `gold` tinyint(3) unsigned NOT NULL default '0',
  `platinum` tinyint(3) unsigned NOT NULL default '0',
  `titanium` tinyint(3) unsigned NOT NULL default '0',
  `uranium` tinyint(3) unsigned NOT NULL default '0',
  `oil` tinyint(3) unsigned NOT NULL default '0',
  `fertilization` tinyint(3) unsigned NOT NULL default '0',
  `custom` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`ID`),
  KEY `special` (`special`),
  KEY `classjoin` (`ID`,`class`),
  KEY `atmojoin` (`ID`,`atmosphere`),
  KEY `gravjoin` (`ID`,`gravity`),
  KEY `system` (`system`,`ID`),
  KEY `system_2` (`system`,`atmosphere`,`temperature`,`gravity`,`landmass`,`fertilization`,`carbon`,`iron`,`copper`,`class`),
  KEY `iron_join` (`ID`,`iron`),
  KEY `copper_join` (`ID`,`copper`),
  KEY `silver_join` (`ID`,`silver`),
  KEY `gold_join` (`ID`,`gold`),
  KEY `platinum_join` (`ID`,`platinum`),
  KEY `titanium_join` (`ID`,`titanium`),
  KEY `uranium_join` (`ID`,`uranium`),
  KEY `oil_join` (`ID`,`oil`),
  KEY `landmass_join` (`ID`,`landmass`),
  KEY `carbon_join` (`ID`,`carbon`)
) ENGINE=MyISAM AUTO_INCREMENT=281471 DEFAULT CHARSET=latin1

Each tables holds several hundred thousand rows.

Server health was good - I could not find anything wrong outside the mysqld.

How to repeat:
No idea, really. It's a production machine and the dump is quite big, so I did not try to reproduce it. However, this error only occured for this table structure, but not for every database with such a table. The data in all these tables was different.

Suggested fix:
Beats me. ;-)
[19 Nov 2007 8:00] Sveta Smirnova
Thank you for the report.

Could you please provide dump for this table? You can attach it as private file.
[20 Nov 2007 13:02] Thomas Auge
The box did have some weird I/O issues (32bit OS with 8GB and PGA) I noticed later. After a clean re-install (Debian 64 bit) I loaded the dump again and the problems were gone. So it's probably safe to assume that it was an actual I/O problem mysql reported correctly.

Sorry for wasting your time.