Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-6113

If ANALYZE TABLE with persistent statistics ran more than 600 seconds the execution of a diagnostic query may cause a server exit.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.7.27-30
    • Fix Version/s: 5.7.29-32
    • Component/s: None
    • Labels:

      Description

      Description:
      Diagnostic query, accessing DATA_LEGTH or INDEX_LENGTH from information_schema.TABLES table which runs in parallel with long ANALYZE TABLE crashes the server. This can be a query, accessing information_schema.TABLES directly as well as a query like SHOW TABLE STATUS.

      While this crash is intetional both operations are valid, there is no deadlock. If ANALYZE TABLE runs slightly less than 600 seconds both queries finish successfully.

      How to repeat:
      1. Create a table with indexes big enough to ANALYZE TABLE to run more than 600 seconds. Use large value for STATS_SAMPLE_PAGES

      2. Start ANALYZE TABLE

      3. In parallel connection run

      SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND ENGINE IS NOT NULL GROUP BY ENGINE ORDER BY ENGINE ASC
      

      4. Wait for slightly more than 600 seconds and observe the crash.

      Suggested fix:
      Do not crash.

      ha_innobase::info_low accepts flag HA_STATUS_NO_LOCK Maybe call such a diagnostic query with this flag?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kamil.holubicki Kamil Holubicki
              Reporter:
              sveta.smirnova Sveta Smirnova
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1 week, 2 days, 1 hour, 15 minutes
                  1w 2d 1h 15m

                    Smart Checklist