Bug #56137 | Assertion `thd->lock == 0' failed on upgrading from 5.1.50 to 5.5.6 | ||
---|---|---|---|
Submitted: | 20 Aug 2010 8:12 | Modified: | 13 Nov 2010 16:44 |
Reporter: | Nirbhay Choubey | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.5.6-m3-debug | OS: | Any |
Assigned to: | Dmitry Lenev | CPU Architecture: | Any |
Tags: | mysql-5.5, upgrade |
[20 Aug 2010 8:12]
Nirbhay Choubey
[21 Aug 2010 11:42]
Sveta Smirnova
Thank you for the report. I can not repeat described behavior with mysql-next-mr tree. Which tree do you use? How do you build it?
[21 Aug 2010 17:55]
Nirbhay Choubey
The newer server in the above upgrade scenario is a build from mysql-5.5 tree using cmake/make. cmake . -DWITH_DEBUG=1 -DWITH_DEBUG_FULL=1 -DWITH_INNODB_STORAGE_ENGINE=1
[21 Aug 2010 19:11]
Sveta Smirnova
Thank you for the feedback. Verified as described. To repeat it is required to repeat all steps as described. Starting server with --skip-grant-tables, then loading dump does not lead to crash.
[30 Aug 2010 11:56]
Dmitry Lenev
Preliminary analysis shows that this bug was introduced by one of pre-requisite patches for bug#52044.
[30 Aug 2010 16:32]
Nirbhay Choubey
The issue still exists with the latest mysql-5.5 *debug* build (Ver : 5.5.7-m3 Linux ) However, this crash is not noticed with latest mysql-5.5 *non-debug* build.
[31 Aug 2010 8:11]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/117183 3124 Dmitry Lenev 2010-08-31 Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from 5.1.50 to 5.5.6". Debug builds of server aborted due to assertion failure when one run DROP DATABASE statement on an installation which had outdated or corrupted mysql.proc table. Particularly this affected mysql_upgrade tool which was run as part of 5.1 to 5.5 upgrade. The problem was that sp_drop_db_routines(), which was invoked during dropping of database, could have returned without closing and unlocking mysql.proc table in case when this table was not up-to-date with current server. As result further attempt to open and lock mysql.event table, which was necessary to complete dropping of database, ended up with assert. This patch solves this problem by ensuring that sp_drop_db_routines() always closes mysql.proc table and releases metadata locks on it. This is achieved by changing open_proc_table_for_update() function to close tables and release metadata locks acquired by it in case of failure. This step also makes behavior of the latter function consistent with behavior of open_proc_table_for_read()/ open_and_lock_tables(). Test case for this bug was added to sp-destruct.test.
[31 Aug 2010 9:02]
Jon Olav Hauglid
Patch approved.
[31 Aug 2010 9:05]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/117185 3124 Dmitry Lenev 2010-08-31 Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from 5.1.50 to 5.5.6". Debug builds of the server aborted due to an assertion failure when DROP DATABASE statement was run on an installation which had outdated or corrupt mysql.proc table. Particularly this affected the mysql_upgrade tool which is run as part of 5.1 to 5.5 upgrade. The problem was that sp_drop_db_routines(), which was invoked during dropping of the database, could have returned without closing and unlocking mysql.proc table in cases when this table was not up-to-date with the current server. As a result further attempt to open and lock the mysql.event table, which was necessary to complete dropping of the database, ended up with an assert. This patch solves this problem by ensuring that sp_drop_db_routines() always closes mysql.proc table and releases metadata locks on it. This is achieved by changing open_proc_table_for_update() function to close tables and release metadata locks acquired by it in case of failure. This step also makes behavior of the latter function consistent with behavior of open_proc_table_for_read()/ open_and_lock_tables(). Test case for this bug was added to sp-destruct.test.
[31 Aug 2010 9:12]
Dmitry Lenev
Queued into mysql-5.5-runtime tree.
[10 Sep 2010 18:52]
Bugs System
Pushed into mysql-5.5 5.5.7-rc (revid:joerg@mysql.com-20100910184813-csdto6tk4nlogrsq) (version source revid:alik@sun.com-20100831135426-h5a4s2w6ih1d8q2x) (merge vers: 5.5.6-m3) (pib:21)
[13 Sep 2010 13:50]
Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:dlenev@mysql.com-20100913103627-p2oqplu42x1gv2bd) (version source revid:dlenev@mysql.com-20100913095811-ken3pb2y9n82suwv) (merge vers: 5.6.1-m4) (pib:21)
[13 Sep 2010 13:52]
Bugs System
Pushed into mysql-next-mr (revid:dlenev@mysql.com-20100913121556-sfxqlpj9kbc28kaf) (version source revid:alik@sun.com-20100831135426-h5a4s2w6ih1d8q2x) (pib:21)
[23 Sep 2010 22:33]
Paul DuBois
Noted in 5.5.7, 5.6.1 changelogs. In debug builds, the server raised an assertion for DROP DATABASE in installations that had an outdated or corrupted mysql.proc table. For example, this affected mysql_upgrade when run as part of a MySQL 5.1 to 5.5 upgrade.
[9 Nov 2010 19:44]
Bugs System
Pushed into mysql-5.5 5.5.7-rc (revid:sunanda.menon@sun.com-20101109182959-otkxq8vo2dcd13la) (version source revid:marko.makela@oracle.com-20100824081003-v4ecy0tga99cpxw2) (merge vers: 5.1.50) (pib:21)
[13 Nov 2010 16:04]
Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:marko.makela@oracle.com-20100824081003-v4ecy0tga99cpxw2) (merge vers: 5.1.50) (pib:21)
[13 Nov 2010 16:37]
Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101113160336-atmtmfb3mzm4pz4i) (version source revid:marko.makela@oracle.com-20100824081003-v4ecy0tga99cpxw2) (pib:21)