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:
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:
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

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 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. 

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
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
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.