Below is the list of changes that have just been committed into a local
5.0 repository of sergeyv. When sergeyv does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2029 05/10/27 17:04:01 SergeyV@selena. +1 -0
Fix for the patch #13377. Avoids race condition for relay logs close.
Code that closes current relay log is moved to purge_relay_logs().
sql/slave.cc
1.261 05/10/27 17:03:48 SergeyV@selena. +14 -16
Fix for the patch #13377. Avoids race condition for relay logs close.
Code that closes current relay log is moved to purge_relay_logs().
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: SergeyV
# Host: selena.
# Root: H:/MYSQL/src/#13377-mysql-5.0a
--- 1.260/sql/slave.cc 2005-10-19 01:43:14 +04:00
+++ 1.261/sql/slave.cc 2005-10-27 17:03:48 +04:00
@@ -582,6 +582,20 @@
rli->slave_skip_counter=0;
pthread_mutex_lock(&rli->data_lock);
+
+ /*
+ we close the relay log fd possibly left open by the slave SQL thread,
+ to be able to delete it; the relay log fd possibly left open by the slave
+ I/O thread will be closed naturally in reset_logs() by the
+ close(LOG_CLOSE_TO_BE_OPENED) call
+ */
+ if (rli->cur_log_fd >= 0)
+ {
+ end_io_cache(&rli->cache_buf);
+ my_close(rli->cur_log_fd, MYF(MY_WME));
+ rli->cur_log_fd= -1;
+ }
+
if (rli->relay_log.reset_logs(thd))
{
*errmsg = "Failed during log reset";
@@ -3692,14 +3706,6 @@
mi->slave_running = 0;
mi->io_thd = 0;
- /* Close log file and free buffers */
- if (mi->rli.cur_log_fd >= 0)
- {
- end_io_cache(&mi->rli.cache_buf);
- my_close(mi->rli.cur_log_fd, MYF(MY_WME));
- mi->rli.cur_log_fd= -1;
- }
-
/* Forget the relay log's format */
delete mi->rli.relay_log.description_event_for_queue;
mi->rli.relay_log.description_event_for_queue= 0;
@@ -3915,14 +3921,6 @@
/* we die so won't remember charset - re-update them on next thread start */
rli->cached_charset_invalidate();
rli->save_temporary_tables = thd->temporary_tables;
-
- /* Close log file and free buffers if it's already open */
- if (rli->cur_log_fd >= 0)
- {
- end_io_cache(&rli->cache_buf);
- my_close(rli->cur_log_fd, MYF(MY_WME));
- rli->cur_log_fd = -1;
- }
/*
TODO: see if we can do this conditionally in next_event() instead
| Thread |
|---|
| • bk commit into 5.0 tree (SergeyV:1.2029) | sergeyv | 27 Oct |