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

Online ALTER TABLE may get stuck in tdc_remove_table

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

          svoj Sergey Vojtovich created issue -
          svoj Sergey Vojtovich made changes -
          Field Original Value New Value
          Assignee Sergey Vojtovich [ svoj ] Sergei Golubchik [ serg ]
          Status Open [ 1 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Affects Version/s 10.2.0 [ 20700 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.2 [ 14601 ]
          serg Sergei Golubchik made changes -
          Sprint 10.1.18 [ 98 ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Sergey Vojtovich [ svoj ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          svoj Sergey Vojtovich made changes -
          Fix Version/s 10.1.18 [ 22110 ]
          Fix Version/s 10.0.28 [ 22107 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 76301 ] MariaDB v4 [ 150572 ]

          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.