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

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

    XMLWordPrintable

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

            People

              psergei Sergei Petrunia
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 7h
                  1d 7h
                  Remaining:
                  Time Spent - 1d 5.75h Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - 1d 5.75h Remaining Estimate - 1h Time Not Required
                  1d 5.75h

                  Git Integration

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