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

Server crash or assertion failure in in THD::update_stats upon concurrent DROP TRIGGER

    XMLWordPrintable

Details

    Description

      Note: The test case is non-deterministic, run with --repeat=N. It currently fails for me withing ~50 attempts on disk, but it can vary a lot on different machines and builds, and it seems to be much less likely to happen when run in shm.

      SET lock_wait_timeout= 0;
       
      --connect (con1,localhost,root,,test)
      --send
        DROP TRIGGER tr;
      --connection default
      --error ER_TRG_DOES_NOT_EXIST,ER_LOCK_WAIT_TIMEOUT
        DROP TRIGGER tr;
      --connection con1
      --error ER_TRG_DOES_NOT_EXIST
      --reap
      

      10.5 621501f3

      #3  <signal handler called>
      #4  0x000055d7ea57b6e5 in THD::update_stats (this=0x7f3b10000db8) at /data/src/10.5/sql/sql_class.cc:1350
      #5  0x000055d7ea6046d9 in mysql_execute_command (thd=0x7f3b10000db8) at /data/src/10.5/sql/sql_parse.cc:6068
      #6  0x000055d7ea60a708 in mysql_parse (thd=0x7f3b10000db8, rawbuf=0x7f3b10013ea0 "DROP TRIGGER tr", length=15, parser_state=0x7f3b2e437490, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:8099
      #7  0x000055d7ea5f667f in dispatch_command (command=COM_QUERY, thd=0x7f3b10000db8, packet=0x7f3b1000b5b9 "DROP TRIGGER tr", packet_length=15, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1891
      #8  0x000055d7ea5f4e71 in do_command (thd=0x7f3b10000db8) at /data/src/10.5/sql/sql_parse.cc:1370
      #9  0x000055d7ea7a4ba9 in do_handle_one_connection (connect=0x55d7ee9d8098, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1410
      #10 0x000055d7ea7a490c in handle_one_connection (arg=0x55d7ee9d8098) at /data/src/10.5/sql/sql_connect.cc:1312
      #11 0x000055d7ead090e7 in pfs_spawn_thread (arg=0x55d7ee9d9428) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #12 0x00007f3b3412c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #13 0x00007f3b33d00293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      or

      mariadbd: /data/src/10.5/sql/sql_parse.cc:914: bool is_update_query(enum_sql_command): Assertion `command <= SQLCOM_END' failed.
      210511 14:34:28 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc6d92f8f36 in __GI___assert_fail (assertion=0x558cea89e140 "command <= SQLCOM_END", file=0x558cea89e040 "/data/src/10.5/sql/sql_parse.cc", line=914, function=0x558cea89e180 "bool is_update_query(enum_sql_command)") at assert.c:101
      #8  0x0000558ce8784c16 in is_update_query (command=65504) at /data/src/10.5/sql/sql_parse.cc:914
      #9  0x0000558ce8663920 in THD::update_stats (this=0x62b000069288) at /data/src/10.5/sql/sql_class.cc:1354
      #10 0x0000558ce87a8417 in mysql_execute_command (thd=0x62b000069288) at /data/src/10.5/sql/sql_parse.cc:6068
      #11 0x0000558ce87b5ab8 in mysql_parse (thd=0x62b000069288, rawbuf=0x62b0000382a8 "DROP TRIGGER tr", length=15, parser_state=0x7fc6cfeb9b40, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:8099
      #12 0x0000558ce878b918 in dispatch_command (command=COM_QUERY, thd=0x62b000069288, packet=0x6290011fd289 "DROP TRIGGER tr", packet_length=15, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1891
      #13 0x0000558ce878823f in do_command (thd=0x62b000069288) at /data/src/10.5/sql/sql_parse.cc:1370
      #14 0x0000558ce8bcf4e2 in do_handle_one_connection (connect=0x61100000d908, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1410
      #15 0x0000558ce8bcee46 in handle_one_connection (arg=0x61100000ac08) at /data/src/10.5/sql/sql_connect.cc:1312
      #16 0x0000558ce98e723f in pfs_spawn_thread (arg=0x616000103c08) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #17 0x00007fc6d9810609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x00007fc6d93e4293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure appeared in 10.5 after this commit:

      commit 621501f38bd8db1a334a6cd873db787a5a5070aa 5d8684863c630d8a13793963ef8fbd95e65bfe1c
      Commit:     Monty
      CommitDate: Mon May 10 21:11:46 2021 +0300
       
          MDEV-25606: Concurrent CREATE TRIGGER statements mix up in binlog and break replication
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              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.