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

Assertion `thd->is_error()' failed in mysql_admin_table upon shutdown

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 10.1, 10.2, 10.3
    • N/A
    • Admin statements
    • None

    Description

      Note: The test case is non-deterministic, run with --repeat=N and --mem. It currently fails almost every time for me on 10.2 and 10.3 in memory, but not on disk; and doesn't fail on 10.1, even though the failure was observed on 10.1 in the past.

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      SET GLOBAL innodb_stats_persistent= ON;
      CREATE TABLE t1 (id int, a int, PRIMARY KEY (id)) ENGINE=InnoDB;
      INSERT INTO t1 SELECT seq, seq FROM seq_1_to_10000;
      CREATE DATABASE db;
      FLUSH TABLES WITH READ LOCK;
       
      --connect (con1,localhost,root,,test)
      --connect (con2,localhost,root,,test)
      --connect (con3,localhost,root,,test)
      --send
        OPTIMIZE TABLE t1;
       
      --connection con2
      --send
        REPLACE INTO t1 SELECT * FROM t1;
       
      --connection default
      UNLOCK TABLES;
      CREATE TABLE db.t ENGINE=InnoDB SELECT DISTINCT a FROM t1 WHERE id BETWEEN 5763 AND 58276 ORDER BY a;
      --send
        CREATE DATABASE IF NOT EXISTS db;
       
      --connection con1
      --send
        UPDATE db.t SET a = a + 9999 WHERE a NOT IN ( SELECT DISTINCT a FROM t1 WHERE id BETWEEN 5763 AND 58276 ORDER BY a );
       
      --connection default
      --reap
      SET lock_wait_timeout= 1;
      --error 0,ER_LOCK_WAIT_TIMEOUT
      FLUSH TABLES;
       
      --source include/restart_mysqld.inc
       
      # Cleanup
      DROP DATABASE db;
      DROP TABLE t1;
      

      10.2 debug 7a695d8a

      2020-06-12  1:44:56 140665977317120 [Note] /data/bld/10.2-debug/bin/mysqld (initiated by: root[root] @ localhost []): Normal shutdown
      mysqld: /data/src/10.2/sql/sql_admin.cc:1066: bool mysql_admin_table(THD*, TABLE_LIST*, HA_CHECK_OPT*, const char*, thr_lock_type, bool, bool, uint, int (*)(THD*, TABLE
      _LIST*, HA_CHECK_OPT*), int (handler::*)(THD*, HA_CHECK_OPT*), int (*)(THD*, TABLE_LIST*, HA_CHECK_OPT*)): Assertion `thd->is_error()' failed.
      200612  1:44:56 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007fef5f4a0e67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x563c619df473 "thd->is_error()", file=file@entry=0x563c619dee90 "/data/src/10.2/sql/sql_admin.cc", line=line@entry=1066, function=function@entry=0x563c619df6e0 <mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*, st_ha_check_opt*))::__PRETTY_FUNCTION__> "bool mysql_admin_table(THD*, TABLE_LIST*, HA_CHECK_OPT*, const char*, thr_lock_type, bool, bool, uint, int (*)(THD*, TABLE_LIST*, HA_CHECK_OPT*), int (handler::*)(THD*, HA_CHECK_OPT*), int (*)(THD*, T"...) at assert.c:92
      #7  0x00007fef5f4a0f12 in __GI___assert_fail (assertion=0x563c619df473 "thd->is_error()", file=0x563c619dee90 "/data/src/10.2/sql/sql_admin.cc", line=1066, function=0x563c619df6e0 <mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*, st_ha_check_opt*))::__PRETTY_FUNCTION__> "bool mysql_admin_table(THD*, TABLE_LIST*, HA_CHECK_OPT*, const char*, thr_lock_type, bool, bool, uint, int (*)(THD*, TABLE_LIST*, HA_CHECK_OPT*), int (handler::*)(THD*, HA_CHECK_OPT*), int (*)(THD*, T"...) at assert.c:101
      #8  0x0000563c6108a7d9 in mysql_admin_table(THD *, TABLE_LIST *, HA_CHECK_OPT *, const char *, thr_lock_type, bool, bool, uint, int (*)(THD *, TABLE_LIST *, HA_CHECK_OPT *), struct {...}, int (*)(THD *, TABLE_LIST *, HA_CHECK_OPT *)) (thd=0x7fef04000af0, tables=0x7fef04011158, check_opt=0x7fef04005600, operator_name=0x563c619df5d0 "optimize", lock_type=TL_WRITE, org_open_for_modify=true, repair_table_use_frm=false, extra_open_options=0, prepare_func=0x0, operator_func=(int (handler::*)(handler * const, THD *, HA_CHECK_OPT *)) 0x563c611aa80a <handler::ha_optimize(THD*, st_ha_check_opt*)>, view_operator_func=0x0) at /data/src/10.2/sql/sql_admin.cc:1066
      #9  0x0000563c6108b862 in Sql_cmd_optimize_table::execute (this=0x7fef04011778, thd=0x7fef04000af0) at /data/src/10.2/sql/sql_admin.cc:1360
      #10 0x0000563c60f2fba5 in mysql_execute_command (thd=0x7fef04000af0) at /data/src/10.2/sql/sql_parse.cc:5972
      #11 0x0000563c60f34b25 in mysql_parse (thd=0x7fef04000af0, rawbuf=0x7fef04011088 "OPTIMIZE TABLE t1", length=17, parser_state=0x7fef59a0c610, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7741
      #12 0x0000563c60f22e52 in dispatch_command (command=COM_QUERY, thd=0x7fef04000af0, packet=0x7fef040088a1 "", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #13 0x0000563c60f218cd in do_command (thd=0x7fef04000af0) at /data/src/10.2/sql/sql_parse.cc:1385
      #14 0x0000563c61077523 in do_handle_one_connection (connect=0x563c6442b360) at /data/src/10.2/sql/sql_connect.cc:1336
      #15 0x0000563c6107728e in handle_one_connection (arg=0x563c6442b360) at /data/src/10.2/sql/sql_connect.cc:1241
      #16 0x0000563c6188d7d0 in pfs_spawn_thread (arg=0x563c6442ae50) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #17 0x00007fef614294a4 in start_thread (arg=0x7fef59a0d700) at pthread_create.c:456
      #18 0x00007fef5f55dd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
       
      Query (0x7fef04011088): OPTIMIZE TABLE t1
      Connection ID (thread ID): 12
      Status: KILL_SERVER
      

      No obvious problem on a non-debug build.
      Couldn't reproduce on 10.4 or 10.5.

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            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.