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

Unexpected ER_FILE_NOT_FOUND upon reading from logging table after crash recovery

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
    • 10.5.27, 10.6.20, 10.11.10, 11.2.6, 11.4.4
    • Server
    • None

    Description

      SET GLOBAL log_output="TABLE";
      CREATE TABLE t (a INT);
      --let $shutdown_timeout= 0
      --source include/restart_mysqld.inc
      DROP TABLE t;
      SELECT * FROM mysql.general_log;
      

      10.5 cc5c0eda4c1a516753de238e02a024b0f044b738

      mysqltest: At line 6: query 'SELECT * FROM mysql.general_log' failed: 1017: Can't find file: './mysql/general_log.CSV' (errno: 2 "No such file or directory")
      

      The table is of course still there and is readable after REPAIR.

      With some other combinations of queries and startup options different errors can be produced, ranging between more or less expected, such as "Got error 175 "File too short; Expected more data in file" from storage engine CSV", to confusing ones like "Cannot execute statement in a READ ONLY transaction" if the server is running under tx-read-only. I'm not sure whether they all have the same root cause (other than the expected table corruption upon a crash in the absence of automatic recovery), or they would need to be dealt with separately. So far I'll file the one above, as it is the strangest from those I've seen so far.

      Attachments

        Activity

          The server was not correctly shutdown in the test case (if let it shotdown, i.e. increase shutdown timeout from 0 to something real, there is no error.

          Yes, because the test implements a crash recovery scenario, as said in the bug summary.

          elenst Elena Stepanova added a comment - The server was not correctly shutdown in the test case (if let it shotdown, i.e. increase shutdown timeout from 0 to something real, there is no error. Yes, because the test implements a crash recovery scenario, as said in the bug summary.

          and I desribe all sequence in one message

          sanja Oleksandr Byelkin added a comment - and I desribe all sequence in one message

          1) CSV doing wrong correct way to set my_errno
          2) it is better to reset my_errno as we sent resul to the client to avoid it be absolute junk for the next command

          sanja Oleksandr Byelkin added a comment - 1) CSV doing wrong correct way to set my_errno 2) it is better to reset my_errno as we sent resul to the client to avoid it be absolute junk for the next command
          sanja Oleksandr Byelkin added a comment - - edited

           
          commit 7d93e6bc70de8078d7d821c4a727bb353345fdcc (HEAD -> bb-10.5-MDEV-33373, origin/bb-10.5-MDEV-33373)
          Author: Sergei Golubchik <serg@mariadb.org>
          Date:   Thu Sep 19 18:57:37 2024 +0200
           
              MDEV-33373 part 2: Unexpected ER_FILE_NOT_FOUND upon reading from logging table after crash recovery
              
              CSV engine shoud set my_errno if use it.
           
          commit 02685acbca12008e8d01b6894a99d7f034275220
          Author: Oleksandr Byelkin <sanja@mariadb.com>
          Date:   Thu Sep 19 16:51:05 2024 +0200
           
              MDEV-33373 part 1: Unexpected ER_FILE_NOT_FOUND upon reading from logging table after crash recovery
              
              We have found that my_errno can be "passed" to the next commad in some cases.
              
              It is practically impossible to check/fix all cases of my_errno in the server,
              plugins and engines so we will reset it as we reset other errors.
              
              The test case will be fixed by CSV engine fix so will be added with it
              (see part2).
          
          

          sanja Oleksandr Byelkin added a comment - - edited   commit 7d93e6bc70de8078d7d821c4a727bb353345fdcc (HEAD -> bb-10.5-MDEV-33373, origin/bb-10.5-MDEV-33373) Author: Sergei Golubchik <serg@mariadb.org> Date: Thu Sep 19 18:57:37 2024 +0200   MDEV-33373 part 2: Unexpected ER_FILE_NOT_FOUND upon reading from logging table after crash recovery CSV engine shoud set my_errno if use it.   commit 02685acbca12008e8d01b6894a99d7f034275220 Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Thu Sep 19 16:51:05 2024 +0200   MDEV-33373 part 1: Unexpected ER_FILE_NOT_FOUND upon reading from logging table after crash recovery We have found that my_errno can be "passed" to the next commad in some cases. It is practically impossible to check/fix all cases of my_errno in the server, plugins and engines so we will reset it as we reset other errors. The test case will be fixed by CSV engine fix so will be added with it (see part2).

          02685acbc and 7d93e6bc7 are ok to push

          serg Sergei Golubchik added a comment - 02685acbc and 7d93e6bc7 are ok to push

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            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.