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

Server crash on read_statistics_for_tables_if_needed

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.2.22, 10.2.23
    • N/A
    • Optimizer, Server
    • Happened on Windows, but it should happen both on Windows and Linux

    Description

      Recently we got a crash on our MariaDB server, the call stack is

      alloc_histograms_for_table_share
      read_histograms_for_table
      read_statistics_for_tables_if_needed
      open_and_lock_tables
      

      The main problem is that the it try to read histogram of a performance schema table. In my understand, only TABLE_CATEGORY_USER should be read statistics because on open_and_process_table it only init stats when table is TABLE_CATEGORY_USER.
      But when try to read histogram, when call statistics_for_tables_is_needed, the statistics_for_tables_is_needed return true instead of false.
      I found in this commit https://github.com/MariaDB/server/commit/10f6b7001bd7b683c013ae407c2c48793caa3633 ,
      the code changed from

      if (table_share && 
      (table_share->table_category != TABLE_CATEGORY_USER ||
                 table_share->tmp_table != NO_TMP_TABLE))
       return FALSE;
      

      to

       if (table_share && 
       table_share->table_category != TABLE_CATEGORY_USER
                && is_stat_table(tl->db, tl->alias))
      return FALSE;
      

      which means only mysql stats table will be ignored. This code change may be not correct.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Varun Gupta (Inactive) made transition -
            Open In Progress
            13d 21m 1
            Alice Sherepa made transition -
            In Progress Stalled
            1d 25m 1
            Elena Stepanova made transition -
            Stalled Closed
            49d 3h 55m 1

            People

              alice Alice Sherepa
              elemount Alex Lee
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.