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

explain update ,.set..select freeze replica with autocommit=0

Details

    Description

      Testcase to reproduce:

      master

      create database d1;
      use d1;
       
      create table t1 (id int ,PRIMARY KEY (id) );
      create table t2 (id int ,PRIMARY KEY (id) );
       
      insert into t1 (id) values (1),(2),(3),(4);
      insert into t2 (id) values (1),(2),(3),(4);
      

      Replica

      set autocommit = 0;
      explain update t2 set id = (select id from t1);
      

      Master;

      set autocommit = 0;
      explain update t2 set id = (select id from t1);
      

      Replica:

      MariaDB [d1]> select * from t1;
      +----+
      | id |
      +----+
      |  1 |
      |  2 |
      |  3 |
      |  4 |
      +----+
      4 rows in set (0.000 sec)
      

      After commit , it works

      MariaDB [d1]> commit;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [d1]> select * from t1;
      +----+
      | id |
      +----+
      |  1 |
      |  2 |
      |  3 |
      |  4 |
      |  5 |
      +----+
      5 rows in set (0.000 sec)
      

      It seems related to default isolation level REPEATABLE READ.

      With isolation level READ COMITTED it works,
      but explain should not locks slave threads.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Julien Fritsch made transition -
            Open Confirmed
            24d 52m 1
            Sergei Petrunia made transition -
            Confirmed In Review
            20h 42m 1
            Sergei Golubchik made transition -
            In Review Stalled
            104d 5h 48m 1
            Sergei Petrunia made transition -
            Stalled Closed
            56d 13h 18m 1
            Michael Widenius made transition -
            Closed Stalled
            14d 4h 36m 1

            People

              psergei Sergei Petrunia
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              10 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.