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

Assertion `false' failed in set_field_lock_type upon concurrent INSERT DELAYED and select from table_handles

    XMLWordPrintable

    Details

      Description

      Note: The test case is non-deterministic, run with --repeat=N. Currently it fails for me in a few attempts, but it can vary on different machines and builds.

      --source include/have_perfschema.inc
       
      CREATE TABLE t (a INT) ENGINE=MyISAM;
       
      --connect (con1,localhost,root,,test)
      CREATE VIEW v AS SELECT * FROM performance_schema.table_handles ORDER BY INTERNAL_LOCK;
      --send
        INSERT DELAYED INTO t VALUES (1);
       
      --connection default
      SELECT * FROM v;
       
      # Cleanup
      --connection con1
      --reap
      --disconnect con1
      --connection default
      drop view v;
      drop table t;
      

      10.5 3b251e24

      mariadbd: /data/src/10.5/storage/perfschema/table_helper.cc:602: void set_field_lock_type(Field*, PFS_TL_LOCK_TYPE): Assertion `false' failed.
      200515 16:31:48 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ff807952f12 in __GI___assert_fail (assertion=0x560546f3e894 "false", file=0x560546f3e8d8 "/data/src/10.5/storage/perfschema/table_helper.cc", line=602, function=0x560546f3f300 <set_field_lock_type(Field*, PFS_TL_LOCK_TYPE)::__PRETTY_FUNCTION__> "void set_field_lock_type(Field*, PFS_TL_LOCK_TYPE)") at assert.c:101
      #8  0x00005605465fce6f in set_field_lock_type (f=0x7ff7e401f458, lock_type=PFS_TL_WRITE_DELAYED) at /data/src/10.5/storage/perfschema/table_helper.cc:602
      #9  0x000056054660b885 in table_table_handles::read_row_values (this=0x7ff7f028ebe0, table=0x7ff7e401d4d8, buf=0x7ff7e401e960 "", fields=0x7ff7e401a290, read_all=false) at /data/src/10.5/storage/perfschema/table_table_handles.cc:201
      #10 0x00005605465aea3f in PFS_engine_table::read_row (this=0x7ff7f028ebe0, table=0x7ff7e401d4d8, buf=0x7ff7e401e960 "", fields=0x7ff7e401a260) at /data/src/10.5/storage/perfschema/pfs_engine_table.cc:454
      #11 0x0000560546593bb5 in ha_perfschema::rnd_pos (this=0x7ff7e401e350, buf=0x7ff7e401e960 "", pos=0x7ff7f01f5a28 "\a") at /data/src/10.5/storage/perfschema/ha_perfschema.cc:410
      #12 0x0000560546220818 in handler::ha_rnd_pos (this=0x7ff7e401e350, buf=0x7ff7e401e960 "", pos=0x7ff7f01f5a28 "\a") at /data/src/10.5/sql/handler.cc:3023
      #13 0x00005605463d5296 in rr_from_pointers (info=0x7ff7f0285838) at /data/src/10.5/sql/records.cc:607
      #14 0x0000560545e10a39 in READ_RECORD::read_record (this=0x7ff7f0285838) at /data/src/10.5/sql/records.h:79
      #15 0x0000560545f4827f in join_init_read_record (tab=0x7ff7f0285770) at /data/src/10.5/sql/sql_select.cc:21560
      #16 0x0000560545f45e39 in sub_select (join=0x7ff7f0282440, join_tab=0x7ff7f0285770, end_of_records=false) at /data/src/10.5/sql/sql_select.cc:20612
      #17 0x0000560545f452fa in do_select (join=0x7ff7f0282440, procedure=0x0) at /data/src/10.5/sql/sql_select.cc:20149
      #18 0x0000560545f1908d in JOIN::exec_inner (this=0x7ff7f0282440) at /data/src/10.5/sql/sql_select.cc:4464
      #19 0x0000560545f181b9 in JOIN::exec (this=0x7ff7f0282440) at /data/src/10.5/sql/sql_select.cc:4245
      #20 0x0000560545f198ea in mysql_select (thd=0x7ff7f0000b18, tables=0x7ff7f0013fc8, fields=..., conds=0x0, og_num=1, order=0x7ff7f0019540, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7ff7f0019788, unit=0x7ff7f0004b28, select_lex=0x7ff7f00139d0) at /data/src/10.5/sql/sql_select.cc:4669
      #21 0x0000560545f09400 in handle_select (thd=0x7ff7f0000b18, lex=0x7ff7f0004a60, result=0x7ff7f0019788, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:429
      #22 0x0000560545ecea36 in execute_sqlcom_select (thd=0x7ff7f0000b18, all_tables=0x7ff7f0013fc8) at /data/src/10.5/sql/sql_parse.cc:6172
      #23 0x0000560545ec5d7c in mysql_execute_command (thd=0x7ff7f0000b18) at /data/src/10.5/sql/sql_parse.cc:3901
      #24 0x0000560545ed38e4 in mysql_parse (thd=0x7ff7f0000b18, rawbuf=0x7ff7f0013950 "SELECT * FROM v", length=15, parser_state=0x7ff8024f0520, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7957
      #25 0x0000560545ebfbec in dispatch_command (command=COM_QUERY, thd=0x7ff7f0000b18, packet=0x7ff7f01b0409 "", packet_length=15, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1840
      #26 0x0000560545ebe37e in do_command (thd=0x7ff7f0000b18) at /data/src/10.5/sql/sql_parse.cc:1359
      #27 0x0000560546061951 in do_handle_one_connection (connect=0x560549cef8a8, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1411
      #28 0x00005605460616b9 in handle_one_connection (arg=0x560549d41578) at /data/src/10.5/sql/sql_connect.cc:1313
      #29 0x00005605465971c4 in pfs_spawn_thread (arg=0x560549cca7f8) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #30 0x00007ff8098db4a4 in start_thread (arg=0x7ff8024f1700) at pthread_create.c:456
      #31 0x00007ff807a0fd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      No obvious immediate problem on a non-debug build, but given the concurrency in the test case, it doesn't mean anything.
      The test case is not applicable to 10.4 which doesn't have this P_S table.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: