• unknown's avatar
    BUG#25306 (Race conditions during replication slave shutdown (valgrind stacks)): · d51d6adc
    unknown authored
    The possibility of the race is removed by changing sequence of calls
    
      pthread_mutex_unlock(&mi->run_lock);
      pthread_cond_broadcast(&mi->stop_cond);  
    
    into
    
      pthread_cond_broadcast(&mi->stop_cond);
      pthread_mutex_unlock(&mi->run_lock);
    
    at the end of I/O thread (similar change at the end of SQL thread). This ensures 
    that no thread waiting on the condition executes between the broadcast and the 
    unlock and thus can't delete the mi structure which caused the bug.
    
    
    sql/slave.cc:
      Change order of condition broadcast and mutex unlock at the end of slave's 
      I/O thread and SQL thread.
    sql/sql_repl.cc:
      Add DBUG_ENTER() call
    d51d6adc
sql_repl.cc 46.3 KB