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

Thread hang in 'starting' state on FLUSH TABLES and shutdown hang, where the original table is a LOCKED GTT

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Maintenance

    Description

      CREATE GLOBAL TEMPORARY TABLE t (x INT KEY) ON COMMIT PRESERVE ROWS;
      SELECT * FROM t;
      LOCK TABLE t WRITE;
      FLUSH TABLE t;
      

      Leads to a thread hang

      MDEV-35915-4 CS 12.0.1 f1695245f879f76c9742ad9e74df84ec0ea2a6a4 (Optimized, Clang 21.1.0-20250811) Build 12/09/2025

      12.0.1-opt>SHOW PROCESSLIST;
      +----+------+-----------+------+---------+------+----------+------------------+----------+
      | Id | User | Host      | db   | Command | Time | State    | Info             | Progress |
      +----+------+-----------+------+---------+------+----------+------------------+----------+
      |  4 | root | localhost | test | Query   | 1372 | starting | FLUSH TABLE t    |    0.000 |
      |  5 | root | localhost | test | Query   |    0 | starting | SHOW PROCESSLIST |    0.000 |
      +----+------+-----------+------+---------+------+----------+------------------+----------+
      2 rows in set (0.000 sec)
      

      Additionally, even if the query is interrupted with CTRL+c, a subsequent mariadb-admin shutdown command will also hang (without new client connections being possible).

      This does not happen with ordinary tables ('Query OK' result), nor with regular TT tables ('ERROR 1100 (HY000): Table 't' was not locked with LOCK TABLES' result).

      MyISAM and InnoDB both affected. Testcase is CLI and MTR compatible. UB+ASAN builds have the same outcome, and no *SAN issues observed upon CTRL+c.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              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.