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

Test main.cte_nonrecursive on sporadic failures

Details

    Description

      I've noticed several times failures of the main.cte_nonrecursive test. They usually don't repeat when restarting the test, so they seem sporadic.

      Example:

      main.cte_nonrecursive                    w3 [ fail ]
              Test ended at 2021-11-27 23:03:54
       
      CURRENT_TEST: main.cte_nonrecursive
      mysqltest: At line 1220: query 'drop database test' failed: ER_DB_DROP_RMDIR (1010): Error dropping database (can't rmdir './test', errno: 39 "Directory not empty")
       
      The result from queries just before the failure was:
      < snip >
      # MDEV-18460: Server crashed in strmake / tdc_create_key /
      # THD::create_tmp_table_def_key
      #
      connect con1,localhost,root,,;
      CREATE TEMPORARY TABLE test.t (a INT);
      WITH cte AS (SELECT 1) SELECT * FROM cte;
      1
      1
      WITH t AS (SELECT 1) SELECT * FROM t;
      1
      1
      WITH cte AS (SELECT 1) SELECT * FROM t;
      ERROR 3D000: No database selected
      DROP TABLE test.t;
      connection default;
      disconnect con1;
      #
      # MDEV-22781: create view with CTE without default database
      #
      drop database test;
       
      More results from queries before failure can be found in /tmp/tmp.SRpydvPo6F/var/3/log/cte_nonrecursive.log
       
       - saving '/tmp/tmp.SRpydvPo6F/var/3/log/main.cte_nonrecursive/' to '/tmp/tmp.SRpydvPo6F/var/log/main.cte_nonrecursive/'
      

      Occurences:

      I've seen this failure on MariaDB 10.4 a couple of times too, so I don't think it is specific for 10.6.

      Attachments

        Activity

          otto, I see that the test is executing several DROP DATABASE. The problematic one in your report is

          drop database test;
          

          I remember that monty has stated earlier (related to versioning tests) that the test database should never be dropped or re-created. That is, this failure could be worked around by slightly changing the test.

          It would be helpful to know which files existed in the directory when it was not empty, so that we would know which earlier test might have left some garbage files behind in that directory. In 10.6, the culprit should not be InnoDB (MDEV-21283).

          I made a quick attempt based on https://salsa.debian.org/mariadb-team/mariadb-server/-/jobs/2225231/raw as follows:

          • compiled CMAKE_BUILD_TYPE=RelWithDebInfo of mariadb-10.6.5
          • extracted the names of all 172 tests that were run on w3 up to the failure
          • invoked ./mtr --no-reorder main.ipv6 main.sp_trans_log … main.create_utf8 main.cte_nonrecursive

          Unfortunately, the test main.cte_nonrecursive always passed on my system. I attempted it 3 times.

          marko Marko Mäkelä added a comment - otto , I see that the test is executing several DROP DATABASE . The problematic one in your report is drop database test; I remember that monty has stated earlier (related to versioning tests) that the test database should never be dropped or re-created. That is, this failure could be worked around by slightly changing the test. It would be helpful to know which files existed in the directory when it was not empty, so that we would know which earlier test might have left some garbage files behind in that directory. In 10.6, the culprit should not be InnoDB ( MDEV-21283 ). I made a quick attempt based on https://salsa.debian.org/mariadb-team/mariadb-server/-/jobs/2225231/raw as follows: compiled CMAKE_BUILD_TYPE=RelWithDebInfo of mariadb-10.6.5 extracted the names of all 172 tests that were run on w3 up to the failure invoked ./mtr --no-reorder main.ipv6 main.sp_trans_log … main.create_utf8 main.cte_nonrecursive Unfortunately, the test main.cte_nonrecursive always passed on my system. I attempted it 3 times.

          otto, would the following change to the test fix the failure?

          diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
          index 17c73f74a49..3d56754b2a8 100644
          --- a/mysql-test/main/cte_nonrecursive.result
          +++ b/mysql-test/main/cte_nonrecursive.result
          @@ -1693,7 +1693,9 @@ disconnect con1;
           #
           # MDEV-22781: create view with CTE without default database
           #
          -drop database test;
          +create database db;
          +use db;
          +drop database db;
           create database db1;
           create table db1.t1 (a int);
           insert into db1.t1 values (3),(7),(1);
          @@ -1723,7 +1725,6 @@ a
           drop view db1.v1;
           drop table db1.t1;
           drop database db1;
          -create database test;
           use test;
           #
           # MDEV-24597: CTE with union used multiple times in query
          diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test
          index 8ab3bddc410..82afcdb9b8e 100644
          --- a/mysql-test/main/cte_nonrecursive.test
          +++ b/mysql-test/main/cte_nonrecursive.test
          @@ -1217,7 +1217,9 @@ DROP TABLE test.t;
           --echo # MDEV-22781: create view with CTE without default database
           --echo #
           
          -drop database test;
          +create database db;
          +use db;
          +drop database db;
           create database db1;
           create table db1.t1 (a int);
           insert into db1.t1 values (3),(7),(1);
          @@ -1239,7 +1241,6 @@ drop view db1.v1;
           drop table db1.t1;
           drop database db1;
           
          -create database test;
           use test;
           
           --echo #
          

          marko Marko Mäkelä added a comment - otto , would the following change to the test fix the failure? diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result index 17c73f74a49..3d56754b2a8 100644 --- a/mysql-test/main/cte_nonrecursive.result +++ b/mysql-test/main/cte_nonrecursive.result @@ -1693,7 +1693,9 @@ disconnect con1; # # MDEV-22781: create view with CTE without default database # -drop database test; +create database db; +use db; +drop database db; create database db1; create table db1.t1 (a int); insert into db1.t1 values (3),(7),(1); @@ -1723,7 +1725,6 @@ a drop view db1.v1; drop table db1.t1; drop database db1; -create database test; use test; # # MDEV-24597: CTE with union used multiple times in query diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test index 8ab3bddc410..82afcdb9b8e 100644 --- a/mysql-test/main/cte_nonrecursive.test +++ b/mysql-test/main/cte_nonrecursive.test @@ -1217,7 +1217,9 @@ DROP TABLE test.t; --echo # MDEV-22781: create view with CTE without default database --echo # -drop database test; +create database db; +use db; +drop database db; create database db1; create table db1.t1 (a int); insert into db1.t1 values (3),(7),(1); @@ -1239,7 +1241,6 @@ drop view db1.v1; drop table db1.t1; drop database db1; -create database test; use test; --echo #

          I pushed the test case cleanup to 10.3 and merged to all later-vesion branches.

          marko Marko Mäkelä added a comment - I pushed the test case cleanup to 10.3 and merged to all later-vesion branches.

          People

            marko Marko Mäkelä
            otto Otto Kekäläinen
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.