summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorPedro Gomes <pedro.gomes@oracle.com>2013-02-15 22:18:37 +0000
committerPedro Gomes <pedro.gomes@oracle.com>2013-02-15 22:18:37 +0000
commit552f1f4b86d387ce99cae4bbfd792606c97f825b (patch)
treec0584d4690d763c4e4d28ce67c668124f3b79e07 /sql/sql_repl.cc
parent49b29688bb2c8b87ec38963eba679349d28ea48c (diff)
parent80699f32c708801fba7180feff199938908e8a3b (diff)
downloadmariadb-git-552f1f4b86d387ce99cae4bbfd792606c97f825b.tar.gz
BUG#13545447: RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
Merge from mysql 5.1 to mysql 5.5
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 15d0d5c90d5..0eb6142090c 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -676,7 +676,10 @@ impossible position";
if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
goto err;
- while (!(error= Log_event::read_log_event(&log, packet, log_lock)))
+ bool is_active_binlog= false;
+ while (!(error= Log_event::read_log_event(&log, packet, log_lock,
+ log_file_name,
+ &is_active_binlog)))
{
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
@@ -757,6 +760,13 @@ impossible position";
goto err;
}
+ DBUG_EXECUTE_IF("wait_after_binlog_EOF",
+ {
+ const char act[]= "now wait_for signal.rotate_finished";
+ DBUG_ASSERT(!debug_sync_set_action(current_thd,
+ STRING_WITH_LEN(act)));
+ };);
+
/*
TODO: now that we are logging the offset, check to make sure
the recorded offset and the actual match.
@@ -767,8 +777,11 @@ impossible position";
if (test_for_non_eof_log_read_errors(error, &errmsg))
goto err;
- if (!(flags & BINLOG_DUMP_NON_BLOCK) &&
- mysql_bin_log.is_active(log_file_name))
+ /*
+ We should only move to the next binlog when the last read event
+ came from a already deactivated binlog.
+ */
+ if (!(flags & BINLOG_DUMP_NON_BLOCK) && is_active_binlog)
{
/*
Block until there is more data in the log