[Commits] Rev 4606: MDEV-7568: STOP SLAVE crashes the server in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Thu Feb 19 16:43:36 EET 2015


At http://bazaar.launchpad.net/~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4606
revision-id: knielsen at knielsen-hq.org-20150219144327-l20hguxhxe10vyve
parent: jplindst at mariadb.org-20150218120713-qjg3ejkkh61qvzv7
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0
timestamp: Thu 2015-02-19 15:43:27 +0100
message:
  MDEV-7568: STOP SLAVE crashes the server
  
  The order of initialisation during server startup was incorrect. The slave
  threads were started before the parallel replication worker thread pool was
  initialised, allowing a race where uninitialised data could be accessed.
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2014-12-02 11:11:07 +0000
+++ b/sql/slave.cc	2015-02-19 14:43:27 +0000
@@ -371,6 +371,9 @@ int init_slave()
   if (run_slave_init_thread())
     return 1;
 
+  if (global_rpl_thread_pool.init(opt_slave_parallel_threads))
+    return 1;
+
   /*
     This is called when mysqld starts. Before client connections are
     accepted. However bootstrap may conflict with us if it does START SLAVE.
@@ -404,9 +407,6 @@ int init_slave()
     goto err;
   }
 
-  if (global_rpl_thread_pool.init(opt_slave_parallel_threads))
-    return 1;
-
   /*
     If --slave-skip-errors=... was not used, the string value for the
     system variable has not been set up yet. Do it now.



More information about the commits mailing list