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

InnoDB attempts UPDATE with DB_TRX_ID=0 if innodb_force_recovery=3

    XMLWordPrintable

Details

    Description

      InnoDB in MariaDB 10.2 fails to refuse UPDATE if the server is in read-only mode, and will hit a debug assertion failure because trx->id is 0 due to the read-only mode. This can be repeated with a slightly modified test:

      diff --git a/mysql-test/suite/innodb/t/read_only_recovery.test b/mysql-test/suite/innodb/t/read_only_recovery.test
      index a1a69be724b..aea676d3644 100644
      --- a/mysql-test/suite/innodb/t/read_only_recovery.test
      +++ b/mysql-test/suite/innodb/t/read_only_recovery.test
      @@ -4,9 +4,10 @@
       
       --connect(con1, localhost, root)
       CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
      +INSERT INTO t VALUES(1);
       BEGIN;
       # Generate insert_undo log.
      -INSERT INTO t VALUES(1),(2);
      +INSERT INTO t VALUES(2);
       # Generate update_undo log.
       DELETE FROM t WHERE a=2;
       --connection default
      @@ -27,6 +28,7 @@ ROLLBACK;
       SELECT * FROM t;
       SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
       SELECT * FROM t;
      +UPDATE t SET a=3 WHERE a=1;
       --let $restart_parameters= --innodb-read-only
       --source include/restart_mysqld.inc
       --echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
      

      10.0 and 10.1 are behaving correctly:

      CURRENT_TEST: innodb.read_only_recovery
      mysqltest: At line 29: query 'UPDATE t SET a=3 WHERE a=1' failed: 1036: Table 't' is read only
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.