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

InnoDB: Failing assertion: table->get_ref_count() == 0 in dict_sys_t::remove on DROP

Details

    Description

      Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-29507, MDEV-30337

      # MYEXTRA="--no-defaults --sql_mode="
      # REPL_EXTRA="--gtid_strict_mode=1 --relay-log=relaylog"  # used for both master & slave
      # MASTER_EXTRA="--log_bin=binlog --binlog_format=STATEMENT --log_bin_trust_function_creators=1 --server_id=1"
      # SLAVE_EXTRA="--slave-parallel-threads=11 --slave-parallel-mode=aggressive --slave-parallel-max-queued=1073741827 --slave_run_triggers_for_rbr=LOGGING --slave_skip_errors=ALL --server_id=2"
      CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
      XA START 'a';
      CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES ('a');
      INSERT IGNORE INTO t1 VALUES (@inserted_value);
      XA END 'a';
      XA ROLLBACK 'a';
      SET SESSION gtid_domain_id=102;
      

      Leads, very sporadically, to:

      10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)

      Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      [Current thread is 1 (LWP 2457798)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
      #6  0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
      #7  0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
      #8  0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
      #9  0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
      #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
      #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
      #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
      #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
      #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
      #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
      #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
      #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
      #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
      #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
      #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
      #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
      #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
      #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
      #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Note the crashing query from the stack:

      DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
      

      Is not directly part of the testcase.

      NTS: ~/MDEV-34049 | sc30985

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar created issue -
            Roel Roel Van de Paar made changes -
            Field Original Value New Value
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Assignee Roel Van de Paar [ roel ]
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, *MDEV-29507*, MDEV-30337

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below). Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, *MDEV-29507*, MDEV-30337

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, *MDEV-29507*, MDEV-30337

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, *MDEV-29507*, MDEV-30337

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Component/s XA [ 12400 ]
            Roel Roel Van de Paar made changes -
            Component/s XA [ 12400 ]
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, *MDEV-29507*, MDEV-30337

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337 and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337 and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            This query was *not* part of the testcase (ref below).
            Also note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            Sidenote: the testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            The {{XA ROLLBACK}} must be what is causing the {{DROP ...}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}

            Note the query mentioned:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Note the {{apply_event_and_update_pos_for_parallel}} frame (i.e. parallel slave stack).
            The issue was highly sporadic (1 occurrence in 200).

            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            The {{XA ROLLBACK}} must be what is causing the {{DROP ...}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue was highly sporadic (1 occurrence in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP ...}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue was highly sporadic (1 occurrence in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP ...}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP ...}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP ...}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Summary InnoDB: Failing assertion: table->get_ref_count() == 0 in dict_sys_t::remove InnoDB: Failing assertion: table->get_ref_count() == 0 in dict_sys_t::remove on DROP during XA ROLLBACK
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;#ERROR: 1050 - Table 't1' already exists
            XA START 'a';#NOERROR
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');#NOERROR
            INSERT IGNORE INTO t1 VALUES(@inserted_value);#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');
            INSERT IGNORE INTO t1 VALUES(@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');
            INSERT IGNORE INTO t1 VALUES(@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');
            INSERT IGNORE INTO t1 VALUES(@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            INSERT INTO t1 VALUES ('aa-'),('ab-'),('ac-'),('ad-'),('ae-'),('af-'),('az-');
            INSERT IGNORE INTO t1 VALUES(@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t (c1 INT) ENGINE=InnoDB;
            INSERT INTO t VALUES (1),(2),(3),(4),(5),(6),(7);
            INSERT IGNORE INTO t VALUES (@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=10;
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Labels sporadic
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507

            Today I saw on 10.6 (build 24 April 24):
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            The issue is highly sporadic (~1 or less occurrences in 200).

            The crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The testcase which was being reduced (for MDEV-34051) is:
            {code:sql}
            CREATE TABLE t (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t (c1 INT) ENGINE=InnoDB;
            INSERT INTO t VALUES (1),(2),(3),(4),(5),(6),(7);
            INSERT IGNORE INTO t VALUES (@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=10;
            {code}
            So the {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049 | sc30985
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;#NOERROR
            XA END 'a';#NOERROR
            XA ROLLBACK 'a';#NOERROR
            SET SESSION gtid_domain_id=102;#NOERROR
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            InnoDB: Failing assertion: table->get_ref_count() == 0
            {noformat}

            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug, Slave)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 571473)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x000014d8b823c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x000014d8b822287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x0000557c979e0902 in ut_dbg_assertion_failed (expr=expr@entry=0x557c98057fe1 "table->get_ref_count() == 0", file=file@entry=0x557c98058250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x0000557c97a93fab in dict_sys_t::remove (this=this@entry=0x557c98671980 <dict_sys>, table=0x14d848028388, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x0000557c977d6650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x0000557c9743e9c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x0000557c973a2c8b in THD::rm_temporary_table (this=<optimized out>, base=0x557c99212c18, path=0x14d848022420 "/dev/shm/1714631769225800000/subreducer/27/tmp_slave/#sql-temptable-8ac17-f-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x0000557c973a331e in THD::free_tmp_table_share (this=this@entry=0x14d84c000d58, share=share@entry=0x14d848021e08, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x0000557c973a4b50 in THD::drop_temporary_table (this=this@entry=0x14d84c000d58, table=<optimized out>, is_trans=is_trans@entry=0x14d8a0116be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x0000557c97238c9e in mysql_rm_table_no_locks (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, current_db=current_db@entry=0x14d84c000df8, ddl_log_state=0x14d8a0116c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x0000557c9723b50f in mysql_rm_table (thd=thd@entry=0x14d84c000d58, tables=tables@entry=0x14d84c00ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x0000557c9717d796 in mysql_execute_command (thd=thd@entry=0x14d84c000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x0000557c971820b4 in mysql_parse (thd=0x14d84c000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8a01178b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x0000557c975a6fe2 in Query_log_event::do_apply_event (this=0x14d868039d48, rgi=0x14d868030430, query_arg=0x14d868039eb3 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x0000557c975a791e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x0000557c970a34e5 in Log_event::apply_event (rgi=0x14d868030430, this=0x14d868039d48) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x0000557c970ad72c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x14d868039d48, thd=thd@entry=0x14d84c000d58, rgi=rgi@entry=0x14d868030430) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x0000557c9734d508 in rpt_handle_event (qev=qev@entry=0x14d86802ffd8, rpt=rpt@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x0000557c9735202b in handle_rpl_parallel_thread (arg=arg@entry=0x14d86800f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x0000557c97717f78 in pfs_spawn_thread (arg=0x14d868012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b828f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x000014d8b831dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            The {{XA ROLLBACK}} must be what is causing the {{DROP}} crashing query.

            NTS: ~/MDEV-34049 | sc30985
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Roel Roel Van de Paar made changes -
            Summary InnoDB: Failing assertion: table->get_ref_count() == 0 in dict_sys_t::remove on DROP during XA ROLLBACK InnoDB: Failing assertion: table->get_ref_count() == 0 in dict_sys_t::remove on DROP
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-30337, and especially MDEV-29507
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-29507, MDEV-30337
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-29507, MDEV-30337
            {code:sql}
            CREATE TEMPORARY TABLE t1 (c1 INT) Engine=InnoDB;
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-29507, MDEV-30337
            {code:sql}
            # MYEXTRA="--no-defaults --sql_mode="
            # MASTER_EXTRA="--log_bin=binlog --binlog_format=STATEMENT --log_bin_trust_function_creators=1 --server_id=1"
            # SLAVE_EXTRA="--slave-parallel-threads=11 --slave-parallel-mode=aggressive --slave-parallel-max-queued=1073741827 --slave_run_triggers_for_rbr=LOGGING --slave_skip_errors=ALL --server_id=2"
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE=InnoDB;
            INSERT INTO t1 VALUES ('a');
            INSERT IGNORE INTO t1 VALUES (@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Assignee Roel Van de Paar [ roel ] Marko Mäkelä [ marko ]
            Roel Roel Van de Paar made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Component/s Data Definition - Temporary [ 10123 ]
            Assignee Marko Mäkelä [ marko ] Brandon Nesterenko [ JIRAUSER48702 ]
            Roel Roel Van de Paar made changes -
            Attachment MDEV-34049_binlog.txt [ 74151 ]
            Roel Roel Van de Paar made changes -
            Attachment MDEV-34049.tar.xz [ 74152 ]
            Roel Roel Van de Paar made changes -
            Description Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-29507, MDEV-30337
            {code:sql}
            # MYEXTRA="--no-defaults --sql_mode="
            # MASTER_EXTRA="--log_bin=binlog --binlog_format=STATEMENT --log_bin_trust_function_creators=1 --server_id=1"
            # SLAVE_EXTRA="--slave-parallel-threads=11 --slave-parallel-mode=aggressive --slave-parallel-max-queued=1073741827 --slave_run_triggers_for_rbr=LOGGING --slave_skip_errors=ALL --server_id=2"
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE=InnoDB;
            INSERT INTO t1 VALUES ('a');
            INSERT IGNORE INTO t1 VALUES (@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Possibly related: MDEV-25850, MDEV-26636, MDEV-29277, MDEV-29507, MDEV-30337
            {code:sql}
            # MYEXTRA="--no-defaults --sql_mode="
            # REPL_EXTRA="--gtid_strict_mode=1 --relay-log=relaylog" # used for both master & slave
            # MASTER_EXTRA="--log_bin=binlog --binlog_format=STATEMENT --log_bin_trust_function_creators=1 --server_id=1"
            # SLAVE_EXTRA="--slave-parallel-threads=11 --slave-parallel-mode=aggressive --slave-parallel-max-queued=1073741827 --slave_run_triggers_for_rbr=LOGGING --slave_skip_errors=ALL --server_id=2"
            CREATE TABLE t1 (a1 VARCHAR(1), a2 VARCHAR(1)) ENGINE=InnoDB;
            XA START 'a';
            CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE=InnoDB;
            INSERT INTO t1 VALUES ('a');
            INSERT IGNORE INTO t1 VALUES (@inserted_value);
            XA END 'a';
            XA ROLLBACK 'a';
            SET SESSION gtid_domain_id=102;
            {code}
            Leads, very sporadically, to:
            {noformat:title=10.6.18 0ccdf54b644352f42e1768bc660be7ab50c1e9d2 (Debug)}
            Core was generated by `/test/MD240424-mariadb-10.6.18-linux-x86_64-dbg/bin/mariadbd --no-defaults --ba'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2457798)]
            (gdb) bt
            #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3 0x00001508c683c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4 0x00001508c682287c in __GI_abort () at ./stdlib/abort.c:79
            #5 0x000055b283f69902 in ut_dbg_assertion_failed (expr=expr@entry=0x55b2845e0fe1 "table->get_ref_count() == 0", file=file@entry=0x55b2845e1250 "/test/10.6_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=1826)at /test/10.6_dbg/storage/innobase/ut/ut0dbg.cc:60
            #6 0x000055b28401cfab in dict_sys_t::remove (this=this@entry=0x55b284bfa980 <dict_sys>, table=0x150850021e38, lru=lru@entry=false, keep=keep@entry=false)at /test/10.6_dbg/storage/innobase/dict/dict0dict.cc:1826
            #7 0x000055b283d5f650 in ha_innobase::delete_table (this=<optimized out>, name=<optimized out>)at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13528
            #8 0x000055b2839c79c1 in hton_drop_table (hton=<optimized out>, path=<optimized out>) at /test/10.6_dbg/sql/handler.cc:573
            #9 0x000055b28392bc8b in THD::rm_temporary_table (this=<optimized out>, base=0x55b286f5cc18, path=0x150850020f70 "/dev/shm/1714686204629124488/subreducer/289/tmp_slave/#sql-temptable-25632b-c-0") at /test/10.6_dbg/sql/temporary_tables.cc:705
            #10 0x000055b28392c31e in THD::free_tmp_table_share (this=this@entry=0x150854000d58, share=share@entry=0x150850020958, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:1473
            #11 0x000055b28392db50 in THD::drop_temporary_table (this=this@entry=0x150854000d58, table=<optimized out>, is_trans=is_trans@entry=0x1508a1964be7, delete_table=delete_table@entry=true)at /test/10.6_dbg/sql/temporary_tables.cc:673
            #12 0x000055b2837c1c9e in mysql_rm_table_no_locks (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, current_db=current_db@entry=0x150854000df8, ddl_log_state=0x1508a1964c40, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=drop_temporary@entry=true, drop_view=false, drop_sequence=false, dont_log_query=false, dont_free_locks=false)at /test/10.6_dbg/sql/sql_table.cc:1321
            #13 0x000055b2837c450f in mysql_rm_table (thd=thd@entry=0x150854000d58, tables=tables@entry=0x15085400ae78, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false)at /test/10.6_dbg/sql/sql_table.cc:1069
            #14 0x000055b283706796 in mysql_execute_command (thd=thd@entry=0x150854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/10.6_dbg/sql/sql_parse.cc:5030
            #15 0x000055b28370b0b4 in mysql_parse (thd=0x150854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1508a19658b0)at /test/10.6_dbg/sql/sql_parse.cc:8146
            #16 0x000055b283b2ffe2 in Query_log_event::do_apply_event (this=0x15086c037098, rgi=0x15086c02edc0, query_arg=0x15086c037203 "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`", q_len_arg=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:240
            #17 0x000055b283b3091e in Query_log_event::do_apply_event (this=<optimized out>, rgi=<optimized out>)at /test/10.6_dbg/sql/log_event_server.cc:1609
            #18 0x000055b28362c4e5 in Log_event::apply_event (rgi=0x15086c02edc0, this=0x15086c037098) at /test/10.6_dbg/sql/log_event.h:1509
            #19 apply_event_and_update_pos_apply (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0, reason=reason@entry=0) at /test/10.6_dbg/sql/slave.cc:3906
            #20 0x000055b28363672c in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x15086c037098, thd=thd@entry=0x150854000d58, rgi=rgi@entry=0x15086c02edc0) at /test/10.6_dbg/sql/slave.cc:4102
            #21 0x000055b2838d6508 in rpt_handle_event (qev=qev@entry=0x15086c02e968, rpt=rpt@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:64
            #22 0x000055b2838db02b in handle_rpl_parallel_thread (arg=arg@entry=0x15086c00f7c0) at /test/10.6_dbg/sql/rpl_parallel.cc:1525
            #23 0x000055b283ca0f78 in pfs_spawn_thread (arg=0x15086c012c38)at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x00001508c688f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #25 0x00001508c691dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            {noformat}
            Note the crashing query from the stack:
            {code:sql}
            DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`
            {code}
            Is not directly part of the testcase.

            NTS: ~/MDEV-34049 | sc30985
            Roel Roel Van de Paar made changes -
            Affects Version/s 11.7 [ 29815 ]
            Roel Roel Van de Paar made changes -
            Labels sporadic not-10.5 regression-10.6 sporadic
            Roel Roel Van de Paar made changes -
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.4 [ 29301 ]
            Fix Version/s 11.6 [ 29515 ]
            Affects Version/s 10.11 [ 27614 ]
            Affects Version/s 11.2 [ 28603 ]
            Affects Version/s 11.4 [ 29301 ]
            Affects Version/s 11.6 [ 29515 ]
            Roel Roel Van de Paar made changes -
            Attachment MDEV-34049_gdb_bt_all.txt [ 74172 ]
            Roel Roel Van de Paar made changes -
            Assignee Brandon Nesterenko [ JIRAUSER48702 ] Kristian Nielsen [ knielsen ]
            knielsen Kristian Nielsen made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            knielsen Kristian Nielsen made changes -
            Attachment mtr_testcase_mdev34049.patch [ 74178 ]
            Attachment mtr_testcase_mdev34049.test [ 74179 ]
            knielsen Kristian Nielsen made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            knielsen Kristian Nielsen made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            knielsen Kristian Nielsen made changes -
            Assignee Kristian Nielsen [ knielsen ] Brandon Nesterenko [ JIRAUSER48702 ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            bnestere Brandon Nesterenko made changes -
            Assignee Brandon Nesterenko [ JIRAUSER48702 ] Kristian Nielsen [ knielsen ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            knielsen Kristian Nielsen made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.6(EOL) [ 29515 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.2(EOL) [ 28603 ]
            knielsen Kristian Nielsen made changes -
            Fix Version/s 10.6.21 [ 29953 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.4 [ 29301 ]
            knielsen Kristian Nielsen made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            knielsen Kristian Nielsen made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.11.11 [ 29954 ]
            Fix Version/s 11.4.5 [ 29956 ]
            Fix Version/s 11.7.2 [ 29914 ]
            ParadoxV5 Jimmy Hú made changes -

            People

              knielsen Kristian Nielsen
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.