[MDEV-6497] InnoDB deadlocks on UNINSTALL PLUGIN Created: 2014-07-28  Updated: 2014-07-29  Resolved: 2014-07-29

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.38, 10.0.12
Fix Version/s: 5.5.39, 10.0.13

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

On shutdown InnoDB waits for all trx structures to be freed. A trx structure is typically freed when a client disconnects. So, on UNINSTALL PLUGIN InnoDB waits for all trx to be freed, and if the current connection (the one running UNINSTALL) has allocated a trx, it can never be freed.

InnoDB needs to free the current connection trx (if any) on shutdown.



 Comments   
Comment by Sergei Golubchik [ 2014-07-28 ]

jplindst, please review the following patch:

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- storage/innobase/handler/ha_innodb.cc       2014-07-08 14:21:13 +0000
+++ storage/innobase/handler/ha_innodb.cc       2014-07-28 11:45:02 +0000
@@ -2658,6 +2658,13 @@ innobase_end(
 
        if (innodb_inited) {
 
+               THD *thd= current_thd;
+               if (thd) { // may be UNINSTALL PLUGIN statement
+                       trx_t* trx = thd_to_trx(thd);
+                       if (trx)
+                               trx_free_for_mysql(trx);
+               }
+
                srv_fast_shutdown = (ulint) innobase_fast_shutdown;
                innodb_inited = 0;
                hash_table_free(innobase_open_tables);

Comment by Jan Lindström (Inactive) [ 2014-07-28 ]

Hi,

Only one style comment, InnoDB always uses brackets on if i.e

+ if (trx)

{ + trx_free_for_mysql(trx); + }

please check also XtraDB. Ok to push with these changes.

Generated at Thu Feb 08 07:12:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.