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

Assertion `trn' failed in ha_maria::start_stmt upon concurrent LOAD and SELECT

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • 10.5, 10.6
    • Storage Engine - Aria
    • None

    Description

      The test case is non-deterministic, run with --repeat=N. Don't put it into the regression suite, create a deterministic one instead.
      It usually fails for me on the first attempt, but sometimes it misses the mark. A part of cleanup at the end of the test case is commented on purpose: it looks like if it passes the first time, it is unwilling to fail upon repetition without server restart, so the lack of cleanup serves the same purpose as --force-restart.

      --source include/have_sequence.inc
       
      SELECT CONCAT('foo',seq) INTO OUTFILE 'foos' FROM seq_1_to_100;
      CREATE TABLE t (a varchar(8), fulltext key(a)) ENGINE=Aria;
      CREATE FUNCTION f() RETURNS text RETURN NULL;
       
      --connect (con1,localhost,root,,test)
      --send
        LOAD DATA INFILE 'foos' INTO TABLE t;
       
      --connection default
      SELECT * FROM (select f() from performance_schema.events_stages_summary_by_host_by_event_name) sq JOIN t;
       
      # Cleanup
      --connection con1
      --reap
      --let $datadir= `select @@datadir`
      --remove_file $datadir/test/foos
      --disconnect con1
       
      --connection default
      #DROP FUNCTION f;
      #DROP TABLE t;
      

      10.5 42802ad6

      mariadbd: /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/maria/ha_maria.cc:2944: virtual int ha_maria::start_stmt(THD*, thr_lock_type): Assertion `trn' failed.
      221030 20:35:46 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f00a163b662 in __GI___assert_fail (assertion=0x55f2e9eecf60 "trn", file=0x55f2e9eea8a0 "/home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/maria/ha_maria.cc", line=2944, function=0x55f2e9eecfa0 "virtual int ha_maria::start_stmt(THD*, thr_lock_type)") at assert.c:101
      #8  0x000055f2e86268fe in ha_maria::start_stmt (this=0x61d0002864b8, thd=0x62b00007e218, lock_type=TL_READ) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/maria/ha_maria.cc:2944
      #9  0x000055f2e76d7435 in check_lock_and_start_stmt (thd=0x62b00007e218, prelocking_ctx=0x62b000082308, table_list=0x62b000088390) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_base.cc:5012
      #10 0x000055f2e76da35f in lock_tables (thd=0x62b00007e218, tables=0x62b000087c38, count=2, flags=0) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_base.cc:5512
      #11 0x000055f2e76d8af2 in open_and_lock_tables (thd=0x62b00007e218, options=..., tables=0x62b000087c38, derived=true, flags=0, prelocking_strategy=0x7f008f1d28d0) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_base.cc:5246
      #12 0x000055f2e7631cd3 in open_and_lock_tables (thd=0x62b00007e218, tables=0x62b000087c38, derived=true, flags=0) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_base.h:507
      #13 0x000055f2e7875d92 in execute_sqlcom_select (thd=0x62b00007e218, all_tables=0x62b000087c38) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:6236
      #14 0x000055f2e7865805 in mysql_execute_command (thd=0x62b00007e218) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:4006
      #15 0x000055f2e78815da in mysql_parse (thd=0x62b00007e218, rawbuf=0x62b000085238 "SELECT * FROM (select f() from performance_schema.events_stages_summary_by_host_by_event_name) sq JOIN t", length=104, parser_state=0x7f008f1d3bb0, is_com_multi=false, is_next_command=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:8087
      #16 0x000055f2e7857c9a in dispatch_command (command=COM_QUERY, thd=0x62b00007e218, packet=0x62900028a219 "SELECT * FROM (select f() from performance_schema.events_stages_summary_by_host_by_event_name) sq JOIN t", packet_length=104, is_com_multi=false, is_next_command=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1891
      #17 0x000055f2e78546b7 in do_command (thd=0x62b00007e218) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1375
      #18 0x000055f2e7c9087b in do_handle_one_connection (connect=0x608000002bb8, put_in_cache=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1416
      #19 0x000055f2e7c90218 in handle_one_connection (arg=0x608000002b38) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1318
      #20 0x000055f2e88b4d68 in pfs_spawn_thread (arg=0x61500000d518) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:2201
      #21 0x00007f00a1b19ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x00007f00a1706aef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.5+ debug builds. Not reproducible on 10.4.
      No obvious immediate problem on a non-debug build.
      I didn't succeed at replacing the performance schema table with a normal one, even though it makes no difference whether the performance schema is enabled or disabled during the run (in the latter case the P_S table is empty).

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.