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

InnoDB: Failing assertion: id != 0 or Assertion `dict_table_is_file_per_table(this)' failed in dict_table_t::rename_tablespace

    XMLWordPrintable

Details

    Description

      Forked from MDEV-25619

      If the test case from MDEV-25619 is run with innodb_file_per_table=0 on 10.6, it causes an assertion failure. Possibly it is a garbage-in, garbage-out situation, because the behavior was already wrong before as described in MDEV-25619, but the codeand one of the assertions are very new in 10.6, so it is worth checking.

      --source include/have_innodb.inc
       
      SET @file_per_table= @@innodb_file_per_table;
      SET GLOBAL innodb_file_per_table= 0;
       
      CREATE TABLE t1 (f1 INT, f2 INT, KEY(f1), KEY(f2)) ENGINE=InnoDB;
       
      CREATE TABLE t2 (a INT, b INT, KEY(b)) ENGINE = InnoDB;
      ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY (a) REFERENCES t1(f1) ON DELETE SET NULL;
       
      SET foreign_key_checks= OFF;
      ALTER TABLE t2 MODIFY a CHAR(1) NOT NULL;
      SET foreign_key_checks= ON;
       
      ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY (b) REFERENCES t1 (f2);
       
      # Cleanup
      DROP TABLE t2, t1;
      SET GLOBAL innodb_file_per_table= @file_per_table;
      

      10.6 2ceadb39 non-debug

      2021-05-08 00:58:10 0x7fb8cd68d700  InnoDB: Assertion failure in file /data/src/10.6/storage/innobase/fil/fil0fil.cc line 1922
      InnoDB: Failing assertion: id != 0
       
      #6  0x000055a11b4835d9 in ut_dbg_assertion_failed (expr=expr@entry=0x55a11c07befa "id != 0", file=file@entry=0x55a11c07b508 "/data/src/10.6/storage/innobase/fil/fil0fil.cc", line=line@entry=1922) at /data/src/10.6/storage/innobase/ut/ut0dbg.cc:60
      #7  0x000055a11b495885 in fil_rename_tablespace (new_path_in=0x7fb8981048c8 "./test/#sql-alter-2092ee-4.ibd", old_path=0x55a11e390e68 "./ibdata1", id=0) at /data/src/10.6/storage/innobase/fil/fil0fil.cc:1922
      #8  fil_space_t::rename (this=<optimized out>, path=path@entry=0x7fb8981048c8 "./test/#sql-alter-2092ee-4.ibd", log=log@entry=true, replace=replace@entry=true) at /data/src/10.6/storage/innobase/fil/fil0fil.cc:1904
      #9  0x000055a11bc498cb in dict_table_t::rename_tablespace (this=this@entry=0x7fb898195f40, new_name=new_name@entry=0x7fb89810fac5 "test/#sql-alter-2092ee-4", replace=replace@entry=true) at /data/src/10.6/storage/innobase/dict/dict0dict.cc:1555
      #10 0x000055a11bcbec1f in row_undo_ins_parse_undo_rec (node=0x7fb898101670, dict_locked=<optimized out>) at /data/src/10.6/storage/innobase/row/row0uins.cc:432
      #11 0x000055a11bcbf75b in row_undo_ins (node=node@entry=0x7fb898101670, thr=thr@entry=0x7fb898206fc8) at /data/src/10.6/storage/innobase/row/row0uins.cc:575
      #12 0x000055a11bbb27eb in row_undo (thr=0x7fb898206fc8, node=0x7fb898101670) at /data/src/10.6/storage/innobase/row/row0undo.cc:440
      #13 row_undo_step (thr=thr@entry=0x7fb898206fc8) at /data/src/10.6/storage/innobase/row/row0undo.cc:496
      #14 0x000055a11bb67538 in que_thr_step (thr=0x7fb898206fc8) at /data/src/10.6/storage/innobase/que/que0que.cc:651
      #15 que_run_threads_low (thr=<optimized out>) at /data/src/10.6/storage/innobase/que/que0que.cc:709
      #16 que_run_threads (thr=0x7fb898206fc8) at /data/src/10.6/storage/innobase/que/que0que.cc:729
      #17 0x000055a11bbd6a20 in trx_t::rollback_low (this=this@entry=0x7fb8ce927120, savept=savept@entry=0x0) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:117
      #18 0x000055a11bbd5608 in trx_t::rollback (savept=0x0, this=0x7fb8ce927120) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:164
      #19 trx_t::rollback (this=this@entry=0x7fb8ce927120, savept=savept@entry=0x0) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:151
      #20 0x000055a11bb95022 in row_rename_table_for_mysql (old_name=old_name@entry=0x7fb8cd6887e0 "test/#sql-alter-2092ee-4", new_name=<optimized out>, new_name@entry=0x7fb8cd6885e0 "test/t2", trx=trx@entry=0x7fb8ce927120, commit=commit@entry=true, use_fk=use_fk@entry=true) at /data/src/10.6/storage/innobase/row/row0mysql.cc:4347
      #21 0x000055a11badeb27 in innobase_rename_table (commit=true, to=0x7fb8cd689200 "./test/t2", from=0x7fb8cd688ff0 "./test/#sql-alter-2092ee-4", trx=0x7fb8ce927120) at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:13264
      #22 ha_innobase::rename_table (this=<optimized out>, from=0x7fb8cd688ff0 "./test/#sql-alter-2092ee-4", to=0x7fb8cd689200 "./test/t2") at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:13451
      #23 0x000055a11b64bcde in mysql_rename_table (base=base@entry=0x55a11e29e048, old_db=old_db@entry=0x7fb8cd68aa20, old_name=old_name@entry=0x7fb8cd68aa50, new_db=new_db@entry=0x7fb8cd68aa20, new_name=new_name@entry=0x7fb8cd68aa40, flags=flags@entry=1) at /data/src/10.6/sql/sql_table.cc:5879
      #24 0x000055a11b65a277 in mysql_alter_table (thd=thd@entry=0x7fb898000c58, new_db=new_db@entry=0x7fb8980056c0, new_name=new_name@entry=0x7fb898005ae8, create_info=create_info@entry=0x7fb8cd68b610, table_list=<optimized out>, table_list@entry=0x7fb898010a98, alter_info=alter_info@entry=0x7fb8cd68b520, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.6/sql/sql_table.cc:11133
      #25 0x000055a11b6b8a01 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7fb898000c58) at /data/src/10.6/sql/structs.h:564
      #26 0x000055a11b5b246e in mysql_execute_command (thd=0x7fb898000c58) at /data/src/10.6/sql/sql_parse.cc:5986
      #27 0x000055a11b5a2865 in mysql_parse (thd=0x7fb898000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /data/src/10.6/sql/sql_parse.cc:8018
      #28 0x000055a11b5ae925 in dispatch_command (command=COM_QUERY, thd=0x7fb898000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /data/src/10.6/sql/sql_class.h:1333
      #29 0x000055a11b5b08a8 in do_command (thd=0x7fb898000c58, blocking=blocking@entry=true) at /data/src/10.6/sql/sql_parse.cc:1406
      #30 0x000055a11b6b3ed7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1410
      #31 0x000055a11b6b423d in handle_one_connection (arg=arg@entry=0x55a11e769308) at /data/src/10.6/sql/sql_connect.cc:1312
      #32 0x000055a11ba3624d in pfs_spawn_thread (arg=0x55a11e6f96d8) at /data/src/10.6/storage/perfschema/pfs.cc:2201
      #33 0x00007fb8d8975609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x00007fb8d8564293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.6 2ceadb39 debug

      mariadbd: /data/src/10.6/storage/innobase/dict/dict0dict.cc:1515: dberr_t dict_table_t::rename_tablespace(const char*, bool) const: Assertion `dict_table_is_file_per_table(this)' failed.
      210508  0:58:54 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f2ff44d7f36 in __GI___assert_fail (assertion=0x55aa71962198 "dict_table_is_file_per_table(this)", file=0x55aa719617a0 "/data/src/10.6/storage/innobase/dict/dict0dict.cc", line=1515, function=0x55aa719621c0 "dberr_t dict_table_t::rename_tablespace(const char*, bool) const") at assert.c:101
      #8  0x000055aa712cbba9 in dict_table_t::rename_tablespace (this=0x7f2fc01f4428, new_name=0x7f2fc000ae5d "test/#sql-alter-209356-4", replace=true) at /data/src/10.6/storage/innobase/dict/dict0dict.cc:1515
      #9  0x000055aa7138f38b in row_undo_ins_parse_undo_rec (node=0x7f2fc0b29098, dict_locked=true) at /data/src/10.6/storage/innobase/row/row0uins.cc:432
      #10 0x000055aa7138f8ab in row_undo_ins (node=0x7f2fc0b29098, thr=0x7f2fc01f7d68) at /data/src/10.6/storage/innobase/row/row0uins.cc:575
      #11 0x000055aa711a0548 in row_undo (node=0x7f2fc0b29098, thr=0x7f2fc01f7d68) at /data/src/10.6/storage/innobase/row/row0undo.cc:440
      #12 0x000055aa711a07ae in row_undo_step (thr=0x7f2fc01f7d68) at /data/src/10.6/storage/innobase/row/row0undo.cc:496
      #13 0x000055aa710e4ca6 in que_thr_step (thr=0x7f2fc01f7d68) at /data/src/10.6/storage/innobase/que/que0que.cc:651
      #14 0x000055aa710e4f37 in que_run_threads_low (thr=0x7f2fc01f7d68) at /data/src/10.6/storage/innobase/que/que0que.cc:709
      #15 0x000055aa710e504f in que_run_threads (thr=0x7f2fc01f7d68) at /data/src/10.6/storage/innobase/que/que0que.cc:729
      #16 0x000055aa711f3218 in trx_t::rollback_low (this=0x7f2fea999290, savept=0x0) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:117
      #17 0x000055aa711efbb2 in trx_t::rollback (this=0x7f2fea999290, savept=0x0) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:164
      #18 0x000055aa71157eca in row_rename_table_for_mysql (old_name=0x7f2fe96f9f00 "test/#sql-alter-209356-4", new_name=0x7f2fe96f9d00 "test/t2", trx=0x7f2fea999290, commit=true, use_fk=true) at /data/src/10.6/storage/innobase/row/row0mysql.cc:4347
      #19 0x000055aa70fbd180 in innobase_rename_table (trx=0x7f2fea999290, from=0x7f2fe96faeb0 "./test/#sql-alter-209356-4", to=0x7f2fe96fb0c0 "./test/t2", commit=true) at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:13264
      #20 0x000055aa70fa389f in ha_innobase::rename_table (this=0x7f2fc0017c68, from=0x7f2fe96faeb0 "./test/#sql-alter-209356-4", to=0x7f2fe96fb0c0 "./test/t2") at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:13451
      #21 0x000055aa70b20c35 in handler::ha_rename_table (this=0x7f2fc0017c68, from=0x7f2fe96faeb0 "./test/#sql-alter-209356-4", to=0x7f2fe96fb0c0 "./test/t2") at /data/src/10.6/sql/handler.cc:4980
      #22 0x000055aa7089b04a in mysql_rename_table (base=0x55aa72d72eb8, old_db=0x7f2fe96fc870, old_name=0x7f2fe96fc8a0, new_db=0x7f2fe96fc870, new_name=0x7f2fe96fc890, flags=1) at /data/src/10.6/sql/sql_table.cc:5886
      #23 0x000055aa708aa5a5 in mysql_alter_table (thd=0x7f2fc0000db8, new_db=0x7f2fc00059e0, new_name=0x7f2fc0005e08, create_info=0x7f2fe96fd460, table_list=0x7f2fc0015718, alter_info=0x7f2fe96fd370, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.6/sql/sql_table.cc:11133
      #24 0x000055aa70951fbe in Sql_cmd_alter_table::execute (this=0x7f2fc0016030, thd=0x7f2fc0000db8) at /data/src/10.6/sql/sql_alter.cc:540
      #25 0x000055aa707a611c in mysql_execute_command (thd=0x7f2fc0000db8) at /data/src/10.6/sql/sql_parse.cc:5986
      #26 0x000055aa707ac2bf in mysql_parse (thd=0x7f2fc0000db8, rawbuf=0x7f2fc00155f0 "ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY (b) REFERENCES t1 (f2)", length=64, parser_state=0x7f2fe96fe490) at /data/src/10.6/sql/sql_parse.cc:8018
      #27 0x000055aa707987a2 in dispatch_command (command=COM_QUERY, thd=0x7f2fc0000db8, packet=0x7f2fc000b8a9 "", packet_length=64, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1897
      #28 0x000055aa70797147 in do_command (thd=0x7f2fc0000db8, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1406
      #29 0x000055aa70947474 in do_handle_one_connection (connect=0x55aa73258298, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1410
      #30 0x000055aa709471d0 in handle_one_connection (arg=0x55aa7326e838) at /data/src/10.6/sql/sql_connect.cc:1312
      #31 0x000055aa70eae56b in pfs_spawn_thread (arg=0x55aa732b1fc8) at /data/src/10.6/storage/perfschema/pfs.cc:2201
      #32 0x00007f2ff49ef609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #33 0x00007f2ff45c3293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The assertion failures started happening after this commit in 10.6:

      commit 54e2e70194b9374543fdfc81a47d583e34771fac
      Author: Marko Mäkelä
      Date:   Thu Apr 29 15:25:57 2021 +0300
       
          MDEV-25524 heap-use-after-free in fil_space_t::rename()
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.