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

MTR: --parallel does not work correctly when using LOOP

    XMLWordPrintable

Details

    Description

      Testcase (add as main/test.test or similar):

      --delimiter $$
      BEGIN NOT ATOMIC
        DECLARE CONTINUE HANDLER FOR 1210 BEGIN END;
        LOOP
          SELECT SLEEP(1);
        END LOOP;
      END $$
      --delimiter ;
      

      Run with:

      ./mtr --parallel 10 --repeat 100 test
      

      Output:

      11.3.0 8ad1e26b1bafa4ed9928306efc10c047f2274108

      ...
      Creating var directory '/test/MD110923-mariadb-11.3.0-linux-x86_64-dbg/mariadb-test/var'...
      Checking supported features...
      MariaDB Version 11.3.0-MariaDB-debug
       - SSL connections supported
       - binaries are debug compiled
       - binaries built with wsrep patch
      Collecting tests...
      Installing system database...
       
      ==============================================================================
       
      TEST                                  WORKER RESULT   TIME (ms) or COMMENT
      --------------------------------------------------------------------------
       
      worker[8] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      worker[10] Using MTR_BUILD_THREAD 301, with reserved ports 16020..16039
      worker[7] Using MTR_BUILD_THREAD 302, with reserved ports 16040..16059
      worker[2] Using MTR_BUILD_THREAD 304, with reserved ports 16080..16099
      worker[4] Using MTR_BUILD_THREAD 305, with reserved ports 16100..16119
      worker[3] Using MTR_BUILD_THREAD 306, with reserved ports 16120..16139
      worker[6] Using MTR_BUILD_THREAD 307, with reserved ports 16140..16159
      worker[1] Using MTR_BUILD_THREAD 308, with reserved ports 16160..16179
      worker[9] Using MTR_BUILD_THREAD 309, with reserved ports 16180..16199
      worker[5] Using MTR_BUILD_THREAD 303, with reserved ports 16060..16079
      BEGIN NOT ATOMIC
      DECLARE CONTINUE HANDLER FOR 1210 BEGIN END;
      LOOP
      SELECT SLEEP(1);
      END LOOP;
      END $$
      

      The issue is that only one of the parallel threads will start, while the others do not start at all. The selection of which thread starts seems either random or is based on timing (which thread is first to start):

      /test/MD110923-mariadb-11.3.0-linux-x86_64-dbg/mariadb-test/var$ find . | grep 'mysqld.*err'
      ./3/log/mysqld.1.err
      

      In this case, thread 3 started. No other threads will start . It is quite possible that other types of SQL will also create the same issue.

      Set to critical as fixing this may, or may not (depends on the underlying bug), significantly affect MTR's --parallel performance.
      Feel free to lower once the issue is better understood.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.