Skip to content
  • Alfranio Correia's avatar
    58c1b836
    BUG#11765887 BUG#58897 Rpl_info_table::do_is_transactional causes too much overhead · 58c1b836
    Alfranio Correia authored
    After WL#2775, Slave's information,i.e. IO Thread and SQL Thread's information, can be
    stored into different types of repositories. The current implementation provides two
    repositories, i.e. FILE or TABLE, and any type of engine can be used.
          
    However, only transactional engines, such as Innodb, can provide a crash-safe behavior
    in the sense that a slave can continue operating after a crash without requiring any
    manual-intervention.
          
    If a transactional table is in use, a different execution path is called to provide a
    crash-safe behavior. Testing if a transactional engine is in use, unfortunately,
    requires to open and close the table, slave_relay_log_info, and this has a negative
    impact on performance.
          
    To fix this, we have cached the type of the repository in use, transactional or
    non-transactional, while starting the slave. This is done by introducing a member
    variable into the Rpl_info class.
    
    Changing the engine in use while the slave is running is not recommend and most likely
    will cause inconsistency issues. We do nothing in this patch to prevent such changes.
    In the future, however, we are going to check if the replication is stopped before
    allowing to change the engine in use or the table's structure in general, although
    the latter operations can apparently lead to fail-safe scenarios.
    
    We also have implemented the following changes:
    
      . Refactored Rpl_info_factory and removed unnecessary code.
    
       . Allowed to dynamically change the type of the repository, FILE or TABLE,
        without requiring to restart the serve. However, replication must be stopped.
    
      . Alerted when a configuration is not crash-safe.
    58c1b836
    BUG#11765887 BUG#58897 Rpl_info_table::do_is_transactional causes too much overhead
    Alfranio Correia authored
    After WL#2775, Slave's information,i.e. IO Thread and SQL Thread's information, can be
    stored into different types of repositories. The current implementation provides two
    repositories, i.e. FILE or TABLE, and any type of engine can be used.
          
    However, only transactional engines, such as Innodb, can provide a crash-safe behavior
    in the sense that a slave can continue operating after a crash without requiring any
    manual-intervention.
          
    If a transactional table is in use, a different execution path is called to provide a
    crash-safe behavior. Testing if a transactional engine is in use, unfortunately,
    requires to open and close the table, slave_relay_log_info, and this has a negative
    impact on performance.
          
    To fix this, we have cached the type of the repository in use, transactional or
    non-transactional, while starting the slave. This is done by introducing a member
    variable into the Rpl_info class.
    
    Changing the engine in use while the slave is running is not recommend and most likely
    will cause inconsistency issues. We do nothing in this patch to prevent such changes.
    In the future, however, we are going to check if the replication is stopped before
    allowing to change the engine in use or the table's structure in general, although
    the latter operations can apparently lead to fail-safe scenarios.
    
    We also have implemented the following changes:
    
      . Refactored Rpl_info_factory and removed unnecessary code.
    
       . Allowed to dynamically change the type of the repository, FILE or TABLE,
        without requiring to restart the serve. However, replication must be stopped.
    
      . Alerted when a configuration is not crash-safe.
Loading