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

Aria: Failed to open partially repaired table, Got error '176 "Read page with wrong checksum"', Wrong CRC on datapage at 1

    XMLWordPrintable

Details

    • Can result in data loss

    Description

      # mysqld options required for replay:  --plugin_load_add=file_key_management --file-key-management-filekey=FILE:/some_dir/key.pass --file-key-management-filename=/some_dir/key.enc --aria-encrypt-tables=ON
      SET sql_mode='', max_session_mem_used=8192;
      CREATE TEMPORARY TABLE t (y INT) ENGINE=Aria;
      CREATE TABLE t (c INT) ENGINE=Aria;
      DROP TABLE t;
      HANDLER t OPEN AS t;
      INSERT t VALUES (1);
      REPAIR TABLE t USE_FRM;
      SELECT * FROM t;
      INSERT t VALUES (1);
      INSERT INTO t VALUES ();
      SELECT * FROM t JOIN t AS t2;
      

      Leads to:

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      12.2.0-dbg>REPAIR TABLE t USE_FRM;
      +-------+--------+----------+-----------------------------------------+
      | Table | Op     | Msg_type | Msg_text                                |
      +-------+--------+----------+-----------------------------------------+
      | t     | repair | error    | Failed to open partially repaired table |
      +-------+--------+----------+-----------------------------------------+
      1 row in set, 1 warning (0.006 sec)
       
      12.2.0-dbg>SELECT * FROM t;
      ERROR 1290 (HY000): The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
      12.2.0-dbg>INSERT t VALUES (1);
      ERROR 176 (HY000): Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      12.2.0-dbg>INSERT INTO t VALUES ();
      Query OK, 1 row affected (0.001 sec)
       
      12.2.0-dbg>SELECT * FROM t JOIN t AS t2;
      ERROR 1030 (HY000): Got error 176 "Read page with wrong checksum" from storage engine Aria
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  101125  759e3523e3d832b174cf0a612704da38b2557b40  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  10.6   opt  101125  759e3523e3d832b174cf0a612704da38b2557b40  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  10.11  dbg  101125  536cd151f0370216d9ba4c15f40c7037060972a5  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  10.11  opt  101125  536cd151f0370216d9ba4c15f40c7037060972a5  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  11.4   dbg  101125  a1bb5c94fda453baa99e57e3927eaa7cd3c8bafe  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  11.4   opt  101125  a1bb5c94fda453baa99e57e3927eaa7cd3c8bafe  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  11.8   dbg  101125  e0428264d0095472c015eb58c46be68ca1a320ee  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  11.8   opt  101125  e0428264d0095472c015eb58c46be68ca1a320ee  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  12.1   dbg  101125  ba00960fdaee67a4efff6866e31f446bf486a1c2  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  12.1   opt  101125  ba00960fdaee67a4efff6866e31f446bf486a1c2  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  12.2   dbg  101125  fd15fd2765b53d0c070dd01d86fb231024b8f284  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  12.2   opt  101125  fd15fd2765b53d0c070dd01d86fb231024b8f284  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  12.3   dbg  091225  e85bc659188be021897e8578aec42becfbb58c27  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      CS  12.3   opt  091225  e85bc659188be021897e8578aec42becfbb58c27  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      ES  10.6   dbg  101125  f0d4d34fb0314b03fddb71fb9dbde372744a8c13  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      ES  10.6   opt  101125  f0d4d34fb0314b03fddb71fb9dbde372744a8c13  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      ES  11.4   dbg  101125  b81ec4b57a5ddce88b8e2b2d16b64625ffdaa0e6  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      ES  11.4   opt  101125  b81ec4b57a5ddce88b8e2b2d16b64625ffdaa0e6  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      ES  11.8   dbg  101125  db36e8fb3bcdae26dd0acdcb2b52f7f4eb014df6  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'
      ES  11.8   opt  101125  db36e8fb3bcdae26dd0acdcb2b52f7f4eb014df6  GOT_ERROR|Got error '176 "Read page with wrong checksum"' for './test/t.MAI'                
      

      Alternatively, with this testcase:

      # mysqld options required for replay:  --plugin_load_add=file_key_management --file-key-management-filekey=FILE:/some_dir/key.pass --file-key-management-filename=/some_dir/key.enc --aria-encrypt-tables=ON
      CREATE TABLE t (y INT) ENGINE=Aria;
      HANDLER t OPEN AS t;
      INSERT t VALUES (1);
      REPAIR TABLE t USE_FRM;
      

      We see:

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      12.2.0-dbg>REPAIR TABLE t USE_FRM;
      +--------+--------+----------+----------------------------+
      | Table  | Op     | Msg_type | Msg_text                   |
      +--------+--------+----------+----------------------------+
      | test.t | repair | info     | Wrong CRC on datapage at 1 |
      | test.t | repair | status   | OK                         |
      +--------+--------+----------+----------------------------+
      2 rows in set (0.011 sec)
      

      Not a recent regression; a quick test on a revision around 10.11.11 show the same issues. No UBSAN/ASAN issues detected.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.