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

Memory leak when START ALTER fails on slave

    XMLWordPrintable

Details

    Description

      If the (parallel) slave fails while applying START ALTER, a memory leak of
      the start_alter_info results. This is because the start_alter_info object is
      added into the mi->start_alter_list in write_bin_log_start_alter(), however
      if the START ALTER fails, this is not called.

      I will push a fix for this on my branch knielsen_start_alter on github.

      Test case:

      --source include/have_innodb.inc
      --source include/master-slave.inc
       
      --connection master
      CREATE TABLE t1 (a INT PRIMARY KEY);
       
      --sync_slave_with_master
      --source include/stop_slave.inc
      DROP TABLE t1;
      SET GLOBAL slave_parallel_threads = 5;
      --source include/start_slave.inc
       
      --connection master
      SET binlog_alter_two_phase = ON;
      ALTER TABLE t1 ADD COLUMN b INT DEFAULT NULL;
       
      --connection slave
      # 1146 = ER_NO_SUCH_TABLE
      --let $slave_sql_errno= 1146
      --source include/wait_for_slave_sql_error.inc
      CREATE TABLE t1 (a INT PRIMARY KEY);
      --source include/start_slave.inc
       
      --connection master
      DROP TABLE t1;
      --source include/rpl_end.inc
      

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            knielsen Kristian Nielsen
            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.