Bug #45009 5.1.34, Lost connection to MySQL when executing 'CHECK TABLE ... FOR UPGRADE'
Submitted: 21 May 2009 14:32 Modified: 7 Dec 2016 16:45
Reporter: Suresh Shanmughom Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:5.1.34 CS OS:Linux (2.6.18-92.1.6.el5 x86_64)
Assigned to: CPU Architecture:Any
Tags: ERROR 2006 (HY000): MySQL server has gone away, Upgrade failed, Upgrade to 5.1.34 from 5.1.30 Got error: 2013: Lost connection to MySQL server d

[21 May 2009 14:32] Suresh Shanmughom
Description:
Hello,

We have an existing 5.1.30 database that uses MyIsam and InnoDB storage engines and table partition option.

We were upgrading the server to 5.1.34, and got the following errors while running mysql_upgrade:
/usr/bin/mysqlcheck: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE ...  FOR UPGRADE' 

The mysql upgrade process failed after checking a few tables in one of the databases (WORKING_DATA) that has partitioned tables.  

Got the following errors while executing show tables locally (from the server):
mysql> show tables ;
        ERROR 2006 (HY000): MySQL server has gone away
        No connection. Trying to reconnect...
        Connection id:    1
        Current database: WORKING_DATA

All othere dbs looks good except WORKING_DATA.

But we can run show tables from a remote client/MySQL Query Browser with out problems.  

We down graded the mysql client to 5.1.30, but no help.  
Then we removed all rpms completely and installed 5.1.34, again no hlep. 

Some stats:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.34 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

msql> show variables like '%out%';
+--------------------------------+-------+
| Variable_name                  | Value |
+--------------------------------+-------+
| connect_timeout                | 10    |
| delayed_insert_timeout         | 300   |
| innodb_lock_wait_timeout       | 1     |
| innodb_rollback_on_timeout     | OFF   |
| interactive_timeout            | 28800 |
| log_bin_trust_routine_creators | OFF   |
| log_output                     | FILE  |
| net_read_timeout               | 30    |
| net_write_timeout              | 60    |
| slave_net_timeout              | 3600  |
| table_lock_wait_timeout        | 50    |
| wait_timeout                   | 28800 |
+--------------------------------+-------+
12 rows in set (0.00 sec)

mysql> SHOW VARIABLES LIKE '%partition%';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| have_partitioning | YES   |
+-------------------+-------+
1 row in set (0.00 sec)

Please let us know how to resolve this issue.

How to repeat:
Upgrade MySQL to 5.1.34 on an existing 5.1.30 that has prtiotioned tables.  

Suggested fix:
?
[21 May 2009 15:02] Valeriy Kravchuk
Thank you for the problem report. Please, upload your entire error log, compressed.
[21 May 2009 15:25] Suresh Shanmughom
We have removed the db that has partioned tables and it works fine. If we put it back then the same issue

Attachment: hpsymd01_swap.err.old.gz (application/x-gzip, text), 41.81 KiB.

[22 May 2009 20:41] Suresh Shanmughom
We have to put the DB back.  The DB is doing good with 5.1.30.  
Please let us know how to resolve this issue.
[25 May 2009 5:15] Sveta Smirnova
Thank you for the feedback.

Please provide output of:

SHOW CREATE TABLE MPV_SCHEDULE;
SHOW PLUGINS;
SHOW VARIABLES LIKE 'open_files_limit';
[25 May 2009 5:16] Sveta Smirnova
Probably duplicate of bug #44030
[25 May 2009 5:18] Sveta Smirnova
Relevant part of error log:

Version: '5.1.34'  socket: '/sql/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) 
090520  0:25:58  InnoDB: Error: (1500) Couldn't read the MAX(SCHEDULE_ID) autoinc value from the index (PRIMARY).
090520  0:25:58  InnoDB: Assertion failure in thread 1172564288 in file handler/ha_innodb.cc line 2601
InnoDB: Failing assertion: error == DB_SUCCESS
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.1/en/forcing-recovery.html
InnoDB: about forcing recovery.
090520  0:25:58 - 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=8
read_buffer_size=131072
max_used_connections=2
max_threads=151
threads_connected=2
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 330113 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0xcef5f10
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 = 0x45e3e118 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x3a)[0x816c7a]
/usr/sbin/mysqld(handle_segfault+0x1fb)[0x5af33b]
/lib64/libpthread.so.0[0x2b69d9a13e80]
/lib64/libc.so.6(gsignal+0x35)[0x2b69da528155]
/lib64/libc.so.6(abort+0x110)[0x2b69da529bf0]
/usr/sbin/mysqld[0x706faf]
/usr/sbin/mysqld(_ZN7handler7ha_openEP8st_tablePKcii+0x2a)[0x677c6a]
/usr/sbin/mysqld(_Z21open_table_from_shareP3THDP14st_table_sharePKcjjjP8st_tableb+0x32c)[0x5f714c]
/usr/sbin/mysqld[0x5ede08]
/usr/sbin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootPbj+0x630)[0x5ecda0]
/usr/sbin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjj+0x52b)[0x5eea0b]
/usr/sbin/mysqld(_Z28open_and_lock_tables_derivedP3THDP10TABLE_LISTb+0x24)[0x5eecf4]
/usr/sbin/mysqld[0x68adc8]
/usr/sbin/mysqld(_Z17mysql_check_tableP3THDP10TABLE_LISTP15st_ha_check_opt+0x4d)[0x68c7fd]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x1fa6)[0x5bc076]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x171)[0x5bfec1]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x3fb)[0x5b8c7b]
/usr/sbin/mysqld(_Z10do_commandP3THD+0xd0)[0x5b8730]
/usr/sbin/mysqld(handle_one_connection+0x10f)[0x5b758f]
/lib64/libpthread.so.0[0x2b69d9a0c307]
/lib64/libc.so.6(clone+0x6d)[0x2b69da5c9ded]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xd11d950 = CHECK TABLE `MPV_SCHEDULE`  FOR UPGRADE
thd->thread_id=4
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
090520 00:25:58 mysqld_safe mysqld from pid file /sql/mysql//hpsymd01_swap.pid ended
090520 00:43:36 mysqld_safe Starting mysqld daemon with databases from /sql/mysql/
090520  0:43:36 [Warning] option 'key_buffer_size': unsigned value 0 adjusted to 8
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
090520  0:43:37  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
090520  0:43:38  InnoDB: Started; log sequence number 719 1774108039
090520  0:43:38 [Note] Event Scheduler: Loaded 0 events
090520  0:43:38 [Note] /usr/sbin/mysqld: ready for connections.
[25 Jun 2009 23: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".
[7 Dec 2016 16:45] Yngve Svendsen
Posted by developer:
 
This relates to EOL (no longer supported) versions of MySQL Server. Thus closing.