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

Calling rli->close_temporary_tables() in start_log_event::do_apply_event can cause debug assert, for multi source replication in the case of temp tables.

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6
    • 10.6
    • Replication
    • None

    Description

      For example Slave S is replicating from master M1 and M2 , It has opened some temp tables and doing some processing on it from M1 relay log. In the mean time handle_slave_sql executes a Format_desc_log_event/start_log_event from M2 it calls

      int Start_log_event_v3::do_apply_event(rpl_group_info *rgi)
      {
        DBUG_ENTER("Start_log_event_v3::do_apply_event");
        int error= 0;
        Relay_log_info *rli= rgi->rli;
       
        switch (binlog_version)
        {
        case 3:
        case 4:
          /*
            This can either be 4.x (then a Start_log_event_v3 is only at master
            startup so we are sure the master has restarted and cleared his temp
            tables; the event always has 'created'>0) or 5.0 (then we have to test
            'created').
          */
          if (created)
          {
            rli->close_temporary_tables();
      
      

      rli->close_temporary_tables which changes the value of slave_open_temp_tables to zero , calling the events execution from M1 to fail on debug assert.

      Thread pointer: 0x7fe6281037a8
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7fe6267d2cc0 thread_stack 0x49000
      /home/sachin/alter_enterprise/sql/mariadbd(my_print_stacktrace+0x40)[0x556eba37e30d]
      /home/sachin/alter_enterprise/sql/mariadbd(handle_fatal_signal+0x425)[0x556eb9b113d8]
      sigaction.c:0(__restore_rt)[0x7fe64bc19870]
      :0(__GI_raise)[0x7fe64b6f8d22]
      :0(__GI_abort)[0x7fe64b6e2862]
      loadmsgcat.c:0(_nl_load_domain.cold)[0x7fe64b6e2747]
      :0(__GI___assert_fail)[0x7fe64b6f1616]
      /home/sachin/alter_enterprise/sql/mariadbd(_ZN3THD21close_temporary_tableEP5TABLE+0x182)[0x556eb9a391b4]
      /home/sachin/alter_enterprise/sql/mariadbd(_ZN3THD20free_temporary_tableEP5TABLE+0x67)[0x556eb9a39d23]
      /home/sachin/alter_enterprise/sql/mariadbd(_ZN3THD20drop_temporary_tableEP5TABLEPbb+0x226)[0x556eb9a37930]
      /home/sachin/alter_enterprise/sql/mariadbd(_Z23mysql_rm_table_no_locksP3THDP10TABLE_LISTPK25st_mysql_const_lex_stringP16st_ddl_log_statebbbbbb+0x7c4)[0x556eb986dad2]
      /home/sachin/alter_enterprise/sql/mariadbd(_Z14mysql_rm_tableP3THDP10TABLE_LISTbbbb+0x3b5)[0x556eb986d127]
      sql/temporary_tables.cc:1246(THD::close_temporary_table(TABLE*))[0x556eb9781625]
      sql/sql_table.cc:1322(mysql_rm_table_no_locks(THD*, TABLE_LIST*, st_mysql_const_lex_string const*, st_ddl_log_state*, bool, bool, bool, bool, bool, bool))[0x556eb978bba5]
      sql/sql_table.cc:1068(mysql_rm_table(THD*, TABLE_LIST*, bool, bool, bool, bool))[0x556eb9c869e5]
      sql/sql_parse.cc:4964(mysql_execute_command(THD*, bool))[0x556eb9c85227]
      sql/log_event_server.cc:2109(Query_log_event::do_apply_event(rpl_group_info*, char const*, unsigned int))[0x556eb9674254]
      sql/log_event.h:1527(Log_event::apply_event(rpl_group_info*))[0x556eb9666138]
      sql/slave.cc:3881(apply_event_and_update_pos_apply(Log_event*, THD*, rpl_group_info*, int))[0x556eb96669b2]
      sql/rpl_parallel.cc:62(rpt_handle_event(rpl_parallel_thread::queued_event*, rpl_parallel_thread*))[0x556eb99d139a]
      sql/rpl_parallel.cc:1378(handle_rpl_parallel_thread)[0x556eb99d4bc9]
      pthread_create.c:0(start_thread)[0x7fe64bc0f259]
      :0(__GI___clone)[0x7fe64b7ba5e3]
      

      Attachments

        Activity

          People

            Elkin Andrei Elkin
            sachin.setiya.007 Sachin Setiya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.