summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2010-05-24 17:43:27 +0100
committerLuis Soares <luis.soares@sun.com>2010-05-24 17:43:27 +0100
commitfc11d74d138f7ade1adf4131140281cefbc78ee8 (patch)
tree662309c6fb769c80aa4c7d772a701824b6edd56a /sql/slave.cc
parentf4e46c5ce1856cc92fb89712f50c1df712dedc5f (diff)
downloadmariadb-git-fc11d74d138f7ade1adf4131140281cefbc78ee8.tar.gz
BUG#53657: Slave crashed with error 22 when trying to lock mutex
at mf_iocache.c, line 1722 The slave crashed while two threads: IO thread and user thread raced for the same mutex (the append_buffer_lock protecting the relay log's IO_CACHE). The IO thread was trying to flush the cache, and for that was grabbing the append_buffer_lock. However, the other thread was closing and reopening the relay log when the IO thread tried to lock. Closing and reopening the log includes destroying and reinitialising the IO_CACHE mutex. Therefore, the IO thread tried to lock a destroyed mutex. We fix this by backporting patch for BUG#50364 which fixed this bug in mysql server 5.5+. The patch deploys missing synchronization when flush_master_info is called and the relay log is flushed by the IO thread. In detail the patch backports revision (from mysql-trunk): - luis.soares@sun.com-20100203165617-b1yydr0ee24ycpjm This patch already includes the post-push fix also in BUG#50364: - luis.soares@sun.com-20100222002629-0cijwqk6baxhj7gr
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 2e4642d179e..af53bc65c0e 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1480,7 +1480,7 @@ static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi)
" to the relay log, SHOW SLAVE STATUS may be"
" inaccurate");
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
- if (flush_master_info(mi, 1))
+ if (flush_master_info(mi, TRUE, TRUE))
sql_print_error("Failed to flush master info file");
delete ev;
}
@@ -2731,7 +2731,7 @@ Stopping slave I/O thread due to out-of-memory error from master");
"could not queue event from master");
goto err;
}
- if (flush_master_info(mi, 1))
+ if (flush_master_info(mi, TRUE, TRUE))
{
sql_print_error("Failed to flush master info file");
goto err;