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

Atomic DDL is not very atomic on partitioned tables

    XMLWordPrintable

Details

    Description

      Note: To repeat what was also said in the comments, it was already known at the time of atomic DDL development/release (MDEV-25180) that partitioned tables still have problems and aren't made atomic in the scope of the task. However, I was asked to register reproducible test cases anyway, so they could be looked at with a low priority, so that's what this report is for.

      The test case is non-deterministic, run with --repeat=N. It usually fails for me within several attempts (takes longer on non-debug builds), but it can vary on different machines and builds.

      --source include/have_partition.inc
      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t (pk INT PRIMARY KEY, a INT) ENGINE=InnoDB PARTITION BY HASH(pk);
      INSERT INTO t SELECT seq, seq FROM seq_1_to_1000;
       
      --connect (con1,localhost,root,,test)
      --let $shutdown_timeout= 0
      --send
      ALTER TABLE t ADD KEY (a), ALGORITHM=INPLACE;
       
      --connection default
      --source include/restart_mysqld.inc
       
      CHECK TABLE t;
       
      # Cleanup
      DROP TABLE t;
      

      10.6 8171f9da

      bug.t 'innodb'                           [ fail ]  Found warnings/errors in server log file!
              Test ended at 2023-06-17 22:19:56
      line
      2023-06-17 22:19:56 3 [ERROR] InnoDB indexes are inconsistent with what defined in .frm for table ./test/t#P#p0
      2023-06-17 22:19:56 3 [ERROR] InnoDB: Table test/t#P#p0 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
      2023-06-17 22:19:56 3 [ERROR] InnoDB could not find key no 1 with name a from dict cache for table test/t#P#p0
      2023-06-17 22:19:56 3 [ERROR] InnoDB: Table test/t#P#p0 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
      2023-06-17 22:19:56 3 [ERROR] InnoDB: Table test/t#P#p0 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
      2023-06-17 22:19:56 3 [ERROR] InnoDB could not find key no 1 with name a from dict cache for table test/t#P#p0
      2023-06-17 22:19:56 3 [ERROR] InnoDB: Table test/t#P#p0 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
      ^ Found warnings in /mnt8t/bld/10.6-asan/mysql-test/var/log/mysqld.1.err
      ok
      

      When it doesn't fail right away, it can also leave a temporary .par file behind

      MTR's internal check of the test case 'bug.t' failed.
      ...
      +#sql-alter-60b0a-5.par
      

      Attachments

        Issue Links

          Activity

            People

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