#At file:///home/acorreia/workspace.sun/repository.mysql.new/bzrwork/bug-55415/mysql-trunk-bugfixing.merge/ based on revid:marc.alff@stripped
3268 Alfranio Correia 2010-09-17 [merge]
merge mysql-5.5-bugfixing --> mysql-trunk-bugfixing
Conflicts:
sql/log.cc
sql/log.h
sql/sql_repl.cc
modified:
sql/binlog.cc
sql/binlog.h
sql/rpl_master.cc
=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc 2010-08-20 03:37:42 +0000
+++ b/sql/binlog.cc 2010-09-17 12:31:54 +0000
@@ -3539,11 +3539,8 @@ int MYSQL_BIN_LOG::wait_for_update_bin_l
const struct timespec *timeout)
{
int ret= 0;
- const char* old_msg = thd->proc_info;
DBUG_ENTER("wait_for_update_bin_log");
- old_msg= thd->enter_cond(&update_cond, &LOCK_log,
- "Master has sent all binlog to slave; "
- "waiting for binlog to be updated");
+
if (!timeout)
mysql_cond_wait(&update_cond, &LOCK_log);
else
=== modified file 'sql/binlog.h'
--- a/sql/binlog.h 2010-08-26 14:29:22 +0000
+++ b/sql/binlog.h 2010-09-17 12:31:54 +0000
@@ -228,6 +228,7 @@ public:
inline char* get_log_fname() { return log_file_name; }
inline char* get_name() { return name; }
inline mysql_mutex_t* get_log_lock() { return &LOCK_log; }
+ inline mysql_cond_t* get_log_cond() { return &update_cond; }
inline IO_CACHE* get_log_file() { return &log_file; }
inline void lock_index() { mysql_mutex_lock(&LOCK_index);}
=== modified file 'sql/rpl_master.cc'
--- a/sql/rpl_master.cc 2010-07-29 11:30:51 +0000
+++ b/sql/rpl_master.cc 2010-09-17 12:31:54 +0000
@@ -511,6 +511,7 @@ void mysql_binlog_send(THD* thd, char* l
const char *errmsg = "Unknown error";
NET* net = &thd->net;
mysql_mutex_t *log_lock;
+ mysql_cond_t *log_cond;
bool binlog_can_be_corrupted= FALSE;
#ifndef DBUG_OFF
int left_events = max_binlog_dump_events;
@@ -654,7 +655,8 @@ impossible position";
mysql_bin_log, and it's already inited, and it will be destroyed
only at shutdown).
*/
- log_lock = mysql_bin_log.get_log_lock();
+ log_lock= mysql_bin_log.get_log_lock();
+ log_cond= mysql_bin_log.get_log_cond();
if (pos > BIN_LOG_HEADER_SIZE)
{
/* reset transmit packet for the event read from binary log
@@ -889,6 +891,7 @@ impossible position";
#ifndef DBUG_OFF
ulong hb_info_counter= 0;
#endif
+ const char* old_msg= thd->proc_info;
signal_cnt= mysql_bin_log.signal_cnt;
do
{
@@ -897,6 +900,9 @@ impossible position";
DBUG_ASSERT(heartbeat_ts && heartbeat_period != 0);
set_timespec_nsec(*heartbeat_ts, heartbeat_period);
}
+ thd->enter_cond(log_cond, log_lock,
+ "Master has sent all binlog to slave; "
+ "waiting for binlog to be updated");
ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts);
DBUG_ASSERT(ret == 0 || (heartbeat_period != 0 && coord != NULL));
if (ret == ETIMEDOUT || ret == ETIME)
@@ -912,12 +918,15 @@ impossible position";
#endif
/* reset transmit packet for the heartbeat event */
if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
+ {
+ thd->exit_cond(old_msg);
goto err;
+ }
if (send_heartbeat_event(net, packet, coord))
{
errmsg = "Failed on my_net_write()";
my_errno= ER_UNKNOWN_ERROR;
- mysql_mutex_unlock(log_lock);
+ thd->exit_cond(old_msg);
goto err;
}
}
@@ -926,7 +935,7 @@ impossible position";
DBUG_PRINT("wait",("binary log received update or a broadcast signal caught"));
}
} while (signal_cnt == mysql_bin_log.signal_cnt && !thd->killed);
- mysql_mutex_unlock(log_lock);
+ thd->exit_cond(old_msg);
}
break;
Attachment: [text/bzr-bundle] bzr/alfranio.correia@oracle.com-20100917123154-38vu32t03rnfxj75.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk-bugfixing branch (alfranio.correia:3268) | Alfranio Correia | 17 Sep |