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

Oddities around innodb_fatal_semaphore_wait_threshold and global.innodb_disallow_writes

Details

    Description

      Discussing with Marko.

      # mysqld options required for replay:  --innodb_fatal_semaphore_wait_threshold=7
      SET @@global.innodb_disallow_writes=ON;
      CREATE TABLE t (c INT);
      

      Then connect with another client:

      10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

      10.6.0>SHOW FULL PROCESSLIST;
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      | Id | User | Host      | db   | Command | Time | State          | Info                   | Progress |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      |  4 | root | localhost | test | Query   |  225 | creating table | CREATE TABLE t (c INT) |    0.000 |
      |  5 | root | localhost | test | Query   |    0 | starting       | SHOW FULL PROCESSLIST  |    0.000 |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      2 rows in set (0.000 sec)
      ...
      10.6.0>SHOW FULL PROCESSLIST;
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      | Id | User | Host      | db   | Command | Time | State          | Info                   | Progress |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      |  4 | root | localhost | test | Query   |  604 | creating table | CREATE TABLE t (c INT) |    0.000 |
      |  5 | root | localhost | test | Query   |    0 | starting       | SHOW FULL PROCESSLIST  |    0.000 |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      2 rows in set (0.000 sec)
      

      This looks normal, except that it should abort after 7 seconds due to the setting. And, CTRL+C kills the query but makes the client hang:

      10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

      10.6.0>CREATE TABLE t (c INT);
      ^CCtrl-C -- query killed. Continuing normally.
      

      And in the other client we can then see a hanging killed thread:

      10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

      10.6.0>SHOW FULL PROCESSLIST;
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      | Id | User | Host      | db   | Command | Time | State          | Info                   | Progress |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      |  4 | root | localhost | test | Killed  |  683 | creating table | CREATE TABLE t (c INT) |    0.000 |
      |  5 | root | localhost | test | Query   |    0 | starting       | SHOW FULL PROCESSLIST  |    0.000 |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      2 rows in set (0.000 sec)
      

      Another CTRL+C in the CLI lets us loose connection with the server (ERROR 2013 (HY000): Lost connection to MySQL server during query), and we can then exit to the command line and re-enter the client, but the killed hanging CREATE TABLE remains.

      10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

      10.6.0>SHOW FULL PROCESSLIST;
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      | Id | User | Host      | db   | Command | Time | State          | Info                   | Progress |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      |  4 | root | localhost | test | Killed  |  811 | creating table | CREATE TABLE t (c INT) |    0.000 |
      |  5 | root | localhost | test | Query   |    0 | starting       | SHOW FULL PROCESSLIST  |    0.000 |
      |  8 | root | localhost | test | Sleep   |   83 |                | NULL                   |    0.000 |
      +----+------+-----------+------+---------+------+----------------+------------------------+----------+
      3 rows in set (0.001 sec)
      

      Other various related testcases give other outcomes it seems (more testing to be done).

      Attachments

        Issue Links

          Activity

            Fix for rsync race condition pushed to 10.3. Ref: https://github.com/MariaDB/server/pull/2053

            jplindst Jan Lindström (Inactive) added a comment - Fix for rsync race condition pushed to 10.3. Ref: https://github.com/MariaDB/server/pull/2053

            MDEV-28185 needs to be fixed before the variable innodb_disallow_writes can be removed.

            marko Marko Mäkelä added a comment - MDEV-28185 needs to be fixed before the variable innodb_disallow_writes can be removed.

            jplindst, I see that you already pushed something with this ticket number. I suggest that this ticket be closed and the parameter innodb_disallow_writes be removed in 10.5 or a later release under MDEV-25975, because I do not think that it is easy to refactor the locking around the Galera rsync snapshot transfer in older releases.

            marko Marko Mäkelä added a comment - jplindst , I see that you already pushed something with this ticket number. I suggest that this ticket be closed and the parameter innodb_disallow_writes be removed in 10.5 or a later release under MDEV-25975 , because I do not think that it is easy to refactor the locking around the Galera rsync snapshot transfer in older releases.

            I submitted a proposed simpler fix in MDEV-25975.

            marko Marko Mäkelä added a comment - I submitted a proposed simpler fix in MDEV-25975 .

            The variable innodb_disallow_writes was removed in MDEV-25975.

            marko Marko Mäkelä added a comment - The variable innodb_disallow_writes was removed in MDEV-25975 .

            People

              jplindst Jan Lindström (Inactive)
              Roel Roel Van de Paar
              Votes:
              1 Vote for this issue
              Watchers:
              9 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.