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

Server crash in get_lock_data / mysql_lock_abort_for_thread

    XMLWordPrintable

Details

    Description

      Note: The test case is non-deterministic, run with --repeat=N. It usually fails for me within ~10 attempts, but it can vary on different machines and builds.

      --source include/have_partition.inc
       
      CREATE TABLE t1 (a INT);
       
      CREATE TABLE t2 (b INT, c varchar(5))
        PARTITION BY RANGE COLUMNS(c)
        SUBPARTITION by key(b) SUBPARTITIONS 2 (
          PARTITION p0 VALUES LESS THAN ('m'),
          PARTITION p1 VALUES LESS THAN ('z')
        );
       
      --connect (con1,localhost,root,,)
      HANDLER t1 OPEN;
      --send
        SELECT b FROM t2 PARTITION (p0);
       
      --connection default
      SET lock_wait_timeout= 1;
      --error ER_STATEMENT_TIMEOUT,ER_LOCK_WAIT_TIMEOUT
      ALTER TABLE t1 FORCE;
       
      --connection con1
      --reap
      --disconnect con1
      --connection default
      DROP TABLE t2, t1;
      

      10.4 956d6c4a

      #3  <signal handler called>
      #4  0x000055b0a4241324 in get_lock_data (thd=0x62b00005b208, table_ptr=0x7f6fec14d860, count=1, flags=2) at /data/src/10.4/sql/lock.cc:808
      #5  0x000055b0a423f6c8 in mysql_lock_abort_for_thread (thd=0x62b00005b208, table=0x62000007d088) at /data/src/10.4/sql/lock.cc:617
      #6  0x000055b0a365d3e2 in THD::notify_shared_lock (this=0x62b00005b208, ctx_in_use=0x62b00008c2e0, needs_thr_lock_abort=true) at /data/src/10.4/sql/sql_class.cc:2039
      #7  0x000055b0a3b97fbc in MDL_lock::notify_conflicting_locks (this=0x6160000447a8, ctx=0x62b00005b350) at /data/src/10.4/sql/mdl.cc:612
      #8  0x000055b0a3b91c7b in MDL_context::acquire_lock (this=0x62b00005b350, mdl_request=0x7f6fec14dcc0, lock_wait_timeout=1) at /data/src/10.4/sql/mdl.cc:2343
      #9  0x000055b0a3b93553 in MDL_context::upgrade_shared_lock (this=0x62b00005b350, mdl_ticket=0x60600007e5c0, new_type=MDL_EXCLUSIVE, lock_wait_timeout=1) at /data/src/10.4/sql/mdl.cc:2579
      #10 0x000055b0a35e936a in wait_while_table_is_used (thd=0x62b00005b208, table=0x620000080088, function=HA_EXTRA_PREPARE_FOR_RENAME) at /data/src/10.4/sql/sql_base.cc:1424
      #11 0x000055b0a39ffc5e in mysql_alter_table (thd=0x62b00005b208, new_db=0x62b00005fa10, new_name=0x62b00005fe68, create_info=0x7f6fec151250, table_list=0x62b000062328, recreate_info=0x7f6fec1510b0, alter_info=0x7f6fec151150, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10643
      #12 0x000055b0a3b8550e in Sql_cmd_alter_table::execute (this=0x62b000062a30, thd=0x62b00005b208) at /data/src/10.4/sql/sql_alter.cc:531
      #13 0x000055b0a378f235 in mysql_execute_command (thd=0x62b00005b208) at /data/src/10.4/sql/sql_parse.cc:6216
      #14 0x000055b0a379aa37 in mysql_parse (thd=0x62b00005b208, rawbuf=0x62b000062228 "ALTER TABLE t1 FORCE", length=20, parser_state=0x7f6fec153860, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8008
      #15 0x000055b0a3770d7a in dispatch_command (command=COM_QUERY, thd=0x62b00005b208, packet=0x629001766209 "", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #16 0x000055b0a376d8f3 in do_command (thd=0x62b00005b208) at /data/src/10.4/sql/sql_parse.cc:1378
      #17 0x000055b0a3b6c89a in do_handle_one_connection (connect=0x6080000009a8) at /data/src/10.4/sql/sql_connect.cc:1420
      #18 0x000055b0a3b6c1b1 in handle_one_connection (arg=0x6080000009a8) at /data/src/10.4/sql/sql_connect.cc:1324
      #19 0x000055b0a47d8b84 in pfs_spawn_thread (arg=0x615000003508) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #20 0x00007f6ff3ea7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #21 0x00007f6ff3f285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Reproducible with at least MyISAM, Aria and InnoDB. With InnoDB the stack trace is a bit different (see below), and reproducing may take longer, I don't have sufficient statistical data for that.

      10.4 956d6c4a with InnoDB

      #3  <signal handler called>
      #4  0x0000556e14d9ebbb in ha_innobase::store_lock (this=0x61d0004416a8, thd=0x62b00009a208, to=0x62b0000a2618, lock_type=TL_IGNORE) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:16523
      #5  0x0000556e14ba4eab in ha_partition::store_lock (this=0x61d00043f8a8, thd=0x62b00009a208, to=0x62b0000a2618, lock_type=TL_IGNORE) at /data/src/10.4/sql/ha_partition.cc:4129
      #6  0x0000556e146d5152 in get_lock_data (thd=0x62b00009a208, table_ptr=0x7f468b187010, count=1, flags=2) at /data/src/10.4/sql/lock.cc:794
      #7  0x0000556e146d36c8 in mysql_lock_abort_for_thread (thd=0x62b00009a208, table=0x62000005b088) at /data/src/10.4/sql/lock.cc:617
      #8  0x0000556e13af13e2 in THD::notify_shared_lock (this=0x62b00009a208, ctx_in_use=0x62b0000d92e0, needs_thr_lock_abort=true) at /data/src/10.4/sql/sql_class.cc:2039
      #9  0x0000556e1402bfbc in MDL_lock::notify_conflicting_locks (this=0x6160000744a8, ctx=0x62b00009a350) at /data/src/10.4/sql/mdl.cc:612
      #10 0x0000556e14025c7b in MDL_context::acquire_lock (this=0x62b00009a350, mdl_request=0x7f468b187470, lock_wait_timeout=1) at /data/src/10.4/sql/mdl.cc:2343
      #11 0x0000556e14027553 in MDL_context::upgrade_shared_lock (this=0x62b00009a350, mdl_ticket=0x6060001af000, new_type=MDL_EXCLUSIVE, lock_wait_timeout=1) at /data/src/10.4/sql/mdl.cc:2579
      #12 0x0000556e13e7fa09 in mysql_inplace_alter_table (thd=0x62b00009a208, table_list=0x62b0000a1328, table=0x620000062088, altered_table=0x7f468b18a150, ha_alter_info=0x7f468b1883e0, target_mdl_request=0x7f468b188600, alter_ctx=0x7f468b189660) at /data/src/10.4/sql/sql_table.cc:7827
      #13 0x0000556e13e92a99 in mysql_alter_table (thd=0x62b00009a208, new_db=0x62b00009ea10, new_name=0x62b00009ee68, create_info=0x7f468b18b250, table_list=0x62b0000a1328, recreate_info=0x7f468b18b0b0, alter_info=0x7f468b18b150, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10451
      #14 0x0000556e1401950e in Sql_cmd_alter_table::execute (this=0x62b0000a1a30, thd=0x62b00009a208) at /data/src/10.4/sql/sql_alter.cc:531
      #15 0x0000556e13c23235 in mysql_execute_command (thd=0x62b00009a208) at /data/src/10.4/sql/sql_parse.cc:6216
      #16 0x0000556e13c2ea37 in mysql_parse (thd=0x62b00009a208, rawbuf=0x62b0000a1228 "ALTER TABLE t1 FORCE", length=20, parser_state=0x7f468b18d860, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8008
      #17 0x0000556e13c04d7a in dispatch_command (command=COM_QUERY, thd=0x62b00009a208, packet=0x62900087a209 "ALTER TABLE t1 FORCE", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #18 0x0000556e13c018f3 in do_command (thd=0x62b00009a208) at /data/src/10.4/sql/sql_parse.cc:1378
      #19 0x0000556e1400089a in do_handle_one_connection (connect=0x608000000ba8) at /data/src/10.4/sql/sql_connect.cc:1420
      #20 0x0000556e140001b1 in handle_one_connection (arg=0x608000000ba8) at /data/src/10.4/sql/sql_connect.cc:1324
      #21 0x0000556e14c6cb84 in pfs_spawn_thread (arg=0x615000006208) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #22 0x00007f469fea7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #23 0x00007f469ff285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            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.