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

Online ALTER TABLE may get stuck in tdc_remove_table

    XMLWordPrintable

Details

    • 10.1.18

    Description

      Test case:

      --source include/have_xtradb.inc
       
      CREATE TABLE t1(a INT) ENGINE=InnoDB;
      SELECT * FROM t1;
      --send SET @@global.table_open_cache=400;
       
      connect(con1, localhost, root);
      ALTER TABLE t1 COMMENT='abc';
      disconnect con1;
       
      connection default;
      --reap
      DROP TABLE t1;
      

      Apply this patch to make it stuck reliably:

      diff --git a/sql/table_cache.cc b/sql/table_cache.cc
      index 097f37d..b46a620 100644
      --- a/sql/table_cache.cc
      +++ b/sql/table_cache.cc
      @@ -865,6 +865,8 @@ void tdc_release_share(TABLE_SHARE *share)
         }
         mysql_mutex_unlock(&share->tdc.LOCK_table_share);
       
      +  if (!strcmp(share->table_name.str, "t1") && !share->tdc.flushed)
      +    sleep(1);
         mysql_mutex_lock(&LOCK_unused_shares);
         mysql_mutex_lock(&share->tdc.LOCK_table_share);
         if (share->tdc.flushed)
      

      Attachments

        Activity

          People

            svoj Sergey Vojtovich
            svoj Sergey Vojtovich
            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.