Skip to content
  • Kapil Agrawal's avatar
    784f4991
    Bug#29915479 RUNNING COM_REGISTER_SLAVE WITHOUT COM_BINLOG_DUMP · 784f4991
    Kapil Agrawal authored
                 CAN RESULTS IN SERVER EXIT
    
    Problem & Analysis
    ==================
    
    When slave sends COM_REGISTER_SLAVE, then slave information is stored
    in slave_list on master.Slave information in list holds the reference
    of dump thread's THD.
    
    Slave is unregistered on master after completing a binlog dump (i.e
    after serving COM_BINLOG_DUMP) by calling unregister_slave().
    
    When slave calls COM_REGISTER_SLAVE and gets disconnected. While going
    down it sends COM_QUIT to the master. COM_QUIT causes the master dump
    thread to go down. But it does not unregister the slave on master,
    which leaves slave_list at master in an inconsistent state.
    
    SHOW SLAVE HOSTS access slave_list to get the slave information.
    Accessing invalid memory related to THD stored in slave list results
    in server abnormal exits.
    
    Fix
    ===
    The fix for the above problem is to remove the references of the THD
    pointer from the slave_list when the thread is shutting down. This is
    done by calling unregister_slave() from THD::~THD() function.
    
    Patch backports mutex_lock guards to 5.6 from 5.7.
    
    RB#23245
    784f4991
    Bug#29915479 RUNNING COM_REGISTER_SLAVE WITHOUT COM_BINLOG_DUMP
    Kapil Agrawal authored
                 CAN RESULTS IN SERVER EXIT
    
    Problem & Analysis
    ==================
    
    When slave sends COM_REGISTER_SLAVE, then slave information is stored
    in slave_list on master.Slave information in list holds the reference
    of dump thread's THD.
    
    Slave is unregistered on master after completing a binlog dump (i.e
    after serving COM_BINLOG_DUMP) by calling unregister_slave().
    
    When slave calls COM_REGISTER_SLAVE and gets disconnected. While going
    down it sends COM_QUIT to the master. COM_QUIT causes the master dump
    thread to go down. But it does not unregister the slave on master,
    which leaves slave_list at master in an inconsistent state.
    
    SHOW SLAVE HOSTS access slave_list to get the slave information.
    Accessing invalid memory related to THD stored in slave list results
    in server abnormal exits.
    
    Fix
    ===
    The fix for the above problem is to remove the references of the THD
    pointer from the slave_list when the thread is shutting down. This is
    done by calling unregister_slave() from THD::~THD() function.
    
    Patch backports mutex_lock guards to 5.6 from 5.7.
    
    RB#23245
Loading