Adding Fulltext Index Crashes MySQL

Bug #1615101 reported by Derek Carlson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
New
Undecided
Unassigned

Bug Description

This happens in Percona server 5.6 and 5.7 every version.
Steps to reproduce:
* Have an existing table with data in it. In our case we have a table with approximately 150K rows. (details below)
* Execute alter statement to add a fulltext index. Doesn't matter if it's on a single column or multiple columns, every iteration fails.
* Receive the following error immediately ERROR 2013 (HY000): Lost connection to MySQL server during query
At this point the mysqld process is ended and does not restart.

Please note (and this is important), this only crashes the process if there is a decent amount of data in the table. I am able to create a copy of the table structure only, add the index, then insert the data into the new table, drop the old, and rename the new. This only crashes mysql if I attempt to add the index to a table with data. I tested this copy method at different row numbers. With one record in the table, it works fine. When I added 100 records it crashed.

Found a similar bug report which was closed due to no activity. So I am opening this new report. Reference https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1435558

TABLE INFO:
CREATE TABLE `video` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `videoservice_id` int(11) NOT NULL,
  `created` datetime DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `description` varchar(1024) DEFAULT NULL,
  `youtubeid` varchar(255) DEFAULT NULL,
  `channelid` varchar(255) DEFAULT NULL,
  `channeltitle` varchar(255) DEFAULT NULL,
  `lifetimeviews` int(11) unsigned NOT NULL DEFAULT '0',
  `reviewneeded` tinyint(1) DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `exclude` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_video_videoservice1_idx` (`videoservice_id`),
  KEY `exclude` (`exclude`),
  KEY `youtubeid` (`youtubeid`),
  KEY `title` (`title`),
) ENGINE=InnoDB AUTO_INCREMENT=1520723 DEFAULT CHARSET=utf8;

ALTER COMMAND:
ALTER TABLE video ADD FULLTEXT KEY `titleDescriptionFT` (`title`,`description`);

ERROR DUMP (this particular dump is Percona XtraDB Cluster, but the same behavior occurs on the standard Percona server as well):

2016-08-19 14:59:28 0x7f6995620700 InnoDB: Assertion failure in thread 140091454523136 in file row0merge.cc line 1009
InnoDB: Failing assertion: b == &block[0] + buf->total_size
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.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
18:59:28 UTC - 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.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
Please help us make Percona XtraDB Cluster better by reporting any
bugs at https://bugs.launchpad.net/percona-xtradb-cluster

key_buffer_size=33554432
read_buffer_size=131072
max_used_connections=68
max_threads=501
thread_count=4
connection_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 232075 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
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...
stack_bottom = 0 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0xf6bb05]
/usr/sbin/mysqld(handle_fatal_signal+0x4b4)[0x7c2514]
/lib64/libpthread.so.0(+0xf7e0)[0x7f70e8c377e0]
/lib64/libc.so.6(gsignal+0x35)[0x7f70e6e715e5]
/lib64/libc.so.6(abort+0x175)[0x7f70e6e72dc5]
/usr/sbin/mysqld(_Z18ut_print_timestampP8_IO_FILE+0x0)[0x7ae52a]
/usr/sbin/mysqld[0x11219ac]
/usr/sbin/mysqld(_Z25fts_parallel_tokenizationPv+0x966)[0x110ae06]
/lib64/libpthread.so.0(+0x7aa1)[0x7f70e8c2faa1]
/lib64/libc.so.6(clone+0x6d)[0x7f70e6f27aad]
You may download the Percona XtraDB Cluster operations manual by visiting
http://www.percona.com/software/percona-xtradb-cluster/. You may find information
in the manual which will help you identify the cause of the crash.
2016-08-19T18:59:30.042136Z mysqld_safe Number of processes running now: 0
2016-08-19T18:59:30.043448Z mysqld_safe WSREP: not restarting wsrep node automatically
2016-08-19T18:59:30.045430Z mysqld_safe mysqld from pid file /var/lib/mysql//iophx-pxc01.iophx.aimitservices.com.pid ended

Revision history for this message
Derek Carlson (dekek) wrote :

Did some more testing. This may be a character issue. When I do the create copy, insert 100 rows method, and update the title and description to random values (using RAND()), then apply the index it works. This data is populated from YouTube video API, so several titles and descriptions have goofy characters. I can provide sample data if needed.

Revision history for this message
Dan (danschofy) wrote :
Download full text (4.8 KiB)

Hi,
I'd like to jump in on this as we're currently having issues with this on version Percona XtraDb 5.6.22-72.0-56-log

One of our tables which is re-created daily has grown in size. Initially no problems occurred, but as we're ~150k rows we are experiencing issues on our production server.

It was building a single insert statement that failed and caused the node to crash, after splitting this up the data inserted ok, but now fails creating the index.

[HY000]: General error: 2013 Lost connection to MySQL server during query. Query : [ CREATE FULLTEXT INDEX idx on catalog_production.product_catalog (product_code, brand_name, title, description)

13:18:29 UTC - mysqld got signal 11 ;
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.
Please help us make Percona XtraDB Cluster better by reporting any
bugs at https://bugs.launchpad.net/percona-xtradb-cluster

key_buffer_size=33554432
read_buffer_size=131072
max_used_connections=26
max_threads=502
thread_count=6
connection_count=4
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 233164 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
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...
stack_bottom = 0 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x8fa965]
/usr/sbin/mysqld(handle_fatal_signal+0x4b4)[0x665644]
/lib64/libpthread.so.0(+0xf710)[0x7f0c43341710]
/usr/sbin/mysqld[0xaa5d7e]
/lib64/libpthread.so.0(+0x79d1)[0x7f0c433399d1]
/lib64/libc.so.6(clone+0x6d)[0x7f0c4183d8fd]
You may download the Percona XtraDB Cluster operations manual by visiting
http://www.percona.com/software/percona-xtradb-cluster/. You may find information
in the manual which will help you identify the cause of the crash.
161019 14:18:30 mysqld_safe Number of processes running now: 0
161019 14:18:30 mysqld_safe WSREP: not restarting wsrep node automatically
161019 14:18:30 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended

The my.cnf file was generated from percona tools using 8GB memory

[mysql]

# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]

# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid

# MyISAM #
key-buffer-size = 32M
myisam-recover = FORCE,BACKUP

# SAFETY #
max-allowed-packet = 256M
max-connect-errors = 1000000

# DATA STORAGE #
datadir = /var/lib/mysql/
tmpdir = /tmp

# BINARY LOGGIN...

Read more...

Revision history for this message
Dan (danschofy) wrote :

Just to update I increased ram on each node and doubled the default value of wsrep_max_ws_rows.
It seems stable now, just wish the error was more easily trackable.

Revision history for this message
Dan (danschofy) wrote :

spoke too soon, i'll create a new thread

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3520

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.