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

Assertion `err != DB_SUCCESS || btr_validate_index(m_index, m_trx) == DB_SUCCESS' in BtrBulk::finish during ALTER TABLE ... MODIFY COLUMN

    XMLWordPrintable

Details

    Description

      Problem found during RQG testing on
      origin/bb-11.8-bumpversion, origin/11.8 65ee9a7b4694d1b6f366b5a7a3d1b0549e5a3671 2026-02-04T17:07:18-05:00 MariaDB 11.8.7
      and also on
      origin/HEAD 637f8c4db7533fc4f22433f042cc83f7ba3bfb41 2026-02-19T17:21:43+02:00 MariaDB 13.0.0

      Scenario:
      ---------
      1. Start the DB server
      2. The first connection creates a table
      CREATE TABLE t2 ( col1 INT, col_text TEXT ) ENGINE = InnoDB ROW_FORMAT = Compressed ;
      and runs than in a loop a statement picked random from the list
      ALTER TABLE t2 MODIFY col_text VARCHAR(19)
      ALTER TABLE t2 MODIFY col_text VARCHAR(20)
      INSERT INTO t2 (col1, col_text) VALUES ( <random number between 2 and 8> , NULL ) ;
      The second connection runs in a loop a statement picked random from the list
      SET GLOBAL innodb_compression_level = 0;
      SET GLOBAL innodb_compression_level = 9 ;
      At some point of time the server crashes. The last entries of the server error log are
      2026-02-25 10:47:54 15 [ERROR] InnoDB: In page 4 of index `GEN_CLUST_INDEX` of table `test`.`#sql-alter-31febb-f`
      InnoDB: node pointer to the page is wrong
      InnoDB: node ptr PHYSICAL RECORD: n_fields 5; compact format; info bits 0
      0: len 6; hex 0000000000a2; asc ;;
      1: len 6; hex 000000000000; asc ;;
      2: len 7; hex 80000000000000; asc ;;
      3: len 4; hex 80000004; asc ;;
      4: SQL NULL;
      2026-02-25 10:47:54 15 [ERROR] InnoDB: In page 4 of index `GEN_CLUST_INDEX` of table `test`.`#sql-alter-31febb-f`
      InnoDB: node pointer to the page is wrong
      InnoDB: node ptr PHYSICAL RECORD: n_fields 5; compact format; info bits 0
      0: len 6; hex 0000000000a2; asc ;;
      1: len 6; hex 000000000000; asc ;;
      2: len 7; hex 80000000000000; asc ;;
      3: len 4; hex 80000004; asc ;;
      4: SQL NULL;
      mariadbd: storage/innobase/btr/btr0bulk.cc:1216: dberr_t BtrBulk::finish(dberr_t): Assertion `err != DB_SUCCESS || btr_validate_index(m_index, m_trx) == DB_SUCCESS' failed.

      The stack trace is
      #1 __pthread_kill_internal (signo=6, threadid=3566276519488) at ./nptl/pthread_kill.c:78
      ...
      #5 0x00007baf0235b71b in __assert_fail_base (fmt=0x7baf02510130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55ada0de4508 "err != DB_SUCCESS || btr_validate_index(m_index, m_trx) == DB_SUCCESS",
      file=0x55ada0de4638 "storage/innobase/btr/btr0bulk.cc", line=1216, function=<optimized out>) at ./assert/assert.c:92
      #6 0x00007baf0236ce96 in _GI__assert_fail (assertion=0x55ada0de4508 "err != DB_SUCCESS || btr_validate_index(m_index, m_trx) == DB_SUCCESS", file=0x55ada0de4638 "storage/innobase/btr/btr0bulk.cc",
      line=1216, function=0x55ada0de44e0 "dberr_t BtrBulk::finish(dberr_t)") at ./assert/assert.c:101
      #7 0x000055ada06d6ff0 in BtrBulk::finish (this=this@entry=0x33e56a4c320, err=err@entry=DB_SUCCESS) at storage/innobase/btr/btr0bulk.cc:1216
      #8 0x000055ada05cee31 in row_merge_bulk_t::write_to_index (this=this@entry=0x7a7164093870, index_no=index_no@entry=0, trx=trx@entry=0x55ada2d74780) at storage/innobase/row/row0merge.cc:5373
      #9 0x000055ada05ceff6 in row_merge_bulk_t::write_to_table (this=0x7a7164093870, table=0x7a71640242f8, trx=trx@entry=0x55ada2d74780) at storage/innobase/row/row0merge.cc:5396
      #10 0x000055ada05cf039 in trx_mod_table_time_t::write_bulk (this=0x7a71640efbd8, table=<optimized out>, trx=trx@entry=0x55ada2d74780) at storage/innobase/row/row0merge.cc:5418
      #11 0x000055ada05cf70d in trx_t::bulk_insert_apply_low (this=this@entry=0x55ada2d74780) at storage/innobase/row/row0merge.cc:5446
      #12 0x000055ada0421d44 in trx_t::bulk_insert_apply<(trx_bulk_insert)2> (this=0x55ada2d74780) at storage/innobase/include/trx0trx.h:1209
      #13 ha_innobase::extra (this=0x7a716410bc18, operation=<optimized out>) at storage/innobase/handler/ha_innodb.cc:15869
      #14 0x000055ad9fe3d913 in copy_data_between_tables (thd=thd@entry=0x7a7164000d58, from=from@entry=0x7a7164021f28, to=to@entry=0x7a7164040218, ignore=<optimized out>, order_num=order_num@entry=0, order=order@entry=0x0,
      copied=<optimized out>, deleted=<optimized out>, alter_info=<optimized out>, alter_ctx=<optimized out>, online=true, start_alter_id=<optimized out>) at sql/sql_table.cc:12952
      #15 0x000055ad9fe41384 in mysql_alter_table (thd=thd@entry=0x7a7164000d58, new_db=new_db@entry=0x7a71640059a8, new_name=<optimized out>, create_info=create_info@entry=0x33e56a502a0, table_list=<optimized out>,
      table_list@entry=0x7a7164015a48, recreate_info=recreate_info@entry=0x33e56a500f0, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>)
      at sql/sql_table.cc:11931
      #16 0x000055ad9feca365 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7a7164000d58) at sql/sql_alter.cc:701
      #17 0x000055ad9fd3bfa5 in mysql_execute_command (thd=thd@entry=0x7a7164000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at sql/sql_parse.cc:5917
      #18 0x000055ad9fd3cd5f in mysql_parse (thd=thd@entry=0x7a7164000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x33e56a51360) at sql/sql_parse.cc:7946
      #19 0x000055ad9fd3f354 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7a7164000d58, packet=packet@entry=0x7a716400b1d9 "ALTER TABLE t2 MODIFY col_text VARCHAR(19) /* E_R Thread1 QNO 1082 CON_ID 15 */ ",
      packet_length=packet_length@entry=80, blocking=blocking@entry=true) at sql/sql_parse.cc:1921
      #20 0x000055ad9fd41400 in do_command (thd=thd@entry=0x7a7164000d58, blocking=blocking@entry=true) at sql/sql_parse.cc:1431
      #21 0x000055ad9fec1f4b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55ada3b2e188, put_in_cache=put_in_cache@entry=true) at sql/sql_connect.cc:1504
      #22 0x000055ad9fec218b in handle_one_connection (arg=0x55ada3b2e188) at sql/sql_connect.cc:1416
      #23 0x00007baf023c7ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #24 0x00007baf02458a04 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      (rr)

      pluto:/data/results/1772016452/TBR-2344$ _RR_TRACE_DIR=./1/rr rr replay --mark-stdio

      Attachments

        1. TBR-2344.cfg
          48 kB
          Matthias Leich
        2. TBR-2344.yy
          0.7 kB
          Matthias Leich

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            mleich Matthias Leich
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.