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

Assertion !rec_offs_nth_extern(offsets2, n) during bulk insert

    XMLWordPrintable

Details

    Description

      While testing MDEV-30341, matthias reported the following stack trace:

      (rr) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=84100336334400) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=84100336334400) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=84100336334400, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x00007f7b0a0c0476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x00007f7b0a0a67f3 in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007f7b0a0a671b in __assert_fail_base (fmt=0x7f7b0a25b150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55703d87ffe0 "!rec_offs_nth_extern(offsets1, n)", 
          file=0x55703d87f260 "/data/Server/bb-10.7-thiru/storage/innobase/rem/rem0cmp.cc", line=706, function=<optimized out>) at ./assert/assert.c:92
      #6  0x00007f7b0a0b7e96 in __GI___assert_fail (assertion=0x55703d87ffe0 "!rec_offs_nth_extern(offsets1, n)", file=0x55703d87f260 "/data/Server/bb-10.7-thiru/storage/innobase/rem/rem0cmp.cc", line=706, 
          function=0x55703d880040 "int cmp_rec_rec_simple_field(const rec_t*, const rec_t*, const rec_offs*, const rec_offs*, const dict_index_t*, ulint)") at ./assert/assert.c:101
      #7  0x000055703c813b8b in cmp_rec_rec_simple_field (rec1=rec1@entry=0x517041fda005 "\200", rec2=rec2@entry=0x517041fea005 "\200", offsets1=offsets1@entry=0x328a232a9890, 
          offsets2=offsets2@entry=0x6250002b4988, index=index@entry=0x6160035f8f08, n=n@entry=7) at /data/Server/bb-10.7-thiru/storage/innobase/rem/rem0cmp.cc:706
      #8  0x000055703c814d2c in cmp_rec_rec_simple (rec1=0x517041fda005 "\200", rec2=0x517041fea005 "\200", offsets1=0x328a232a9890, offsets2=0x6250002b4988, index=0x6160035f8f08, table=0x0)
          at /data/Server/bb-10.7-thiru/storage/innobase/rem/rem0cmp.cc:774
      #9  0x000055703c8b59f3 in row_merge_blocks (dup=dup@entry=0x4c7d22abf840, file=file@entry=0x60300016d1a0, block=block@entry=0x517041fda000 "\005\024\300\n\b\200", foffs0=foffs0@entry=0x4c7d22abf5c0, 
          foffs1=foffs1@entry=0x4c7d22abf5e0, of=of@entry=0x4c7d22abf600, stage=<optimized out>, crypt_block=<optimized out>, space=<optimized out>)
          at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:3207
      #10 0x000055703c8b8324 in row_merge (trx=trx@entry=0x58cd71590a40, dup=dup@entry=0x4c7d22abf840, file=file@entry=0x60300016d1a0, block=block@entry=0x517041fda000 "\005\024\300\n\b\200", 
          tmpfd=tmpfd@entry=0x60700005f6a8, num_run=num_run@entry=0x4c7d22abf740, run_offset=<optimized out>, stage=<optimized out>, crypt_block=<optimized out>, space=<optimized out>)
          at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:3408
      #11 0x000055703c8b8fd7 in row_merge_sort (trx=trx@entry=0x58cd71590a40, dup=dup@entry=0x4c7d22abf840, file=file@entry=0x60300016d1a0, block=<optimized out>, tmpfd=tmpfd@entry=0x60700005f6a8, 
          update_progress=update_progress@entry=true, pct_progress=pct_progress@entry=0, pct_cost=pct_cost@entry=0, crypt_block=<optimized out>, space=<optimized out>, stage=<optimized out>)
          at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:3574
      #12 0x000055703c8c51ed in row_merge_bulk_t::write_to_index (this=this@entry=0x60700005f690, index_no=index_no@entry=0, trx=trx@entry=0x58cd71590a40)
          at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:5328
      #13 0x000055703c8c566c in row_merge_bulk_t::write_to_table (this=0x60700005f690, table=<optimized out>, trx=trx@entry=0x58cd71590a40) at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:5355
      #14 0x000055703c8c56bb in trx_mod_table_time_t::write_bulk (this=0x60700005f648, table=<optimized out>, trx=trx@entry=0x58cd71590a40) at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:5368
      #15 0x000055703c8c5c47 in trx_t::bulk_insert_apply_low (this=this@entry=0x58cd71590a40) at /data/Server/bb-10.7-thiru/storage/innobase/row/row0merge.cc:5382
      #16 0x000055703ca709a8 in trx_t::bulk_insert_apply (this=0x58cd71590a40) at /data/Server/bb-10.7-thiru/storage/innobase/include/trx0trx.h:1171
      #17 trx_mark_sql_stat_end (trx=trx@entry=0x58cd71590a40) at /data/Server/bb-10.7-thiru/storage/innobase/trx/trx0trx.cc:1665
      #18 0x000055703c52a312 in innobase_commit (hton=<optimized out>, thd=0x62b000229218, commit_trx=<optimized out>) at /data/Server/bb-10.7-thiru/storage/innobase/handler/ha_innodb.cc:4613
      #19 0x000055703bb3d076 in commit_one_phase_2 (thd=thd@entry=0x62b000229218, all=all@entry=false, trans=trans@entry=0x62b00022cbd8, is_real_trans=false) at /data/Server/bb-10.7-thiru/sql/handler.cc:2084
      #20 0x000055703bb3d416 in ha_commit_one_phase (thd=thd@entry=0x62b000229218, all=all@entry=false) at /data/Server/bb-10.7-thiru/sql/handler.cc:2037
      #21 0x000055703bb6ea83 in ha_commit_trans (thd=thd@entry=0x62b000229218, all=all@entry=false) at /data/Server/bb-10.7-thiru/sql/handler.cc:1831
      #22 0x000055703b6fe84e in trans_commit_stmt (thd=thd@entry=0x62b000229218) at /data/Server/bb-10.7-thiru/sql/transaction.cc:472
      #23 0x000055703b25c180 in mysql_execute_command (thd=thd@entry=0x62b000229218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/bb-10.7-thiru/sql/sql_parse.cc:6052
      #24 0x000055703b25da12 in mysql_parse (thd=thd@entry=0x62b000229218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x4c7d22ac1620)
          at /data/Server/bb-10.7-thiru/sql/sql_parse.cc:8017
      #25 0x000055703b264242 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62b000229218, 
          packet=packet@entry=0x629000edd219 " INSERT INTO t6 (col1,col2, col_int, col_string, col_text) VALUES /* 1 */ (1,1,1,REPEAT(SUBSTR(CAST( 1 AS CHAR),1,1), 10),REPEAT(SUBSTR(CAST( 1 AS CHAR),1,1), @fill_amount) ), (1,1,1,REPEAT(SUBSTR(CAS"..., packet_length=packet_length@entry=313, blocking=blocking@entry=true) at /data/Server/bb-10.7-thiru/sql/sql_parse.cc:1894
      #26 0x000055703b2692a1 in do_command (thd=0x62b000229218, blocking=blocking@entry=true) at /data/Server/bb-10.7-thiru/sql/sql_parse.cc:1407
      #27 0x000055703b6be43a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000034b8, put_in_cache=put_in_cache@entry=true) at /data/Server/bb-10.7-thiru/sql/sql_connect.cc:1416
      #28 0x000055703b6beaa0 in handle_one_connection (arg=0x6080000034b8) at /data/Server/bb-10.7-thiru/sql/sql_connect.cc:1318
      #29 0x00007f7b0a112b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #30 0x00007f7b0a1a3bb4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      

      location:

      [rr 500875 46278]mysqld: /data/Server/bb-10.7-thiru/storage/innobase/rem/rem0cmp.cc:706: int cmp_rec_rec_simple_field(const rec_t*, const rec_t*, const rec_offs*, const rec_offs*, const dict_index_t*, ulint): Assertion `!rec_offs_nth_extern(offsets1, n)' failed.
      sdp:/data1/results/1673635588/TBR-1735$ _RR_TRACE_DIR=./1/rr rr replay --mark-stdio
      

      So debugged and came up with the following test case to repeat the issue in 10.7:

      --source include/have_innodb.inc
      create table t1(f1 text not null, f2 text not null,
                      f3 text not null, f4 text not null,
                      f5 text not null, f6 text not null,
                      primary key(f6(10)))engine=innodb;
      set unique_checks=0, foreign_key_checks=0;
      begin;
      insert into t1 values
              (repeat('a', 200), repeat('b', 200), repeat('c', 200),
               repeat('d', 200), repeat('e', 200), repeat('f', 200)),
              (repeat('b', 20000), repeat('c', 16000), repeat('d', 12000),
               repeat('e', 12000), repeat('f', 12000), repeat('f', 12000));
      commit;
      drop table t1;
      

      Attachments

        Issue Links

          Activity

            People

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