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

REPAIR does not fix encrypted partitioned Aria table after upgrade from 10.4

Details

    Description

      To reproduce:

      • start 10.4 server with

        --aria-encrypt-tables=1  --file-key-management --file-key-management-filename=`pwd`/mysql-test/std_data/keys.txt --plugin-load-add=file_key_management
        

        (note the implied path to the key file and change if necessary)

      • run

        create table t (pk int primary key, f date) engine=Aria partition by hash(pk) partitions 2;
        insert into t values (1,'2000-01-01');
        

      • shut down the server normally
      • store the datadir
      • start 11.5 or higher version on the datadir
      • run mariadb-upgrade. It says

        11.5 8b8c8fcb864f4f9753211ad911337201cfe21d23

        test
        test.t
        error    : Partition p0 returned error
        error    : Table rebuild required. Please do "ALTER TABLE `t` FORCE" or dump/reload to fix it!
        

      • see that the table is still corrupted:

        MariaDB [test]> check table t extended;
        +--------+-------+----------+-------------------------------------------------------------------------------------+
        | Table  | Op    | Msg_type | Msg_text                                                                            |
        +--------+-------+----------+-------------------------------------------------------------------------------------+
        | test.t | check | error    | Partition p0 returned error                                                         |
        | test.t | check | error    | Table rebuild required. Please do "ALTER TABLE `t` FORCE" or dump/reload to fix it! |
        +--------+-------+----------+-------------------------------------------------------------------------------------+
        2 rows in set (0.001 sec)
         
        MariaDB [test]> repair table t;
        +--------+--------+----------+----------+ of stage done
        | Table  | Op     | Msg_type | Msg_text |
        +--------+--------+----------+----------+
        | test.t | repair | status   | OK       |
        +--------+--------+----------+----------+
        1 row in set (0.109 sec)
         
        MariaDB [test]> repair table t extended;
        +--------+--------+----------+----------+              
        | Table  | Op     | Msg_type | Msg_text |
        +--------+--------+----------+----------+
        | test.t | repair | status   | OK       |
        +--------+--------+----------+----------+
        1 row in set (0.108 sec)
         
        MariaDB [test]> repair table t force;
        +--------+--------+----------+----------+ of stage done
        | Table  | Op     | Msg_type | Msg_text |
        +--------+--------+----------+----------+
        | test.t | repair | status   | OK       |
        +--------+--------+----------+----------+
        1 row in set (0.107 sec)
         
        MariaDB [test]> check table t extended;
        +--------+-------+----------+-------------------------------------------------------------------------------------+
        | Table  | Op    | Msg_type | Msg_text                                                                            |
        +--------+-------+----------+-------------------------------------------------------------------------------------+
        | test.t | check | error    | Partition p0 returned error                                                         |
        | test.t | check | error    | Table rebuild required. Please do "ALTER TABLE `t` FORCE" or dump/reload to fix it! |
        +--------+-------+----------+-------------------------------------------------------------------------------------+
        2 rows in set (0.003 sec)
        

      Before 11.5, mariadb-upgrade also complains about the table, but it fixes it (or, alternatively without prior mariadb-upgrade, REPAIR fixes it). The difference must have come from MDEV-33449.

      A pre-created 10.4 datadir is attached.

      Attachments

        1. data.tar.gz
          662 kB
          Elena Stepanova

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              serg Sergei Golubchik
              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.