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

Assertion !thd->rgi_slave failed on ANALYZE TABLE on replica

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Development, Q1/2026 Server Maintenance

    Description

      --source include/have_binlog_format_mixed.inc
      --source include/master-slave.inc
      CREATE GLOBAL TEMPORARY TABLE t (x INT,t TEXT);
      CREATE TEMPORARY TABLE t (id INT);
      SET STATEMENT use_stat_tables=never FOR ANALYZE TABLE t;
      # Cleanup (not finalized)
      DROP TABLE t;
      DROP TABLE t;
      --source include/rpl_end.inc
      

      Leads to (on the replica):

      MDEV-35915-8 CS 12.2.0 c7ea08421d34fa7d45e27919a869ade968bd88c4 (Debug, Clang 21.1.3-20250923) Build 20/10/2025, Replica

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc:6244: my_bool open_global_temporary_table(THD *, TABLE_SHARE *, TABLE_LIST *, MDL_ticket *): Assertion `!thd->rgi_slave' failed.
      

      MDEV-35915-8 CS 12.2.0 c7ea08421d34fa7d45e27919a869ade968bd88c4 (Debug, Clang 21.1.3-20250923) Build 20/10/2025, Replica

      Core was generated by `/test/MDEV-35915_8_MD201025-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --defa'.
      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 1148718)]
      (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  0x000076969724526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007696972288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000076969722881b in __assert_fail_base (fmt=0x7696973d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55a57c24db1e "!thd->rgi_slave", file=file@entry=0x55a57c186e7a "/test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc", line=line@entry=6244, function=function@entry=0x55a57c215763 "my_bool open_global_temporary_table(THD *, TABLE_SHARE *, TABLE_LIST *, MDL_ticket *)") at ./assert/assert.c:94
      #6  0x000076969723b507 in __assert_fail (assertion=0x55a57c24db1e "!thd->rgi_slave", file=0x55a57c186e7a "/test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc", line=6244, function=0x55a57c215763 "my_bool open_global_temporary_table(THD *, TABLE_SHARE *, TABLE_LIST *, MDL_ticket *)") at ./assert/assert.c:103
      #7  0x000055a57cf73d1b in open_global_temporary_table (thd=0x76958c001b18, source=0x76958c051a40, out_table=0x76958c00ffa8, mdl_ticket=0x7695a400fa60)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc:6244
      #8  0x000055a57ccef269 in open_table (thd=0x76958c001b18, table_list=0x76958c00ffa8, ot_ctx=0x769694f195d8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:2351
      #9  0x000055a57ccf42d1 in open_and_process_table (thd=0x76958c001b18, tables=0x76958c00ffa8, counter=0x769694f1968c, flags=0, prelocking_strategy=0x769694f196f0, has_prelocking_list=false, ot_ctx=0x769694f195d8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:4308
      #10 0x000055a57ccf311b in open_tables (thd=0x76958c001b18, options=@0x76958c0074f4: {m_options = DDL_options_st::OPT_NONE}, start=0x769694f196a0, counter=0x769694f1968c, flags=0, prelocking_strategy=0x769694f196f0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:4791
      #11 0x000055a57ccf5eca in open_and_lock_tables (thd=0x76958c001b18, options=@0x76958c0074f4: {m_options = DDL_options_st::OPT_NONE}, tables=0x76958c00ffa8, derived=true, flags=0, prelocking_strategy=0x769694f196f0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:5779
      #12 0x000055a57cb7853e in open_and_lock_tables (thd=0x76958c001b18, tables=0x76958c00ffa8, derived=true, flags=0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.h:544
      #13 0x000055a57d0583ed in open_only_one_table (thd=0x76958c001b18, table=0x76958c00ffa8, repair_table_use_frm=false, is_view_operator_func=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_admin.cc:436
      #14 0x000055a57d053934 in mysql_admin_table (thd=0x76958c001b18, tables=0x76958c00ffa8, check_opt=0x76958c007290, operator_name=0x55a57dbf1f88 <msg_analyze>, lock_type=TL_READ_NO_INSERT, org_open_for_modify=true, no_errors_from_open=false, extra_open_options=0, prepare_func=0x0, operator_func=(int (handler::*)(class handler * const, class THD *, HA_CHECK_OPT *)) 0x55a57ca0fa60 <handler::ha_analyze(THD*, st_ha_check_opt*)>, view_operator_func=0x0, is_cmd_replicated=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_admin.cc:653
      #15 0x000055a57d0570e6 in Sql_cmd_analyze_table::execute (this=0x76958c0106e0, thd=0x76958c001b18)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_admin.cc:1659
      #16 0x000055a57ce572ae in mysql_execute_command (thd=0x76958c001b18, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:5862
      #17 0x000055a57ce48538 in mysql_parse (thd=0x76958c001b18, rawbuf=0x76958c038083 "SET STATEMENT use_stat_tables=never FOR ANALYZE TABLE t", length=55, parser_state=0x769694f1c760)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:7895
      #18 0x000055a57cb61709 in Query_log_event::do_apply_event (this=0x76958c034b98, rgi=0x76958c000cf0, query_arg=0x76958c038083 "SET STATEMENT use_stat_tables=never FOR ANALYZE TABLE t", q_len_arg=55)at /test/bb-12.2-nikita-global-tmp_dbg/sql/log_event_server.cc:2090
      #19 0x000055a57cb60727 in Query_log_event::do_apply_event (this=0x76958c034b98, rgi=0x76958c000cf0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/log_event_server.cc:1515
      #20 0x000055a57cb866a2 in Log_event::apply_event (this=0x76958c034b98, rgi=0x76958c000cf0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/log_event.cc:3984
      #21 0x000055a57cc6f59b in apply_event_and_update_pos_apply (ev=0x76958c034b98, thd=0x76958c001b18, rgi=0x76958c000cf0, reason=0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/slave.cc:3615
      #22 0x000055a57cc6f3cc in apply_event_and_update_pos (ev=0x76958c034b98, thd=0x76958c001b18, rgi=0x76958c000cf0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/slave.cc:3791
      #23 0x000055a57cc784e6 in exec_relay_log_event (thd=0x76958c001b18, rli=0x55a580a13f40, serial_rgi=0x76958c000cf0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/slave.cc:4233
      #24 0x000055a57cc6b357 in handle_slave_sql (arg=0x55a580a11e70)at /test/bb-12.2-nikita-global-tmp_dbg/sql/slave.cc:5465
      #25 0x000076969729ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x0000769697329c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              Roel Roel Van de Paar
              Roel Roel Van de Paar
              Nikita Malyavin Nikita Malyavin
              Michael Widenius Michael Widenius
              Roel Van de Paar Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.