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

Inappropriate semi-consistent read in snapshot isolation

    XMLWordPrintable

Details

    Description

      How to repeat:

      /* init */ CREATE TABLE t(a INT, b INT);
      /* init */ INSERT INTO t VALUES (null, 1), (1, 1);
      /* s1 */ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
      /* s2 */ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
       
      /* s1 */ BEGIN;
      /* s2 */ BEGIN;
      /* s1 */ UPDATE t SET b=3;
      /* s2 */ UPDATE t SET b=2 WHERE a;  
      /* s1 */ UPDATE t SET a=1;
      /* s1 */ COMMIT;
      /* s2 */ COMMIT;
       
      /* s1 */ SELECT * FROM t; -- actual: [(1, 3), (1 ,2)], expected: [(1, 2), (1, 2)]
      

      The UPDATE statement of s2 was initially blocked by s1. It recovered after s1's COMMIT, but its query result is incorrect, even though in innodb_snapshot_isolation = ON mode. I found that this case is very similar to MDEV-26643, but MDEV-26643 has already been fixed in innodb_snapshot_isolation = ON mode by disabling semi-consistent read.

      Attachments

        Activity

          People

            vlad.lesin Vladislav Lesin
            zhuangliu Zhuang Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.