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

Assertion `!expl_lock || expl_lock->trx == arg->impl_trx' failed in lock_rec_other_trx_holds_expl_callback upon concurrent UPDATE with unique blobs

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL)
    • 10.5, 10.6, 10.11
    • Server
    • None

    Description

      This problem can be a side-effect of MDEV-23264, or a separate one which MDEV-23264 just helps to reproduce. I expect it to be clarified after development analysis

      The test case is non-deterministic. It currently fails every time for me, but it can vary on different machines and builds. Try running with --repeat if it doesn't fail right away.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT, b TEXT UNIQUE) ENGINE=InnoDB;
      INSERT INTO t1 () VALUES (),();
      UPDATE IGNORE t1 SET b = '';
       
      --connect (con1,localhost,root,,test)
      --let $conid= `SELECT CONNECTION_ID()`
      --delimiter $
      --send
      LOOP
        UPDATE t1 SET a = 1;
      END LOOP $
      --delimiter ;
       
      --connection default
      UPDATE t1 SET b = NULL;
      --error ER_DUP_ENTRY
      INSERT INTO t1 VALUES (1,''),(1,'');
       
      # Cleanup
      --eval KILL $conid
      DROP TABLE t1;
      

      10.4 b1538f4d

      mysqld: /data/src/10.4/storage/innobase/lock/lock0lock.cc:5437: my_bool lock_rec_other_trx_holds_expl_callback(rw_trx_hash_element_t*, lock_rec_other_trx_holds_expl_arg*): Assertion `!expl_lock || expl_lock->trx == arg->impl_trx' failed.
      200722 21:36:43 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8334780f12 in __GI___assert_fail (assertion=0x55e90b20bc30 "!expl_lock || expl_lock->trx == arg->impl_trx", file=0x55e90b209718 "/data/src/10.4/storage/innobase/lock/lock0lock.cc", line=5437, function=0x55e90b2102c0 <lock_rec_other_trx_holds_expl_callback(rw_trx_hash_element_t*, lock_rec_other_trx_holds_expl_arg*)::__PRETTY_FUNCTION__> "my_bool lock_rec_other_trx_holds_expl_callback(rw_trx_hash_element_t*, lock_rec_other_trx_holds_expl_arg*)") at assert.c:101
      #8  0x000055e90a930752 in lock_rec_other_trx_holds_expl_callback (element=0x7f82dc06c170, arg=0x7f832db27350) at /data/src/10.4/storage/innobase/lock/lock0lock.cc:5437
      #9  0x000055e90a9378b0 in rw_trx_hash_t::debug_iterator (element=0x7f82dc06c170, arg=0x7f832db27300) at /data/src/10.4/storage/innobase/include/trx0sys.h:535
      #10 0x000055e90aed4f13 in l_find (head=0x55e90e743700, cs=0x0, hashnr=0, key=0x7f832db27300 "t\005\223\n\351U", keylen=0, cursor=0x7f832db272a0, pins=0x55e90e73b610, callback=0x55e90a937827 <rw_trx_hash_t::debug_iterator(rw_trx_hash_element_t*, rw_trx_hash_t::debug_iterator_arg*)>) at /data/src/10.4/mysys/lf_hash.c:127
      #11 0x000055e90aed5c0b in lf_hash_iterate (hash=0x55e90babbfc0 <trx_sys+2496>, pins=0x55e90e73b610, action=0x55e90a937827 <rw_trx_hash_t::debug_iterator(rw_trx_hash_element_t*, rw_trx_hash_t::debug_iterator_arg*)>, argument=0x7f832db27300) at /data/src/10.4/mysys/lf_hash.c:519
      #12 0x000055e90a937c9b in rw_trx_hash_t::iterate (this=0x55e90babbfc0 <trx_sys+2496>, caller_trx=0x7f832e5c2140, action=0x55e90a937827 <rw_trx_hash_t::debug_iterator(rw_trx_hash_element_t*, rw_trx_hash_t::debug_iterator_arg*)>, argument=0x7f832db27300) at /data/src/10.4/storage/innobase/include/trx0sys.h:753
      #13 0x000055e90a9309c6 in lock_rec_other_trx_holds_expl (caller_trx=0x7f832e5c2140, trx=0x7f832e5c3268, rec=0x7f832e2f4096 "", block=0x7f832ddee620) at /data/src/10.4/storage/innobase/lock/lock0lock.cc:5483
      #14 0x000055e90a930e3e in lock_rec_convert_impl_to_expl (caller_trx=0x7f832e5c2140, block=0x7f832ddee620, rec=0x7f832e2f4096 "", index=0x7f82dc148c40, offsets=0x7f832db277e0) at /data/src/10.4/storage/innobase/lock/lock0lock.cc:5549
      #15 0x000055e90a931e85 in lock_sec_rec_read_check_and_lock (flags=0, block=0x7f832ddee620, rec=0x7f832e2f4096 "", index=0x7f82dc148c40, offsets=0x7f832db277e0, mode=LOCK_X, gap_mode=0, thr=0x7f82dc14b338) at /data/src/10.4/storage/innobase/lock/lock0lock.cc:5759
      #16 0x000055e90aa653fb in sel_set_rec_lock (pcur=0x7f82dc14aac8, rec=0x7f832e2f4096 "", index=0x7f82dc148c40, offsets=0x7f832db277e0, mode=3, type=0, thr=0x7f82dc14b338, mtr=0x7f832db28040) at /data/src/10.4/storage/innobase/row/row0sel.cc:1279
      #17 0x000055e90aa6fc35 in row_search_mvcc (buf=0x7f82dc147870 "\370\001", mode=PAGE_CUR_GE, prebuilt=0x7f82dc14a8f0, match_mode=1, direction=0) at /data/src/10.4/storage/innobase/row/row0sel.cc:5046
      #18 0x000055e90a87eec8 in ha_innobase::index_read (this=0x7f82dc00ae38, buf=0x7f82dc147870 "\370\001", key_ptr=0x7f832db2873f "", key_len=9, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9273
      #19 0x000055e90a643a6c in handler::index_read_map (this=0x7f82dc00ae38, buf=0x7f82dc147870 "\370\001", key=0x7f832db2873f "", keypart_map=18446744073709551615, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/handler.h:3627
      #20 0x000055e90a633cba in handler::ha_index_read_map (this=0x7f82dc00ae38, buf=0x7f82dc147870 "\370\001", key=0x7f832db2873f "", keypart_map=18446744073709551615, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/handler.cc:2919
      #21 0x000055e90a63e549 in check_duplicate_long_entry_key (table=0x7f82dc149630, h=0x7f82dc00ae38, new_rec=0x7f82dc147870 "\370\001", key_no=0) at /data/src/10.4/sql/handler.cc:6588
      #22 0x000055e90a63ec0e in check_duplicate_long_entries (table=0x7f82dc149630, h=0x7f82dc00ae38, new_rec=0x7f82dc147870 "\370\001") at /data/src/10.4/sql/handler.cc:6658
      #23 0x000055e90a63ef58 in handler::ha_write_row (this=0x7f82dc00ae38, buf=0x7f82dc147870 "\370\001") at /data/src/10.4/sql/handler.cc:6739
      #24 0x000055e90a28cca1 in write_record (thd=0x7f82dc000af0, table=0x7f82dc149630, info=0x7f832db28a90) at /data/src/10.4/sql/sql_insert.cc:2060
      #25 0x000055e90a289bf1 in mysql_insert (thd=0x7f82dc000af0, table_list=0x7f82dc013290, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.4/sql/sql_insert.cc:1078
      #26 0x000055e90a2d6f51 in mysql_execute_command (thd=0x7f82dc000af0) at /data/src/10.4/sql/sql_parse.cc:4518
      #27 0x000055e90a2e289b in mysql_parse (thd=0x7f82dc000af0, rawbuf=0x7f82dc013198 "INSERT INTO t1 VALUES (1,''),(1,'')", length=35, parser_state=0x7f832db29570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7895
      #28 0x000055e90a2cedd0 in dispatch_command (command=COM_QUERY, thd=0x7f82dc000af0, packet=0x7f82dc156cd1 "INSERT INTO t1 VALUES (1,''),(1,'')", packet_length=35, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1834
      #29 0x000055e90a2cd572 in do_command (thd=0x7f82dc000af0) at /data/src/10.4/sql/sql_parse.cc:1352
      #30 0x000055e90a45662e in do_handle_one_connection (connect=0x55e90e83b580) at /data/src/10.4/sql/sql_connect.cc:1412
      #31 0x000055e90a45637d in handle_one_connection (arg=0x55e90e83b580) at /data/src/10.4/sql/sql_connect.cc:1316
      #32 0x000055e90ae569bb in pfs_spawn_thread (arg=0x55e90e7b9530) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #33 0x00007f83367094a4 in start_thread (arg=0x7f832db2a700) at pthread_create.c:456
      #34 0x00007f833483dd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.4/10.5 debug builds.
      Release builds don't crash, but they're still affected by MDEV-23264.
      The test case is not applicable to earlier versions due to unique blobs.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.