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

During an online table rebuild of an InnoDB statistics table, opt_search_plan_for_table() may degrade to full table scan

    XMLWordPrintable

Details

    Description

      We've see a server crash due to long semaphore wait. The innodb stats update thread updates stats(dict_stats_save_index_stat()) on a table using InnoDB internal parser, holding dict_operation_lock and dict_sys->mutext, but the plan is full table scan(innodb_index_stats) other than clust index scan. There are more than 200 thousands records in stats table, and there are multiple udpates for the table stats. So it takes more than 900s to finish.

      The reason why stats updates use full table scan is that there is a running SQL: ALTER TABLE mysql.innodb_index_stats ENGINE=InnoDB STATS_PERSISTENT=0. The online DDL set cluster index of innodb_index_stats to ONLINE_INDEX_CREATION.
      callstack:
      prepare_inplace_alter_table_dict
      --row_log_allocate
      ----dict_index_set_online_status

      In function opt_calc_index_goodness():
      343 /* At least for now we don't support using FTS indexes for queries
      344 done through InnoDB's own SQL parser. */
      345 if (dict_index_is_online_ddl(index) || (index->type & DICT_FTS))

      { 346 return(0); 347 }

      In this case we should use the online index.

      Attachments

        Activity

          People

            marko Marko Mäkelä
            tiandiwonder Shaohua Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.