Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.9(EOL), 10.10(EOL), 10.11
    • 10.11
    • None

    Description

      https://buildbot.mariadb.org/#/builders/168/builds/14289

      main.lock_sync 'innodb'                  w6 [ fail ]  timeout after 480 seconds
              Test ended at 2022-09-06 08:22:41
      Test case timeout after 480 seconds
      == /buildbot/amd64-ubuntu-1804-clang10-asan/build/mysql-test/var/6/log/lock_sync.log == 
      disconnect con1;
      disconnect con2;
      DROP TABLES t1, t2;
      #
      # MDEV-28567 Assertion `0' in open_tables upon function-related operation
      #
      CREATE TABLE t1 (a INT);
      CREATE TABLE t2 (b INT);
      CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW UPDATE t2 SET b = 0;
      CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW UPDATE t1 SET a = 6;
      CREATE VIEW v1 AS SELECT * FROM t1;
      SET AUTOCOMMIT=OFF;
      SELECT * FROM t1;
      a
      DROP TRIGGER tr1;
      INSERT INTO t2 SELECT * FROM t2;
      SELECT f() FROM t2;
      ERROR 42000: FUNCTION test.f does not exist
      set debug_sync= 'after_open_table_mdl_shared signal s1';
      ALTER VIEW v1 AS SELECT f() FROM t1;
       == /buildbot/amd64-ubuntu-1804-clang10-asan/build/mysql-test/var/6/tmp/analyze-timeout-mysqld.1.err ==
      mysqltest: Could not open connection 'default' after 500 attempts: 2002 Can't connect to local server through socket '/buildbot/amd64-ubuntu-1804-clang10-asan/build/mysql-test/var/tm' (111)
      

      Attachments

        Issue Links

          Activity

            Here is a recent failure:

            10.11 8283948846740a22f96bbe7bccf250708406d5d9

            main.lock_sync 'innodb'                  w55 [ fail ]
                    Test ended at 2022-11-21 10:44:52
             
            CURRENT_TEST: main.lock_sync
            mysqltest: At line 1222: query 'DROP FUNCTION f' failed: ER_SP_DOES_NOT_EXIST (1305): FUNCTION test.f does not exist
            

            marko Marko Mäkelä added a comment - Here is a recent failure: 10.11 8283948846740a22f96bbe7bccf250708406d5d9 main.lock_sync 'innodb' w55 [ fail ] Test ended at 2022-11-21 10:44:52   CURRENT_TEST: main.lock_sync mysqltest: At line 1222: query 'DROP FUNCTION f' failed: ER_SP_DOES_NOT_EXIST (1305): FUNCTION test.f does not exist
            midenok Aleksey Midenkov added a comment - - edited

            Please review 73ccff836fc (bb-10.11-midenok)

            midenok Aleksey Midenkov added a comment - - edited Please review 73ccff836fc ( bb-10.11-midenok )
            svoj Sergey Vojtovich added a comment -

            The test seem to be broken in quite a few places. Specifically connection switching after send must normally be accompanied by waits for queries to reach appropriate state. Instead it has things like --error 0, ER_LOCK_DEADLOCK to silence its deficiencies. There're at least 3 places that must be inspected, the patch attempts fixing one of them.

            I also don't see why we have to issue 8 sync points in MDL_context::acquire_lock(). IIUC mdl_acquire_lock_wait sync point could have been used for the purpose of fixing this bug.

            svoj Sergey Vojtovich added a comment - The test seem to be broken in quite a few places. Specifically connection switching after send must normally be accompanied by waits for queries to reach appropriate state. Instead it has things like --error 0, ER_LOCK_DEADLOCK to silence its deficiencies. There're at least 3 places that must be inspected, the patch attempts fixing one of them. I also don't see why we have to issue 8 sync points in MDL_context::acquire_lock() . IIUC mdl_acquire_lock_wait sync point could have been used for the purpose of fixing this bug.
            svoj Sergey Vojtovich added a comment - - edited

            Being more specific:

            diff --git a/mysql-test/main/lock_sync.test b/mysql-test/main/lock_sync.test
            index 998c6529462..7cedf8fbeb2 100644
            --- a/mysql-test/main/lock_sync.test
            +++ b/mysql-test/main/lock_sync.test
            @@ -1100,6 +1100,7 @@ SELECT * FROM t1;
             # Seized:   test/t1 (MDL_SHARED_READ)
             
             --connect (con1,localhost,root,,test)
            +set debug_sync='mdl_seized_MDL_SHARED_NO_WRITE_t1 SIGNAL con1_seized';
             --send
               DROP TRIGGER tr1;
             # T@7
            @@ -1109,6 +1110,7 @@ SELECT * FROM t1;
             # Deadlock: test/t1 (MDL_SHARED_WRITE)
             
             --connection default
            +set debug_sync='now WAIT_FOR con1_seized';
             --error 0, ER_LOCK_DEADLOCK
             INSERT INTO t2 SELECT * FROM t2;
             # T@6
            

            First of all --error 0, ER_LOCK_DEADLOCK should be replaced with --error ER_LOCK_DEADLOCK
            Secondly, DROP TRIGGER tr1 can leave required state or even release locks before INSERT INTO t2 SELECT * FROM t2 starts.
            Test must ensure the following sequence is preserved:

            con1: takes MDL_EXCLUSIVE on tr1
            default: takes MDL_SHARED_WRITE on t2
            con1: attempts taking MDL_SHARED_NO_WRITE on t2, waits
            default: attempts taking MDL_SHARED on tr1, deadlocks
            

            I believe existing sync points are more than enough to make it happen.

            @@ -1172,6 +1174,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1;
             --connection default
             set debug_sync= 'now wait_for s1';
             --disable_result_log
            +--error 0, ER_LOCK_DEADLOCK
             SELECT * FROM ( SELECT * FROM v1 ) sq;
             --enable_result_log
             # T@6
            

            Meh, no more recorded unexpected behaviour in this test please. Make proper sequence of calls instead similarly to the above.

            svoj Sergey Vojtovich added a comment - - edited Being more specific: diff --git a/mysql-test/main/lock_sync.test b/mysql-test/main/lock_sync.test index 998c6529462..7cedf8fbeb2 100644 --- a/mysql-test/main/lock_sync.test +++ b/mysql-test/main/lock_sync.test @@ -1100,6 +1100,7 @@ SELECT * FROM t1; # Seized: test/t1 (MDL_SHARED_READ)   --connect (con1,localhost,root,,test) +set debug_sync='mdl_seized_MDL_SHARED_NO_WRITE_t1 SIGNAL con1_seized'; --send DROP TRIGGER tr1; # T@7 @@ -1109,6 +1110,7 @@ SELECT * FROM t1; # Deadlock: test/t1 (MDL_SHARED_WRITE)   --connection default +set debug_sync='now WAIT_FOR con1_seized'; --error 0, ER_LOCK_DEADLOCK INSERT INTO t2 SELECT * FROM t2; # T@6 First of all --error 0, ER_LOCK_DEADLOCK should be replaced with --error ER_LOCK_DEADLOCK Secondly, DROP TRIGGER tr1 can leave required state or even release locks before INSERT INTO t2 SELECT * FROM t2 starts. Test must ensure the following sequence is preserved: con1: takes MDL_EXCLUSIVE on tr1 default: takes MDL_SHARED_WRITE on t2 con1: attempts taking MDL_SHARED_NO_WRITE on t2, waits default: attempts taking MDL_SHARED on tr1, deadlocks I believe existing sync points are more than enough to make it happen. @@ -1172,6 +1174,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1; --connection default set debug_sync= 'now wait_for s1'; --disable_result_log +--error 0, ER_LOCK_DEADLOCK SELECT * FROM ( SELECT * FROM v1 ) sq; --enable_result_log # T@6 Meh, no more recorded unexpected behaviour in this test please. Make proper sequence of calls instead similarly to the above.

            People

              midenok Aleksey Midenkov
              midenok Aleksey Midenkov
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.