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

mariabackup fails with Error 2 on file ... open during ... table copy: No such file or directory

Details

    Description

      The test case below is for reproducing purposes only, don't add it to the regression suite!
      It starts mariabackup and then while it's running keeps executing CREATE OR REPLACE TABLE, alternating engines. Occasionally mariabackup fails with errors like

      Error on file ./test/t.MYD open during `test`.`t` table copy
      

      The failure is not new, it is also reproducible at least on 10.11 and higher. However, I would expect it to work better now with atomic CREATE OR REPLACE. If this expectation is incorrect, please feel free to close or demote.

      The test case already has the loops, so it shouldn't be necessary to run it with --repeat (although it can be done). Alternatively, you can change the max value of repetitions in the upper loop if it doesn't fail with the current 20.

      --let $repeat= 0
      while ($repeat<20) {
        --inc $repeat
        --echo #
        --echo # Attempt # $repeat
        --echo #
        --echo # Starting mariabackup
        --exec $XTRABACKUP --binlog-info=ON --backup --skip-ssl --loose-disable-ssl-verify-server-cert --target-dir=$MYSQL_TMP_DIR/mbackup --protocol=tcp --port=$MASTER_MYPORT --user=root > $MYSQL_TMP_DIR/mbackup.log 2>&1 &
       
        --let $create= 1000
      --disable_query_log
      --echo # Running $create x 2 CREATE OR REPLACE
        while ($create) {
          CREATE OR REPLACE TABLE t (a INT) ENGINE=MyISAM;
          CREATE OR REPLACE TABLE t (a INT) ENGINE=Aria;
          --error 0,1
          --exec grep "Data files backup process is finished with error" $MYSQL_TMP_DIR/mbackup.log
          if ($sys_errno==0) {
            --exec grep "Error" $MYSQL_TMP_DIR/mbackup.log
            --die "Backup ended with an error, see $MYSQL_TMP_DIR/mbackup.log"
          }
          --dec $create
        }
      --enable_query_log
       
        --let $wait=1
        while ($wait) {
          --echo # Waiting for for mariabackup to finish
          --error 0,1
          --exec grep "Data files backup process is finished with error" $MYSQL_TMP_DIR/mbackup.log
          if ($sys_errno==0) {
           --exec grep "Error" $MYSQL_TMP_DIR/mbackup.log
           --die "Backup ended with an error, see $MYSQL_TMP_DIR/mbackup.log"
          }
          --error 0,1
          --exec grep "completed OK" $MYSQL_TMP_DIR/mbackup.log
          if ($sys_errno==0) {
            --let $wait=0
          }
          if ($sys_errno>0) {
            --sleep 1
          }
        }
        --exec rm -rf $MYSQL_TMP_DIR/mbackup
      }
       
      DROP TABLE IF EXISTS t;
      

      bb-main-monty a71a40e919587c59603272251fbcbce46e446534

      # Attempt # 4
      #
      # Starting mariabackup
      # Running 1000 x 2 CREATE OR REPLACE
      [00] 2025-04-10 17:56:45 Data files backup process is finished with error
      [00] 2025-04-10 17:56:45 Error on file ./test/t.MYD open during `test`.`t` table copy
      bug.cor31b                               [ fail ]
              Test ended at 2025-04-10 17:56:45
       
      CURRENT_TEST: bug.cor31b
      mysqltest: At line 45: "Backup ended with an error, see /bb-main-monty-debug/mysql-test/var/tmp/mbackup.log"
      

      mbackup.log

      ...
      [00] 2025-04-10 17:56:45 Stop scanning common engine tables
      [00] 2025-04-10 17:56:45 Start copying aria log file tail: /share8t/bld/preview-12.0-bb-main-monty-debug/mysql-test/var/mysqld.1/data//aria_log.00000001
      [00] 2025-04-10 17:56:45 Stop copying aria log file tail: /share8t/bld/preview-12.0-bb-main-monty-debug/mysql-test/var/mysqld.1/data//aria_log.00000001, copied 0 bytes
      [00] 2025-04-10 17:56:45 Copied file ./mtr/global_suppressions.MYI for table `mtr`.`global_suppressions`, 1024 bytes
      [00] 2025-04-10 17:56:45 Copied file ./mtr/global_suppressions.MYD for table `mtr`.`global_suppressions`, 5304 bytes
      [00] 2025-04-10 17:56:45 Copied file ./mtr/test_suppressions.MYI for table `mtr`.`test_suppressions`, 1024 bytes
      [00] 2025-04-10 17:56:45 Copied file ./mtr/test_suppressions.MYD for table `mtr`.`test_suppressions`, 0 bytes
      [00] 2025-04-10 17:56:45 Error on file ./test/t.MYD open during `test`.`t` table copy
      [00] 2025-04-10 17:56:45 aria table file ./mysql/gtid_slave_pos.MAI is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/gtid_slave_pos.MAD is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_keyword.MAI is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_keyword.MAD is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_relation.MAI is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_relation.MAD is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_category.MAI is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_category.MAD is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_topic.MAI is copied successfully.
      [00] 2025-04-10 17:56:45 aria table file ./mysql/help_topic.MAD is copied successfully.
      [00] 2025-04-10 17:56:45 Data files backup process is finished with error
      mariabackup: Stopping log copying thread.
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.