Bug #68526 Server crash on UPDATEing an InnoDB table when adding a column to the FT index
Submitted: 28 Feb 2013 15:59 Modified: 15 Apr 2013 12:33
Reporter: Dario Kampkaspar Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S2 (Serious)
Version:5.6.10 OS:Windows (Server 2003 (SP2))
Assigned to: CPU Architecture:Any

[28 Feb 2013 15:59] Dario Kampkaspar
Description:
When updating an existing table to include another column to the already existing FT index, the server crashes; The error log says:

2013-02-28 16:19:04 fc4  InnoDB: Assertion failure in thread 4036 in file ut0mem.cc line 105
InnoDB: Failing assertion: ret || !assert_on_error
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
InnoDB: Thread 2744 stopped in file os0sync.cc line 475
InnoDB: Thread 2748 stopped in file os0sync.cc line 783
InnoDB: Thread 2752 stopped in file os0sync.cc line 475
InnoDB: Thread 2756 stopped in file ut0ut.cc line 81
InnoDB: Thread 2772 stopped in file os0sync.cc line 475
InnoDB: Thread 2764 stopped in file ut0ut.cc line 81
InnoDB: Thread 2776 stopped in file os0sync.cc line 475

The last entry was issued at 16:29:11.

Before that, the server had been running since 2013-01-07 without any problems using the FT (neither searching nor adding data).

The table in question was as follows:

CREATE TABLE IF NOT EXISTS `bib` (
  `00` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `18` text COLLATE utf8_unicode_ci COMMENT 'Verf. & Titel / Vorlage',
  `19` text COLLATE utf8_unicode_ci COMMENT 'Titel / Vorlage',
  `20` text CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL COMMENT 'Titel / Ansetzung FT',
  `21` text COLLATE utf8_unicode_ci COMMENT 'Sammlungsvermerk',
  `22` text COLLATE utf8_unicode_ci COMMENT 'Einheitstitel',
  `23` text CHARACTER SET utf8 COLLATE utf8_german2_ci COMMENT 'Nebentitel',
  `23f` text COLLATE utf8_unicode_ci COMMENT 'Früherer Titel',
  `23s` text COLLATE utf8_unicode_ci COMMENT 'späterer Titel',
  `24` text COLLATE utf8_unicode_ci COMMENT 'Paralleltitel',
  `25` text COLLATE utf8_unicode_ci COMMENT 'formale Sachtitelergänzung',
  `26` text COLLATE utf8_unicode_ci COMMENT 'Beigaben',
  `28` text CHARACTER SET utf8 COLLATE utf8_german2_ci COMMENT 'Inhaltsverzeichnis FT',
  `31f` date DEFAULT NULL COMMENT 'Berichtszeitraum von',
  `31t` date DEFAULT NULL COMMENT 'Berichtszeitraum bis',
  `37` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Sprache',
  `39` varchar(700) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Verfasser / Vorlage',
  `62` varchar(400) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Ausstellung',
  `70` text COLLATE utf8_unicode_ci COMMENT 'Quelle',
  `704` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Band',
  `706` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Heft',
  `708` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Seiten',
  `71` varchar(400) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Ausgabe',
  `72` varchar(400) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Reprintvermerk',
  `74` bigint(20) unsigned DEFAULT NULL COMMENT 'Ort (falls nicht standard)',
  `74d` bigint(20) unsigned DEFAULT NULL COMMENT 'Druckort',
  `75` smallint(5) unsigned DEFAULT NULL COMMENT 'Verlag',
  `75d` smallint(5) unsigned DEFAULT NULL COMMENT 'Drucker',
  `76` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Jahr',
  `76p` text COLLATE utf8_unicode_ci COMMENT 'Erscheinungsverlauf',
  `77` varchar(400) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Umfang',
  `81` text COLLATE utf8_unicode_ci COMMENT 'allg. FN',
  `818` text COLLATE utf8_unicode_ci COMMENT 'Hochschulschriftenvermerk',
  `819` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Ort, Jahr d. 818',
  `83` bigint(20) unsigned DEFAULT NULL COMMENT 'Tagung',
  `83j` year(4) DEFAULT NULL COMMENT 'Jahr der 83',
  `83l` tinyint(3) unsigned DEFAULT NULL COMMENT 'lfd. Zaehlung',
  `83o` bigint(20) unsigned DEFAULT NULL COMMENT 'Ort der 83',
  `87` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ISBN',
  `88` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ISSN',
  `93` text COLLATE utf8_unicode_ci COMMENT 'enthält',
  `97` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Lieferant',
  `97p` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Preis',
  `99e` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Änderung',
  `99n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Erstellung',
  `z` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`00`),
  KEY `74d` (`74d`),
  KEY `75` (`75`),
  KEY `75d` (`75d`),
  KEY `74` (`74`),
  KEY `83` (`83`),
  FULLTEXT KEY `20` (`20`,`28`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Bücher' AUTO_INCREMENT=97996 ;

The failed command was:

ALTER TABLE `bib` ADD FULLTEXT (`23`);

The same happens when trying to add the column to an existing FT index,

ALTER TABLE `katalog`.`bib` DROP INDEX `20` ,
ADD FULLTEXT `20` (
`20` ,
`28` ,
`23`
)

albeit with a slightly different order of lines in the error log:

InnoDB: Thread 2740 stopped in file os0sync.cc line 783
InnoDB: Thread 2164 stopped in file os0sync.cc line 475
InnoDB: Thread 2748 stopped in file os0sync.cc line 475
InnoDB: Thread 2744 stopped in file ut0ut.cc line 81
InnoDB: Thread 2756 stopped in file ut0ut.cc line 81
InnoDB: Thread 2768 stopped in file os0sync.cc line 475

-

The very same works without a problem on my W2K2R2 test machine.

How to repeat:
Fill the given table with data and execute either of the given queries.
[28 Feb 2013 17:45] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior with dummy data. Could you please send us dump of the table or, even better, its data file if you use --innodb-file-per-table option.

Btw when did you created the table in first place? If before 5.6 try to dump-reload it, then alter.
[1 Mar 2013 13:36] Dario Kampkaspar
Hi,
thanks for the quick reply.

Although first tests with this table layout were made as early as 5.6.4, the table currently in use is a dump-reload after a clean install of 5.6.10 on the server machine.

I'll add the .ibd; if you need anything else, please let me know.
[1 Mar 2013 14:21] Dario Kampkaspar
I just noticed a typo in my original posting.

To clarify:
The server, on which the operation fails is a Win 2003 Std. Ed., SP2.
My testing machine, which shows no signs of problems, is a Win 2008 R2
[12 Mar 2013 9:19] MySQL Verification Team
InnoDB ran out of memory.  How much was the process consuming, and how much is available to the server?

This could be a known bug, addressed in future version of MySQL.
You can lower the "innodb_ft_cache_size" but there can still be a memory issue if you have many fulltext indexes across the entire database, and not enough free memory.
[12 Mar 2013 12:12] Dario Kampkaspar
Shane,

the process maxed out at about 720 MB, usually it was in the range 650 - 700 MB. There would have been at least 1GB freely available to the server at that time.
In normal operations, it uses about 340MB.

There are indeed several FT indexes present in this database (7, IIRC).

If I get around to it, I will add some memory to the machine and see whether the issue still occurs.
[16 Apr 2013 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".