Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-2193

LP #1619622: Multi-threaded slave leaks worker threads in case of thread create failure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      **Reported in Launchpad by Laurynas Biveinis last update 24-03-2017 10:09:46

      On PS 5.6 trunk, at the end of

      rpl.rpl_mts_debug 'mix' w3 [ pass ] 4967

      PROCESSLIST shows a stale SQL worker thread that is stopped by nobody. The testcase reduces to

      --source include/not_gtid_enabled.inc
      --source include/master-slave.inc
      --source include/have_debug.inc
      --source include/have_innodb.inc

      #

      1. Bug#12964649 MTS memory not released
        #
      2. Originally reported when opt_slave_checkpoint_group is set to be greater
      3. than sizeof(BLOB) * 8 - 1 Workers initialization code fails.
      4. VALID_RANGE() for opt_slave_checkpoint_group is fixed in bug12979420.
      5. The current bug test simulates a failure to start by a Worker
      6. thread, checks the error, and verifies that all memory is released
      7. (valgrind proves, the user can watch top report).
        #

      connection slave;

      call mtr.add_suppression('Error reading slave worker configuration');
      call mtr.add_suppression('Failed during slave workers initialization');
      call mtr.add_suppression('Failed during slave worker thread create');

      source include/stop_slave.inc;
      set @save.slave_checkpoint_group= @@global.slave_checkpoint_group;
      set @save.slave_parallel_workers= @@global.slave_parallel_workers;

      1. The following assignment can work only with debug builds.
      2. It sets opt_slave_checkpoint_group to one more to its VALID_RANGE() maximum.
      3. set @@global.slave_checkpoint_group= 524280 + 1;

      set @save.debug= @@global.debug;
      SET @@global.debug= "d,mts_worker_thread_fails";
      set @@global.slave_parallel_workers= 2;

      start slave sql_thread;
      --let $slave_sql_errno= 1593
      source include/wait_for_slave_sql_error.inc;

      set @@global.slave_checkpoint_group= @save.slave_checkpoint_group;
      set @@global.slave_parallel_workers= @save.slave_parallel_workers;
      set @@global.debug= @save.debug;

      source include/start_slave.inc;

      --source include/rpl_end.inc

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist