Skip to content
  • aelkin@dl145h.mysql.com's avatar
    7602b78a
    Bug#20435 Relay logs are rotated at slave_net_timeout when there's no activity; WL#342 heartbeat · 7602b78a
    aelkin@dl145h.mysql.com authored
    When receiving no events from its master longer than slave_net_timeout
    slave's replication io thread disconnects and reconnects. Reconnecting
    causes rotation of the relay log. That is unnecessary work which also
    causes inconvenience because of changes of the relay log files names:
    old files are removed, new are created.
      
      Fixed with introducing the Heartbeat event new functionality.
      Heartbeat event is generated in master's idle time by dump thread.
      Frequency of sending the event is optional and is determined by slave.
      The optimal value is within [0.001, slave_net_timeout] interval.
      
      The project introduces master_heartbeat_period option for CHANGE
      MASTER sql clause.  The requested on the slave side value for the
      period is passed to the dump thread on the master side.  The dump
      thread sends a heartbeat replication event if there is no more
      unsent events in the actual binlog file for a period longer that
      master_heartbeat_period.  Whenever the master's binlog is updated
      with an event, the waiting for heartbeat sending condition gets
      reset.
      
      Heartbeating is requested implicitly with the period
      slave_net_timeout/2 when no master_heartbeat_option was
      provided. if the option's value is set explicitly zero there will
      be no heartbeats.
      slave_net_timeout is updated now with generating a warning if the
      new value is less than the current heartbeat period.
    
      Two status variables on the slave side allows to monitor
      heartbeats flow.
      
      The test checks the syntax for the new option, the valid range -
      errors and warnings on reasonable values; the fact that there is no
      relay log rotation (thereafter no reconnection) while more than
      slave_net_timeout seconds elapsed and the master has been idling;
      new status variables.
    7602b78a
    Bug#20435 Relay logs are rotated at slave_net_timeout when there's no activity; WL#342 heartbeat
    aelkin@dl145h.mysql.com authored
    When receiving no events from its master longer than slave_net_timeout
    slave's replication io thread disconnects and reconnects. Reconnecting
    causes rotation of the relay log. That is unnecessary work which also
    causes inconvenience because of changes of the relay log files names:
    old files are removed, new are created.
      
      Fixed with introducing the Heartbeat event new functionality.
      Heartbeat event is generated in master's idle time by dump thread.
      Frequency of sending the event is optional and is determined by slave.
      The optimal value is within [0.001, slave_net_timeout] interval.
      
      The project introduces master_heartbeat_period option for CHANGE
      MASTER sql clause.  The requested on the slave side value for the
      period is passed to the dump thread on the master side.  The dump
      thread sends a heartbeat replication event if there is no more
      unsent events in the actual binlog file for a period longer that
      master_heartbeat_period.  Whenever the master's binlog is updated
      with an event, the waiting for heartbeat sending condition gets
      reset.
      
      Heartbeating is requested implicitly with the period
      slave_net_timeout/2 when no master_heartbeat_option was
      provided. if the option's value is set explicitly zero there will
      be no heartbeats.
      slave_net_timeout is updated now with generating a warning if the
      new value is less than the current heartbeat period.
    
      Two status variables on the slave side allows to monitor
      heartbeats flow.
      
      The test checks the syntax for the new option, the valid range -
      errors and warnings on reasonable values; the fact that there is no
      relay log rotation (thereafter no reconnection) while more than
      slave_net_timeout seconds elapsed and the master has been idling;
      new status variables.
Loading