• Brandon Nesterenko's avatar
    MDEV-31177: SHOW SLAVE STATUS Last_SQL_Errno Race Condition on Errored Slave Restart · 1407f999
    Brandon Nesterenko authored
    The SQL thread and a user connection executing SHOW SLAVE STATUS
    have a race condition on Last_SQL_Errno, such that a slave which
    previously errored and stopped, on its next start, SHOW SLAVE STATUS
    can show that the SQL Thread is running while the previous error is
    also showing.
    
    The fix is to move when the last error is cleared when the SQL
    thread starts to occur before setting the status of
    Slave_SQL_Running.
    
    Thanks to Kristian Nielson for his work diagnosing the problem!
    
    Reviewed By:
    ============
    Andrei Elkin <andrei.elkin@mariadb.com>
    Kristian Nielson <knielsen@knielsen-hq.org>
    1407f999
slave.cc 287 KB