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

--source include/restart_mysqld.inc fails in Spider test suite

Details

    Description

      --source include/restart_mysqld.inc results in a test failure in Spider suites, with no output from mysqltest. Putting the following MTR test case to storage/spider/mysql-test/spider/bugfix/t reproduces the bug.

      --source include/restart_mysqld.inc
      

      This doesn't happen at least in the main suite and the include file is used elsewhere. So, I expect that the problem is Spider-specific.

      The Spider hangs on the server startup on 10.4+ (MDEV-22979) and thus the failure is expected on 10.4+. However, even on 10.2, the test fails. This is possibly due to a different reason.

      Attachments

        Issue Links

          Activity

            The real problem is that shutdown_mysqld.inc (and, likely, other .inc files too) use @@server_id while mtr uses group suffix. If .inc files would be using the correct file name, spider tests wouldn't need to specify the expect file manually.

            I suggest the following fix instead

            ---let $_server_id= `SELECT @@server_id`
            ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
            +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
            +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
            

            that seems to work correctly for your spider test case and for other test cases too.

            Perhaps this should be done in all other include files that use $_expect_file_name ?

            Note, after this change innodb/t/temporary_table.test will fail, because it changes tmpdir to /dev/null/nonexistent. Can be fixed with

            ---exec echo "restart: --tmpdir=/dev/null/nonexistent" > $_expect_file_name
            +--exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR" > $_expect_file_name
            

            (and also add_suppression() at the top of the file needs to be adjusted)

            serg Sergei Golubchik added a comment - The real problem is that shutdown_mysqld.inc (and, likely, other .inc files too) use @@server_id while mtr uses group suffix. If .inc files would be using the correct file name, spider tests wouldn't need to specify the expect file manually. I suggest the following fix instead ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect that seems to work correctly for your spider test case and for other test cases too. Perhaps this should be done in all other include files that use $_expect_file_name ? Note, after this change innodb/t/temporary_table.test will fail, because it changes tmpdir to /dev/null/nonexistent . Can be fixed with ---exec echo "restart: --tmpdir=/dev/null/nonexistent" > $_expect_file_name +--exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR" > $_expect_file_name (and also add_suppression() at the top of the file needs to be adjusted)
            ycp Yuchen Pei added a comment - - edited

            Thanks for the review serg, PTAL thanks: https://github.com/MariaDB/server/commit/0548a185a1e

            ycp Yuchen Pei added a comment - - edited Thanks for the review serg , PTAL thanks: https://github.com/MariaDB/server/commit/0548a185a1e

            0548a185a1e looks good, thanks. Ok to push

            serg Sergei Golubchik added a comment - 0548a185a1e looks good, thanks. Ok to push
            ycp Yuchen Pei added a comment - - edited

            I got back to this task today and tested the patch for 10.3-11.1 (hopefully for the last time). I tried to push to 10.3 but got rejected:

            remote: error: GH006: Protected branch update failed for refs/heads/10.3.        
            remote: error: You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information.        
            To ssh://ssh.github.com/MariaDB/server.git
             ! [remote rejected]         bb-10.3-mdev-27912 -> 10.3 (protected branch hook declined)
            error: failed to push some refs to 'ssh://ssh.github.com/MariaDB/server.git'
            

            The CI displays a green checkmark[1]. I wonder whether this means the branch is locked. serg Shall I try pushing to 10.4 instead?
            [1] https://github.com/MariaDB/server/commit/88a589d4efa

            ycp Yuchen Pei added a comment - - edited I got back to this task today and tested the patch for 10.3-11.1 (hopefully for the last time). I tried to push to 10.3 but got rejected: remote: error: GH006: Protected branch update failed for refs/heads/10.3. remote: error: You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information. To ssh://ssh.github.com/MariaDB/server.git ! [remote rejected] bb-10.3-mdev-27912 -> 10.3 (protected branch hook declined) error: failed to push some refs to 'ssh://ssh.github.com/MariaDB/server.git' The CI displays a green checkmark [1] . I wonder whether this means the branch is locked. serg Shall I try pushing to 10.4 instead? [1] https://github.com/MariaDB/server/commit/88a589d4efa
            ycp Yuchen Pei added a comment -

            Pushed to 10.4, and in time it will be merged to newer versions.

            10.5, 10.6 have merge conflicts, and reference commits were pushed to bb-10.

            {5,6}

            -mdev-27912.

            ycp Yuchen Pei added a comment - Pushed to 10.4, and in time it will be merged to newer versions. 10.5, 10.6 have merge conflicts, and reference commits were pushed to bb-10. {5,6} -mdev-27912.

            People

              ycp Yuchen Pei
              nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
              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.