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

Assertion failure in dict_table_check_for_dup_indexes upon concurrent DML/DDL

Details

    Description

      The test case is non-deterministic, run with large enough --repeat=N. It usually fails for me in 10-20 attempts, but it can vary a lot.

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t1 (a INT, b INT, c INT, KEY(b)) ENGINE=InnoDB;
      INSERT INTO t1 (a, b) SELECT seq, seq FROM seq_0_to_9;
      ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b);
       
      CREATE TABLE t2 (f INT) ENGINE=InnoDB;
      INSERT INTO t2 SELECT seq%10 FROM seq_1_to_1000;
       
      --connect (con1,localhost,root,,test)
      ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (a);
      --send
        INSERT INTO t2 SELECT * FROM t2;
       
      --connection default
      --error 0,ER_LOCK_DEADLOCK
      ALTER TABLE t1 ADD INDEX (c);
      --error 0,ER_LOCK_DEADLOCK
      ALTER TABLE t1 ADD x INT;
       
      # Cleanup
      --connection con1
      --reap
      DROP TABLE t2, t1;
      --disconnect con1
      

      10.6 fae0ccad

      2022-04-23 19:23:03 0x7fc3c8788700  InnoDB: Assertion failure in file /data/src/10.6/storage/innobase/dict/dict0dict.cc line 4497
       
      #6  0x000055c732385105 in ut_dbg_assertion_failed (expr=0x0, file=0x55c732ac3420 "/data/src/10.6/storage/innobase/dict/dict0dict.cc", line=4497) at /data/src/10.6/storage/innobase/ut/ut0dbg.cc:60
      #7  0x000055c732442623 in dict_table_check_for_dup_indexes (table=0x7fc374b8d038, check=CHECK_ABORTED_OK) at /data/src/10.6/storage/innobase/dict/dict0dict.cc:4497
      #8  0x000055c732158b44 in ha_innobase::prepare_inplace_alter_table (this=0x7fc374b91440, altered_table=0x7fc3c87842f0, ha_alter_info=0x7fc3c8784230) at /data/src/10.6/storage/innobase/handler/handler0alter.cc:7557
      #9  0x000055c731d04524 in handler::ha_prepare_inplace_alter_table (this=0x7fc374b91440, altered_table=0x7fc3c87842f0, ha_alter_info=0x7fc3c8784230) at /data/src/10.6/sql/handler.cc:5198
      #10 0x000055c731a66169 in mysql_inplace_alter_table (thd=0x7fc374000db8, table_list=0x7fc374015698, table=0x7fc374b8f628, altered_table=0x7fc3c87842f0, ha_alter_info=0x7fc3c8784230, target_mdl_request=0x7fc3c8784b30, ddl_log_state=0x7fc3c87841d0, trigger_param=0x7fc3c87846e0, alter_ctx=0x7fc3c8785690) at /data/src/10.6/sql/sql_table.cc:7359
      #11 0x000055c731a6f0da in mysql_alter_table (thd=0x7fc374000db8, new_db=0x7fc3740059b8, new_name=0x7fc374005dd0, create_info=0x7fc3c87864a0, table_list=0x7fc374015698, alter_info=0x7fc3c87863b0, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.6/sql/sql_table.cc:10267
      #12 0x000055c731b22c9c in Sql_cmd_alter_table::execute (this=0x7fc374015e90, thd=0x7fc374000db8) at /data/src/10.6/sql/sql_alter.cc:542
      #13 0x000055c73196cd14 in mysql_execute_command (thd=0x7fc374000db8, is_called_from_prepared_stmt=false) at /data/src/10.6/sql/sql_parse.cc:6012
      #14 0x000055c731972d72 in mysql_parse (thd=0x7fc374000db8, rawbuf=0x7fc3740155c0 "ALTER TABLE t1 ADD x INT", length=24, parser_state=0x7fc3c8787500) at /data/src/10.6/sql/sql_parse.cc:8045
      #15 0x000055c73195f3c5 in dispatch_command (command=COM_QUERY, thd=0x7fc374000db8, packet=0x7fc37400b879 "ALTER TABLE t1 ADD x INT", packet_length=24, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1912
      #16 0x000055c73195dcf2 in do_command (thd=0x7fc374000db8, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1409
      #17 0x000055c731b17c66 in do_handle_one_connection (connect=0x55c734728d88, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1418
      #18 0x000055c731b17905 in handle_one_connection (arg=0x55c73461d9d8) at /data/src/10.6/sql/sql_connect.cc:1312
      #19 0x000055c73203218c in pfs_spawn_thread (arg=0x55c7346201c8) at /data/src/10.6/storage/perfschema/pfs.cc:2201
      #20 0x00007fc3cf8bcea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #21 0x00007fc3cf4b9def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Nothing happens on a non-debug build, but it doesn't mean much given the concurrency.
      Not reproducible on 10.5.

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.