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

Instant ADD/DROP multiple failure assertions

    Details

      Description

      Reproduce 1

      --source include/have_innodb.inc
      --source include/have_debug.inc
       
      set debug_dbug='+d,ib_commit_inplace_fail_1';
      create or replace table t1 (a int, b int) engine=innodb;
      --error ER_INTERNAL_ERROR
      alter table t1 drop column b, algorithm=instant;
      --error ER_INTERNAL_ERROR
      alter table t1 drop column b, algorithm=instant;
       
      drop table t1;
      

      Result 1

      #3  0x00007ffff6f32142 in __GI___assert_fail (assertion=0x16cca27 "index->id == btr_page_get_index_id(page)", file=0x16cc060 "/home/midenok/src/mariadb/10.4/src/storage/innobase/btr/btr0cur.cc", line=2608, function=0x16ccdd5 "dberr_t btr_cur_open_at_index_side_func(bool, dict_index_t *, ulint, btr_cur_t *, ulint, const char *, unsigned int, mtr_t *)") at assert.c:101
      #4  0x00000000010735b2 in btr_cur_open_at_index_side_func (from_left=true, index=0x7fff88020a88, latch_mode=1, cursor=0x7ffff4033a68, level=0, file=0x166b2a0 "/home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc", line=156, mtr=0x7ffff4033c88) at /home/midenok/src/mariadb/10.4/src/storage/innobase/btr/btr0cur.cc:2608
      #5  0x0000000000df29e7 in instant_metadata_lock (index=..., mtr=...) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:155
      #6  0x0000000000e05602 in dict_table_t::prepare_instant (this=0x7fff880498c8, old=..., col_map=0x7fff88026978, first_alter_pos=@0x7fff88016260: 0) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:190
      #7  0x0000000000e04fbc in ha_innobase_inplace_ctx::prepare_instant (this=0x7fff880160f0) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:971
      #8  0x0000000000de1630 in prepare_inplace_alter_table_dict (ha_alter_info=0x7ffff4036848, altered_table=0x7fff880253c8, old_table=0x7fff8801d7c8, table_name=0x7fff8804b2d5 "t1", flags=33, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:6388
      #9  0x0000000000ddb20f in ha_innobase::prepare_inplace_alter_table (this=0x7fff880411b0, altered_table=0x7fff880253c8, ha_alter_info=0x7ffff4036848) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:7935
      #10 0x0000000000b2d41e in handler::ha_prepare_inplace_alter_table (this=0x7fff880411b0, altered_table=0x7fff880253c8, ha_alter_info=0x7ffff4036848) at /home/midenok/src/mariadb/10.4/src/sql/handler.cc:4437
      #11 0x00000000008c9945 in mysql_inplace_alter_table (thd=0x7fff88000cf8, table_list=0x7fff88014ef8, table=0x7fff8801d7c8, altered_table=0x7fff880253c8, ha_alter_info=0x7ffff4036848, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7ffff4036ee8, alter_ctx=0x7ffff4037098) at /home/midenok/src/mariadb/10.4/src/sql/sql_table.cc:7515
      #12 0x00000000008c2ef7 in mysql_alter_table (thd=0x7fff88000cf8, new_db=0x7fff880053b0, new_name=0x7fff88005780, create_info=0x7ffff4038370, table_list=0x7fff88014ef8, alter_info=0x7ffff40382b8, order_num=0, order=0x0, ignore=false) at /home/midenok/src/mariadb/10.4/src/sql/sql_table.cc:9689
      #13 0x000000000096a00f in Sql_cmd_alter_table::execute (this=0x7fff88015568, thd=0x7fff88000cf8) at /home/midenok/src/mariadb/10.4/src/sql/sql_alter.cc:491
      #14 0x00000000007cd824 in mysql_execute_command (thd=0x7fff88000cf8) at /home/midenok/src/mariadb/10.4/src/sql/sql_parse.cc:6290
      #15 0x00000000007bf3e0 in mysql_parse (thd=0x7fff88000cf8, rawbuf=0x7fff88014df0 "alter table t1 drop column b, algorithm=instant", length=47, parser_state=0x7ffff403b640, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/10.4/src/sql/sql_parse.cc:8092
      

      (gdb) p index->id
      $1 = 25
      (gdb) p btr_page_get_index_id(page)
      $2 = 0
      (gdb) p index->name
      $3 = {
        m_name = 0x7fff88022a88 "GEN_CLUST_INDEX"
      }
      (gdb) x/32bx page
      0x7fffdc4d8000: 0xed    0xb8    0x06    0x58    0x00    0x00    0x00    0x03
      0x7fffdc4d8008: 0xff    0xff    0xff    0xff    0xff    0xff    0xff    0xff
      0x7fffdc4d8010: 0x00    0x00    0x00    0x00    0x00    0x02    0x31    0xe1
      0x7fffdc4d8018: 0x45    0xbf    0x00    0x00    0x00    0x00    0x00    0x00
      

      Reproduce 2

      set debug_dbug='+d,ib_commit_inplace_fail_1';
      create or replace table t1 (a int, b int);
      alter table t1 add column c int, algorithm=instant;
      

      Result 2

      #3  0x00007ffff6f32142 in __GI___assert_fail (assertion=0x1672be8 "index->n_core_fields <= old_n_fields", file=0x166b2a0 "/home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc", line=683, function=0x1672b0f "void dict_table_t::rollback_instant(unsigned int, dict_col_t *, const char *, dict_instant_t *, dict_field_t *, unsigned int, unsigned int, dict_v_col_t *, const char *, const ulint *)") at assert.c:101
      #4  0x0000000000e10123 in dict_table_t::rollback_instant (this=0x7fff8001e6c8, old_n_cols=5, old_cols=0x7fff8001fe48, old_col_names=0x7fff8001ff40 "a", old_instant=0x0, old_fields=0x7fff80022a98, old_n_fields=5, old_n_v_cols=0, old_v_cols=0x7fff8001fee8, old_v_col_names=0x0, col_map=0x7fff80032c28) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:683
      #5  0x0000000000e006b8 in ha_innobase_inplace_ctx::rollback_instant (this=0x7fff80016590) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:988
      #6  0x0000000000de7691 in ha_innobase::commit_inplace_alter_table (this=0x7fff80025850, altered_table=0x7fff80029f88, ha_alter_info=0x7ffff4036848, commit=true) at /home/midenok/src/mariadb/10.4/src/storage/innobase/handler/handler0alter.cc:10676
      #7  0x0000000000b2d56a in handler::ha_commit_inplace_alter_table (this=0x7fff80025850, altered_table=0x7fff80029f88, ha_alter_info=0x7ffff4036848, commit=true) at /home/midenok/src/mariadb/10.4/src/sql/handler.cc:4457
      #8  0x00000000008c9e5b in mysql_inplace_alter_table (thd=0x7fff80000cf8, table_list=0x7fff80014f08, table=0x7fff80024c88, altered_table=0x7fff80029f88, ha_alter_info=0x7ffff4036848, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7ffff4036ee8, alter_ctx=0x7ffff4037098) at /home/midenok/src/mariadb/10.4/src/sql/sql_table.cc:7598
      #9  0x00000000008c2ef7 in mysql_alter_table (thd=0x7fff80000cf8, new_db=0x7fff800053b0, new_name=0x7fff80005780, create_info=0x7ffff4038370, table_list=0x7fff80014f08, alter_info=0x7ffff40382b8, order_num=0, order=0x0, ignore=false) at /home/midenok/src/mariadb/10.4/src/sql/sql_table.cc:9689
      #10 0x000000000096a00f in Sql_cmd_alter_table::execute (this=0x7fff80015668, thd=0x7fff80000cf8) at /home/midenok/src/mariadb/10.4/src/sql/sql_alter.cc:491
      #11 0x00000000007cd824 in mysql_execute_command (thd=0x7fff80000cf8) at /home/midenok/src/mariadb/10.4/src/sql/sql_parse.cc:6290
      #12 0x00000000007bf3e0 in mysql_parse (thd=0x7fff80000cf8, rawbuf=0x7fff80014df0 "alter table t1 add column c int, algorithm=instant", length=50, parser_state=0x7ffff403b640, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/10.4/src/sql/sql_parse.cc:8092
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                midenok Aleksey Midenkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: