Below is the list of changes that have just been committed into a local
5.0 repository of mats. When mats 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.2188 06/06/20 20:46:45 mats@stripped +1 -0
Bug#19437 (Connection refused by server: "2002 Can't connect... /master.sock"):
Clearing active VIO before calling mysql_close() in the slave I/O
thread.
sql/slave.cc
1.270 06/06/20 20:46:39 mats@stripped +20 -0
Clearing active VIO before calling mysql_close() in the slave I/O thread.
# 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: mats
# Host: romeo.(none)
# Root: /home/bk/fix-mysql-5.0
--- 1.269/sql/slave.cc 2006-05-23 20:16:52 +02:00
+++ 1.270/sql/slave.cc 2006-06-20 20:46:39 +02:00
@@ -1653,6 +1653,15 @@
if (connect_to_master(thd, mysql, mi))
{
my_error(ER_CONNECT_TO_MASTER, MYF(0), mysql_error(mysql));
+ /*
+ We need to clear the active VIO since, theoretically, somebody
+ might issue an awake() on this thread. If we are then in the
+ middle of closing and destroying the VIO inside the
+ mysql_close(), we will have a problem.
+ */
+#ifdef SIGNAL_WITH_VIO_CLOSE
+ thd->clear_active_vio();
+#endif
mysql_close(mysql);
DBUG_RETURN(1);
}
@@ -3709,6 +3718,17 @@
VOID(pthread_mutex_unlock(&LOCK_thread_count));
if (mysql)
{
+ /*
+ Here we need to clear the active VIO before closing the
+ connection with the master. The reason is that THD::awake()
+ might be called from terminate_slave_thread() because somebody
+ issued a STOP SLAVE. If that happends, the close_active_vio()
+ can be called in the middle of closing the VIO associated with
+ the 'mysql' object, causing a crash.
+ */
+#ifdef SIGNAL_WITH_VIO_CLOSE
+ thd->clear_active_vio();
+#endif
mysql_close(mysql);
mi->mysql=0;
}
| Thread |
|---|
| • bk commit into 5.0 tree (mats:1.2188) BUG#19437 | Mats Kindahl | 20 Jun |