Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6497

InnoDB deadlocks on UNINSTALL PLUGIN

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.38, 10.0.12
    • 5.5.39, 10.0.13
    • None
    • 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.

      Attachments

        Activity

          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);

          serg Sergei Golubchik added a comment - 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);

          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.

          jplindst Jan Lindström (Inactive) added a comment - 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.

          People

            serg Sergei Golubchik
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.