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

Various issues when using RESET MASTER and innodb_flush_log_at_timeout

    XMLWordPrintable

Details

    Description

      Example testcase:

      # mysqld options required for replay: --log_bin
      SET GLOBAL innodb_flush_log_at_timeout=300;
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      SELECT SLEEP(2);
      RESET MASTER;
      

      Various issues observed:
      1. When the testcase is executed in the CLI , itwill lead to a temporary client hang:

      11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug)

      11.2.6-dbg>SET GLOBAL innodb_flush_log_at_timeout=300;
      Query OK, 0 rows affected (0.000 sec)
       
      11.2.6-dbg>CREATE TABLE t (c INT) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.008 sec)
       
      11.2.6-dbg>SELECT SLEEP(2);
       
      +----------+
      | SLEEP(2) |
      +----------+
      |        0 |
      +----------+
      1 row in set (2.000 sec)
       
      11.2.6-dbg>RESET MASTER;
      Query OK, 0 rows affected (4 min 57.568 sec)
      

      The RESET MASTER should execute immediately. The few seconds difference is likely due to the SLEEP vs flushing delay.
      2. When the SLEEP is removed, the exec is immediate:

      11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug)

      11.2.6-dbg>SET GLOBAL innodb_flush_log_at_timeout=300;
      Query OK, 0 rows affected (0.000 sec)
       
      11.2.6-dbg>CREATE TABLE t (c INT) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.007 sec)
       
      11.2.6-dbg>RESET MASTER;
      Query OK, 0 rows affected (0.007 sec)
      

      3. When the RESET MASTER in #1 is killed with CTRL+c, the query shows as "Killed starting" in the processlist;

      11.2.6 a8517608894f43954e210035d357400b3d637195 (Debug)

      11.2.6-dbg>SHOW PROCESSLIST;
      +----+------+-----------+------+---------+------+----------+------------------+----------+
      | Id | User | Host      | db   | Command | Time | State    | Info             | Progress |
      +----+------+-----------+------+---------+------+----------+------------------+----------+
      |  5 | root | localhost | test | Killed  |   37 | starting | RESET master     |    0.000 |
      |  6 | root | localhost | test | Query   |    0 | starting | show processlist |    0.000 |
      +----+------+-----------+------+---------+------+----------+------------------+----------+
      2 rows in set (0.000 sec)
      

      4. When the RESET MASTER is executing, mariadb-admin will hang.

      https://mariadb.com/kb/en/innodb-system-variables/#innodb_flush_log_at_timeout

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              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.