Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-958

If slave is not started after CHANGE MASTER, then Master_log_file is lost when maxscale restarts

    XMLWordPrintable

Details

    Description

      If the binlog router's slave is not started after executing CHANGE MASTER, then the configured value of Master_log_file is lost if the maxscale service is restarted.

      To reproduce, let's say that I have the following MaxScale configuration file:

      [maxscale]
      threads=4
      log_debug=1
      log_trace=1
       
      [Replication]
      type=service
      router=binlogrouter
      version_string=10.0.25-log
      user=repl
      passwd=password
      router_options=server_id=2,binlogdir=/var/log/binlogs
       
      [Replication Listener]
      type=listener
      service=Replication
      protocol=MySQLClient
      port=3306
      

      When I start MaxScale up with this configuration file, I log into the replication listener, and I execute CHANGE MASTER in the following way:

      $ mysql -u repl -ppassword -h 127.0.0.1
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MySQL connection id is 1657
      Server version: 10.0.25-log
       
      Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MySQL [(none)]> CHANGE MASTER TO Master_host='172.31.32.144', Master_log_file='mariadb.000026', Master_user='repl', Master_password='password';
      Query OK, 0 rows affected (0.00 sec)
      

      Note that I did not execute START SLAVE.

      Now let's say that I restart MaxScale without starting the slave first:

      service maxscale restart
      

      At this point, Master_log_file will be reset to mariadb.000001 according to the log:

      2016-10-27 12:10:41   notice : Validating binlog file 'mariadb.000001' ...
      2016-10-27 12:10:41   info   : Current binlog file is mariadb.000001, current pos is 4
      

      And if this older binlog file doesn't exist on the master, then MaxScale will fail:

      2016-10-27 12:18:30   error  : Error packet in binlog stream.mariadb.000001 @ 4.
      2016-10-27 12:18:30   error  : Replication: Master connection error 1236 'Could not find first log file name in binary log index file' in state 'Slave stopped', attempting reconnect to master 172.31.32.144:3306
      2016-10-27 12:18:30   notice : Replication: Master 172.31.32.144 disconnected after 0 seconds. 1 events read.
      

      Attachments

        Activity

          People

            Massimiliano Pinto Massimiliano Pinto (Inactive)
            GeoffMontee Geoff Montee (Inactive)
            Votes:
            2 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.