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

Various crashes due to DB_TRX_ID mismatch in table-rebuilding ALTER TABLE…LOCK=NONE

    XMLWordPrintable

    Details

      Description

      10.3 578b2b05b8f734

      mysqld: /data/src/10.3/storage/innobase/row/row0log.cc:1961: dberr_t row_log_table_apply_delete(que_thr_t*, ulint, const mrec_t*, const ulint*, mem_heap_t*, mem_heap_t*, const row_log_t*, const row_ext_t*, ulint): Assertion `!log->same_pk' failed.
      170826  3:29:10 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f9af1281ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055a1b98d56b6 in row_log_table_apply_delete (thr=0x7f9a9402d290, trx_id_col=1, mrec=0x7f9adc1aa021 "", moffsets=0x7f9a94030300, offsets_heap=0x7f9a94055ae0, heap=0x7f9a94031590, log=0x7f9a940359c0, save_ext=0x0, ext_size=0) at /data/src/10.3/storage/innobase/row/row0log.cc:1961
      #9  0x000055a1b98d6efc in row_log_table_apply_op (thr=0x7f9a9402d290, new_trx_id_col=1, dup=0x7f9adc5ef210, error=0x7f9adc5eefc4, offsets_heap=0x7f9a94055ae0, heap=0x7f9a94031590, mrec=0x7f9adc1aa021 "", mrec_end=0x7f9adc1aa034 "", offsets=0x7f9a94030300) at /data/src/10.3/storage/innobase/row/row0log.cc:2489
      #10 0x000055a1b98d8aa9 in row_log_table_apply_ops (thr=0x7f9a9402d290, dup=0x7f9adc5ef210, stage=0x7f9a94030240) at /data/src/10.3/storage/innobase/row/row0log.cc:3015
      #11 0x000055a1b98d8fd7 in row_log_table_apply (thr=0x7f9a9402d290, old_table=0x7f9a9002d1f8, table=0x7f9a94028d50, stage=0x7f9a94030240) at /data/src/10.3/storage/innobase/row/row0log.cc:3114
      #12 0x000055a1b97b62d2 in ha_innobase::inplace_alter_table (this=0x7f9a9401b2a8, altered_table=0x7f9a94028d50, ha_alter_info=0x7f9adc5ef540) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:6491
      #13 0x000055a1b928c7e3 in handler::ha_inplace_alter_table (this=0x7f9a9401b2a8, altered_table=0x7f9a94028d50, ha_alter_info=0x7f9adc5ef540) at /data/src/10.3/sql/handler.h:3830
      #14 0x000055a1b9283e35 in mysql_inplace_alter_table (thd=0x7f9a94000b00, table_list=0x7f9a94013648, table=0x7f9a9401a680, altered_table=0x7f9a94028d50, ha_alter_info=0x7f9adc5ef540, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7f9adc5ef5b0, alter_ctx=0x7f9adc5f0170) at /data/src/10.3/sql/sql_table.cc:7179
      #15 0x000055a1b9288d48 in mysql_alter_table (thd=0x7f9a94000b00, new_db=0x7f9a94013c58 "test", new_name=0x0, create_info=0x7f9adc5f0d80, table_list=0x7f9a94013648, alter_info=0x7f9adc5f0cd0, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9119
      #16 0x000055a1b9304bd6 in Sql_cmd_alter_table::execute (this=0x7f9a94013c88, thd=0x7f9a94000b00) at /data/src/10.3/sql/sql_alter.cc:331
      #17 0x000055a1b91bdbd5 in mysql_execute_command (thd=0x7f9a94000b00) at /data/src/10.3/sql/sql_parse.cc:6240
      #18 0x000055a1b91c2360 in mysql_parse (thd=0x7f9a94000b00, rawbuf=0x7f9a94013558 "ALTER TABLE t1 DROP COLUMN extra", length=32, parser_state=0x7f9adc5f2610, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7921
      #19 0x000055a1b91b05a7 in dispatch_command (command=COM_QUERY, thd=0x7f9a94000b00, packet=0x7f9a9400ae21 "ALTER TABLE t1 DROP COLUMN extra", packet_length=32, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1821
      #20 0x000055a1b91af049 in do_command (thd=0x7f9a94000b00) at /data/src/10.3/sql/sql_parse.cc:1372
      #21 0x000055a1b92ff863 in do_handle_one_connection (connect=0x55a1bc22c550) at /data/src/10.3/sql/sql_connect.cc:1418
      #22 0x000055a1b92ff5f0 in handle_one_connection (arg=0x55a1bc22c550) at /data/src/10.3/sql/sql_connect.cc:1324
      #23 0x000055a1b975e099 in pfs_spawn_thread (arg=0x55a1bc2355f0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #24 0x00007f9af31c6494 in start_thread (arg=0x7f9adc5f3700) at pthread_create.c:333
      #25 0x00007f9af133e93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      NOTE: This test case is for reproducing only, don't put it into the regression suite!

      --source include/have_innodb.inc
       
      --let $run= 100
       
      CREATE TABLE t1 (col1 INT, col2 TEXT) ENGINE = InnoDB;
       
      --connect (con1,localhost,root,,test)
      --connect (con2,localhost,root,,test)
       
      while ($run)
      {
        --connection con1
        ALTER TABLE t1 ADD COLUMN extra INT;
        INSERT INTO t1 (col1,col2) VALUES (1,'foo'), (2,'bar');
        --send
          UPDATE t1 SET extra = col1;
          
        --connection con2
        --send
          ALTER TABLE t1 DROP COLUMN extra;
       
        --connection con1
        --reap
          DELETE FROM t1;
        
        --connection con2
        --reap
        
        --dec $run
      }
       
      # Cleanup
      --disconnect con1
      --disconnect con2
       
      --connection default
      DROP TABLE t1;
      

        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: