summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index c6c0de7160b..33f27064aab 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4968,6 +4968,7 @@ void rotate_relay_log(MASTER_INFO* mi)
/* We don't lock rli->run_lock. This would lead to deadlocks. */
pthread_mutex_lock(&mi->run_lock);
+ pthread_mutex_lock(&mi->data_lock);
/*
We need to test inited because otherwise, new_file() will attempt to lock
@@ -4997,6 +4998,7 @@ void rotate_relay_log(MASTER_INFO* mi)
*/
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
end:
+ pthread_mutex_unlock(&mi->data_lock);
pthread_mutex_unlock(&mi->run_lock);
DBUG_VOID_RETURN;
}