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

Assertion `!is_user_rec || leaf || index->is_dummy || dict_index_is_ibuf(index) || n == dict_index_get_n_unique_in_tree_nonleaf(index) + 1' failed

    XMLWordPrintable

    Details

      Description

      10.2 7c85a8d936b1a

      mysqld: /data/src/10.2/storage/innobase/rem/rem0rec.cc:598: ulint* rec_get_offsets_func(const rec_t*, const dict_index_t*, ulint*, bool, ulint, const char*, unsigned int, mem_heap_t**): Assertion `!is_user_rec || leaf || index->is_dummy || dict_index_is_ibuf(index) || n == dict_index_get_n_unique_in_tree_nonleaf(index) + 1' failed.
      171110  3:25:12 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe3f2b07ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055da9940e3f8 in rec_get_offsets_func (rec=0x7fe3c0005e37 "", index=0x7fe39414e598, offsets=0x7fe3c0004e80, leaf=false, n_fields=1, file=0x55da99a7d3c8 "/data/src/10.2/storage/innobase/dict/dict0stats.cc", line=1197, heap=0x7fe3d9ffa550) at /data/src/10.2/storage/innobase/rem/rem0rec.cc:595
      #9  0x000055da995f8554 in dict_stats_analyze_index_level (index=0x7fe39414e598, level=1, n_diff=0x7fe3c0006b20, total_recs=0x7fe3d9ffa6f8, total_pages=0x7fe3d9ffa700, n_diff_boundaries=0x7fe3c0006b78, mtr=0x7fe3d9ffa780) at /data/src/10.2/storage/innobase/dict/dict0stats.cc:1197
      #10 0x000055da995f9f94 in dict_stats_analyze_index (index=0x7fe39414e598) at /data/src/10.2/storage/innobase/dict/dict0stats.cc:2155
      #11 0x000055da995fa519 in dict_stats_update_persistent (table=0x7fe394150be8) at /data/src/10.2/storage/innobase/dict/dict0stats.cc:2266
      #12 0x000055da995fcb3a in dict_stats_update (table=0x7fe394150be8, stats_upd_option=DICT_STATS_RECALC_PERSISTENT) at /data/src/10.2/storage/innobase/dict/dict0stats.cc:3227
      #13 0x000055da996005ac in dict_stats_process_entry_from_recalc_pool () at /data/src/10.2/storage/innobase/dict/dict0stats_bg.cc:382
      #14 0x000055da9960076a in dict_stats_thread () at /data/src/10.2/storage/innobase/dict/dict0stats_bg.cc:468
      #15 0x00007fe3f47de494 in start_thread (arg=0x7fe3d9ffb700) at pthread_create.c:333
      #16 0x00007fe3f2bc493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      The test case is concurrent, but it fails very well for me as long as the machine isn't being under a heavy load. Run in -mem and if it still doesn't fail right away, with -repeat=N.

      --source include/have_innodb.inc
       
      SET @innodb_stats_persistent.save= @@innodb_stats_persistent;
      SET GLOBAL innodb_stats_persistent= ON;
      SET innodb_lock_wait_timeout= 1, lock_wait_timeout= 2;
       
      CREATE TABLE t1 (
        pk INT,
        c1 VARCHAR(8),
        c2 VARCHAR(8),
        i1 INT,
        t1 TIME,
        t2 TIME,
        c3 VARCHAR(8),
        c4 VARCHAR(8),
        t3 TIME,
        v1 TIME AS (t3) VIRTUAL,
        i2 INT,
        c5 VARCHAR(8),
        t4 TIME,
        c6 VARCHAR(8),
        i3 INT,
        t5 TIME,
        c7 VARCHAR(8),
        n1 DOUBLE,
        i4 INT,
        i5 INT,
        t6 TIME DEFAULT '00:00:00'
      ) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
       
      INSERT INTO t1 () VALUES (),(),(),(),(),(),(),(),(),(),(),();
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 () VALUES (),(),(),(),(),(),(),();
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 () VALUES (),(),(),();
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 () VALUES ();
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      ALTER TABLE t1 ADD COLUMN n2 DOUBLE DEFAULT 0;
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 () VALUES (),();
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 (t6) SELECT v1 FROM t1;
      ALTER TABLE t1 ADD COLUMN i6 INT NOT NULL DEFAULT 0, ALGORITHM=COPY;
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      --send
      	ALTER TABLE t1 FORCE;
       
      --connect (con1,localhost,root,,test)
      SET innodb_lock_wait_timeout= 1, lock_wait_timeout= 2;
      --error 0,ER_LOCK_WAIT_TIMEOUT
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      --error 0,ER_LOCK_WAIT_TIMEOUT
      INSERT INTO t1 (pk) SELECT pk FROM t1;
      --disconnect con1
       
      --connection default
      --error 0,ER_LOCK_WAIT_TIMEOUT
      --reap
       
      # Cleanup
      DROP TABLE t1;
      SET GLOBAL innodb_stats_persistent= @innodb_stats_persistent.save;
      

      10.3 is also affected.

      On bb-10.2-marko it mostly fails with the assertion below:

      bb-10.2-marko 5d142f9958d5cbb

      mysqld: /data/src/bb-10.2-marko/storage/innobase/row/row0log.cc:2313: const mrec_t* row_log_table_apply_op(que_thr_t*, ulint, ulint, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, const mrec_t*, const mrec_t*, ulint*): Assertion `0' failed.
      171110  3:26:12 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f3e8dee4ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055c33c21d683 in row_log_table_apply_op (thr=0x7f3e38079e00, trx_id_col=1, new_trx_id_col=1, dup=0x7f3e803422e0, error=0x7f3e80342084, offsets_heap=0x7f3e38042540, heap=0x7f3e3803e4b0, mrec=0x7f3e801b712b "", mrec_end=0x7f3e8027a0e6 "", offsets=0x7f3e3800bb50) at /data/src/bb-10.2-marko/storage/innobase/row/row0log.cc:2313
      #9  0x000055c33c21f581 in row_log_table_apply_ops (thr=0x7f3e38079e00, dup=0x7f3e803422e0, stage=0x7f3e38160730) at /data/src/bb-10.2-marko/storage/innobase/row/row0log.cc:2929
      #10 0x000055c33c21fa8c in row_log_table_apply (thr=0x7f3e38079e00, old_table=0x7f3e38057e88, table=0x7f3e3807e970, stage=0x7f3e38160730) at /data/src/bb-10.2-marko/storage/innobase/row/row0log.cc:3028
      #11 0x000055c33c104b5c in ha_innobase::inplace_alter_table (this=0x7f3e38057658, altered_table=0x7f3e3807e970, ha_alter_info=0x7f3e80342610) at /data/src/bb-10.2-marko/storage/innobase/handler/handler0alter.cc:6488
      #12 0x000055c33bc1d4af in handler::ha_inplace_alter_table (this=0x7f3e38057658, altered_table=0x7f3e3807e970, ha_alter_info=0x7f3e80342610) at /data/src/bb-10.2-marko/sql/handler.h:3768
      #13 0x000055c33bc14729 in mysql_inplace_alter_table (thd=0x7f3e38000b00, table_list=0x7f3e38012520, table=0x7f3e38064830, altered_table=0x7f3e3807e970, ha_alter_info=0x7f3e80342610, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7f3e80342680, alter_ctx=0x7f3e80343240) at /data/src/bb-10.2-marko/sql/sql_table.cc:7332
      #14 0x000055c33bc19a6b in mysql_alter_table (thd=0x7f3e38000b00, new_db=0x7f3e38012b30 "test", new_name=0x0, create_info=0x7f3e80343e50, table_list=0x7f3e38012520, alter_info=0x7f3e80343da0, order_num=0, order=0x0, ignore=false) at /data/src/bb-10.2-marko/sql/sql_table.cc:9324
      #15 0x000055c33bc92b5c in Sql_cmd_alter_table::execute (this=0x7f3e38012b38, thd=0x7f3e38000b00) at /data/src/bb-10.2-marko/sql/sql_alter.cc:324
      #16 0x000055c33bb4f15d in mysql_execute_command (thd=0x7f3e38000b00) at /data/src/bb-10.2-marko/sql/sql_parse.cc:6189
      #17 0x000055c33bb53a0e in mysql_parse (thd=0x7f3e38000b00, rawbuf=0x7f3e38012448 "ALTER TABLE t1 FORCE", length=20, parser_state=0x7f3e80345200, is_com_multi=false, is_next_command=false) at /data/src/bb-10.2-marko/sql/sql_parse.cc:7861
      #18 0x000055c33bb419ca in dispatch_command (command=COM_QUERY, thd=0x7f3e38000b00, packet=0x7f3e3808caf1 "ALTER TABLE t1 FORCE", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/bb-10.2-marko/sql/sql_parse.cc:1805
      #19 0x000055c33bb40328 in do_command (thd=0x7f3e38000b00) at /data/src/bb-10.2-marko/sql/sql_parse.cc:1360
      #20 0x000055c33bc8d84d in do_handle_one_connection (connect=0x55c33fa9c0f0) at /data/src/bb-10.2-marko/sql/sql_connect.cc:1354
      #21 0x000055c33bc8d5da in handle_one_connection (arg=0x55c33fa9c0f0) at /data/src/bb-10.2-marko/sql/sql_connect.cc:1260
      #22 0x000055c33c0aac00 in pfs_spawn_thread (arg=0x55c33faa6660) at /data/src/bb-10.2-marko/storage/perfschema/pfs.cc:1863
      #23 0x00007f3e8fbbb494 in start_thread (arg=0x7f3e80346700) at pthread_create.c:333
      #24 0x00007f3e8dfa193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      However, the initial assertion is also there:

      bb-10.2-marko 5d142f9958d5cbb

      mysqld: /data/src/bb-10.2-marko/storage/innobase/rem/rem0rec.cc:598: ulint* rec_get_offsets_func(const rec_t*, const dict_index_t*, ulint*, bool, ulint, const char*, unsigned int, mem_heap_t**): Assertion `!is_user_rec || leaf || index->is_dummy || dict_index_is_ibuf(index) || n == dict_index_get_n_unique_in_tree_nonleaf(index) + 1' failed.
       
      #7  0x00007f6d567f2ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055c747cd9261 in rec_get_offsets_func (rec=0x7f6d04006b27 "", index=0x7f6ce8051218, offsets=0x7f6d040064e0, leaf=false, n_fields=1, file=0x55c74834c748 "/data/src/bb-10.2-marko/storage/innobase/dict/dict0stats.cc", line=1197, heap=0x7f6d2e7fb550) at /data/src/bb-10.2-marko/storage/innobase/rem/rem0rec.cc:595
      #9  0x000055c747ec2870 in dict_stats_analyze_index_level (index=0x7f6ce8051218, level=1, n_diff=0x7f6d04005ef0, total_recs=0x7f6d2e7fb6f8, total_pages=0x7f6d2e7fb700, n_diff_boundaries=0x7f6d040069a8, mtr=0x7f6d2e7fb780) at /data/src/bb-10.2-marko/storage/innobase/dict/dict0stats.cc:1197
      #10 0x000055c747ec42b0 in dict_stats_analyze_index (index=0x7f6ce8051218) at /data/src/bb-10.2-marko/storage/innobase/dict/dict0stats.cc:2155
      #11 0x000055c747ec4835 in dict_stats_update_persistent (table=0x7f6ce804f5a8) at /data/src/bb-10.2-marko/storage/innobase/dict/dict0stats.cc:2266
      #12 0x000055c747ec6e56 in dict_stats_update (table=0x7f6ce804f5a8, stats_upd_option=DICT_STATS_RECALC_PERSISTENT) at /data/src/bb-10.2-marko/storage/innobase/dict/dict0stats.cc:3227
      #13 0x000055c747eca8c8 in dict_stats_process_entry_from_recalc_pool () at /data/src/bb-10.2-marko/storage/innobase/dict/dict0stats_bg.cc:382
      #14 0x000055c747ecaa86 in dict_stats_thread () at /data/src/bb-10.2-marko/storage/innobase/dict/dict0stats_bg.cc:468
      #15 0x00007f6d584c9494 in start_thread (arg=0x7f6d2e7fc700) at pthread_create.c:333
      #16 0x00007f6d568af93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: