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

Assertion `instant.n_core_fields == n_core_fields' failed in dict_index_t::instant_add_field

    XMLWordPrintable

    Details

      Description

      Note: The test case has an obvious race condition, run with --repeat=N. It currently fails nearly every time for me, both in memory and on disk, but it can vary on different machines and builds.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a BINARY, UNIQUE(a)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (NULL);
      ALTER TABLE t1 ADD COLUMN b INT;
       
      --connect (con1,localhost,root,,test)
      --send
        ALTER TABLE t1 DROP a;
       
      --connection default
      DELETE FROM t1;
       
      --connection con1
      --reap
       
      # Cleanup
      --disconnect con1
      --connection default
      DROP TABLE t1;
      

      10.5 17a7bafe

      mariadbd: /data/src/10.5/storage/innobase/handler/handler0alter.cc:422: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields' failed.
      200610 21:59:38 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc6095eaf12 in __GI___assert_fail (assertion=0x55f9bb456db8 "instant.n_core_fields == n_core_fields", file=0x55f9bb456618 "/data/src/10.5/storage/innobase/handler/handler0alter.cc", line=422, function=0x55f9bb45f700 <dict_index_t::instant_add_field(dict_index_t const&)::__PRETTY_FUNCTION__> "void dict_index_t::instant_add_field(const dict_index_t&)") at assert.c:101
      #8  0x000055f9babac041 in dict_index_t::instant_add_field (this=0x7fc5d421efc8, instant=...) at /data/src/10.5/storage/innobase/handler/handler0alter.cc:422
      #9  0x000055f9babae111 in dict_table_t::instant_column (this=0x7fc5d40faf58, table=..., col_map=0x7fc5c80230f8) at /data/src/10.5/storage/innobase/handler/handler0alter.cc:604
      #10 0x000055f9babb0509 in ha_innobase_inplace_ctx::instant_column (this=0x7fc5c8013950) at /data/src/10.5/storage/innobase/handler/handler0alter.cc:1050
      #11 0x000055f9bab8f737 in innobase_instant_try (ha_alter_info=0x7fc5feb17e80, ctx=0x7fc5c8013950, altered_table=0x7fc5feb17f20, table=0x7fc5c801a8f8, trx=0x7fc5ffc02558) at /data/src/10.5/storage/innobase/handler/handler0alter.cc:5629
      #12 0x000055f9babb3d9a in commit_try_norebuild (ha_alter_info=0x7fc5feb17e80, ctx=0x7fc5c8013950, altered_table=0x7fc5feb17f20, old_table=0x7fc5c801a8f8, trx=0x7fc5ffc02558, table_name=0x7fc5d40fc245 "t1") at /data/src/10.5/storage/innobase/handler/handler0alter.cc:10179
      #13 0x000055f9baba27c3 in ha_innobase::commit_inplace_alter_table (this=0x7fc5c801bbe0, altered_table=0x7fc5feb17f20, ha_alter_info=0x7fc5feb17e80, commit=true) at /data/src/10.5/storage/innobase/handler/handler0alter.cc:10901
      #14 0x000055f9ba6fa051 in handler::ha_commit_inplace_alter_table (this=0x7fc5c801bbe0, altered_table=0x7fc5feb17f20, ha_alter_info=0x7fc5feb17e80, commit=true) at /data/src/10.5/sql/handler.cc:4745
      #15 0x000055f9ba492313 in mysql_inplace_alter_table (thd=0x7fc5c8000b18, table_list=0x7fc5c80125c8, table=0x7fc5c801a8f8, altered_table=0x7fc5feb17f20, ha_alter_info=0x7fc5feb17e80, inplace_supported=HA_ALTER_INPLACE_NOCOPY_NO_LOCK, target_mdl_request=0x7fc5feb18ce0, alter_ctx=0x7fc5feb19830) at /data/src/10.5/sql/sql_table.cc:7947
      #16 0x000055f9ba499b0c in mysql_alter_table (thd=0x7fc5c8000b18, new_db=0x7fc5c80053d8, new_name=0x7fc5c80057e0, create_info=0x7fc5feb1a430, table_list=0x7fc5c80125c8, alter_info=0x7fc5feb1a360, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.5/sql/sql_table.cc:10468
      #17 0x000055f9ba53effa in Sql_cmd_alter_table::execute (this=0x7fc5c8012cc8, thd=0x7fc5c8000b18) at /data/src/10.5/sql/sql_alter.cc:538
      #18 0x000055f9ba39eef3 in mysql_execute_command (thd=0x7fc5c8000b18) at /data/src/10.5/sql/sql_parse.cc:5950
      #19 0x000055f9ba3a5227 in mysql_parse (thd=0x7fc5c8000b18, rawbuf=0x7fc5c80124f0 "ALTER TABLE t1 DROP a", length=21, parser_state=0x7fc5feb1b520, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7992
      #20 0x000055f9ba3915ad in dispatch_command (command=COM_QUERY, thd=0x7fc5c8000b18, packet=0x7fc5c8008939 "ALTER TABLE t1 DROP a", packet_length=21, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1875
      #21 0x000055f9ba38fce5 in do_command (thd=0x7fc5c8000b18) at /data/src/10.5/sql/sql_parse.cc:1356
      #22 0x000055f9ba5346cf in do_handle_one_connection (connect=0x55f9bd3abb58, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1411
      #23 0x000055f9ba534437 in handle_one_connection (arg=0x55f9bd3abb58) at /data/src/10.5/sql/sql_connect.cc:1313
      #24 0x000055f9baa6d60e in pfs_spawn_thread (arg=0x55f9bd7121f8) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #25 0x00007fc60b5734a4 in start_thread (arg=0x7fc5feb1c700) at pthread_create.c:456
      #26 0x00007fc6096a7d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      No obvious immediate problem on a non-debug build.
      Couldn't reproduce on 10.4, however the failure seems to have appeared after the merge 7bcaa541aa, which featured this commit:

      commit 474290540a829edcc6a74be8c354053f330bf5de
      Author: Marko Mäkelä
      Date:   Tue May 5 14:20:47 2020 +0300
       
          MDEV-22465: DROP indexed COLUMN is wrongly claimed to be ALGORITHM=INSTANT
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: