List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:June 13 2011 12:07am
Subject:bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3287)
View as plain text  
#At file:///home/acorreia/workspace.oracle/repository.mysql/bzrwork/wl-5569/mysql-next-mr-wl5569/ based on revid:andrei.elkin@stripped

 3287 Alfranio Correia	2011-06-13
      Reorganized hierarchy and use of performance schema.

    modified:
      sql/rpl_info.cc
      sql/rpl_info.h
      sql/rpl_mi.cc
      sql/rpl_mi.h
      sql/rpl_rli.cc
      sql/rpl_rli.h
      sql/rpl_rli_pdb.cc
      sql/rpl_rli_pdb.h
      sql/rpl_slave.cc
=== modified file 'sql/rpl_info.cc'
--- a/sql/rpl_info.cc	2011-06-09 15:27:47 +0000
+++ b/sql/rpl_info.cc	2011-06-13 00:07:26 +0000
@@ -17,29 +17,44 @@
 #include <sql_priv.h>
 #include "rpl_info.h"
 
-Rpl_info::Rpl_info(const char* type)
+Rpl_info::Rpl_info(const char* type, const char* description)
   : Slave_reporting_capability(type),
   info_thd(0), uidx(0), nidx(0),
   inited(0), abort_slave(0),
   slave_running(0), slave_run_id(0),
   handler(0), rpl_info_type(INVALID_INFO_REPOSITORY)
+#ifdef HAVE_PSI_INTERFACE
+    , mutex_info(0), cond_info(0), key_mutex_info(0), key_cond_info(0)
+#endif
 {
+  register_mutexes(description);
 }
 
 Rpl_info::~Rpl_info()
 {
   delete []uidx;
   delete handler;
-}
 
-Rpl_info_coordinator::Rpl_info_coordinator(const char* type, const char* psf)
-  : Rpl_info(type), mutex_info(0), cond_info(0), key_mutex_info(0),
-  key_cond_info(0)
-{
-  register_mutexes(psf);
+  if (registered_mutexes)
+  {
+#ifdef HAVE_PSI_INTERFACE
+    delete []key_mutex_info;
+    delete []key_cond_info;
+    delete []mutex_info;
+    delete []cond_info;
+#endif
+  }
+
+  mysql_mutex_destroy(&run_lock);
+  mysql_mutex_destroy(&data_lock);
+  mysql_mutex_destroy(&sleep_lock);
+  mysql_cond_destroy(&data_cond);
+  mysql_cond_destroy(&start_cond);
+  mysql_cond_destroy(&stop_cond);
+  mysql_cond_destroy(&sleep_cond);
 }
 
-bool Rpl_info_coordinator::register_mutexes(const char* description)
+bool Rpl_info::register_mutexes(const char* description)
 {
 #ifdef HAVE_PSI_INTERFACE
   const int NUMBER_MUTEX_INFO= 3;
@@ -60,33 +75,32 @@ bool Rpl_info_coordinator::register_mute
     goto err;
 
   mutex_info[RUN_LOCK_IDX].m_key= (PSI_mutex_key *) &(key_mutex_info[RUN_LOCK_IDX]);
-  mutex_info[RUN_LOCK_IDX].m_name= "Rpl_info_coordinator::run_lock";
+  mutex_info[RUN_LOCK_IDX].m_name= "Rpl_info::run_lock";
   mutex_info[RUN_LOCK_IDX].m_flags= 0;
   mutex_info[DATA_LOCK_IDX].m_key= (PSI_mutex_key *) &(key_mutex_info[DATA_LOCK_IDX]);
-  mutex_info[DATA_LOCK_IDX].m_name= "Rpl_info_coordinator::data_lock";
+  mutex_info[DATA_LOCK_IDX].m_name= "Rpl_info::data_lock";
   mutex_info[DATA_LOCK_IDX].m_flags= 0;
   mutex_info[SLEEP_LOCK_IDX].m_key= (PSI_mutex_key *) &(key_mutex_info[SLEEP_LOCK_IDX]);
-  mutex_info[SLEEP_LOCK_IDX].m_name= "Rpl_info_coordinator::sleep_lock";
+  mutex_info[SLEEP_LOCK_IDX].m_name= "Rpl_info::sleep_lock";
   mutex_info[SLEEP_LOCK_IDX].m_flags= 0;
 
   cond_info[DATA_COND_IDX].m_key= (PSI_cond_key *) &(key_cond_info[DATA_COND_IDX]);
-  cond_info[DATA_COND_IDX].m_name= "Rpl_info_coordinator::data_cond";
+  cond_info[DATA_COND_IDX].m_name= "Rpl_info::data_cond";
   cond_info[DATA_COND_IDX].m_flags= 0;
   cond_info[START_COND_IDX].m_key= (PSI_cond_key *) &(key_cond_info[START_COND_IDX]);
-  cond_info[START_COND_IDX].m_name= "Rpl_info_coordinator::start_cond";
+  cond_info[START_COND_IDX].m_name= "Rpl_info::start_cond";
   cond_info[START_COND_IDX].m_flags= 0;
   cond_info[STOP_COND_IDX].m_key= (PSI_cond_key *) &(key_cond_info[STOP_COND_IDX]);
-  cond_info[STOP_COND_IDX].m_name= "Rpl_info_coordinator::stop_cond";
+  cond_info[STOP_COND_IDX].m_name= "Rpl_info::stop_cond";
   cond_info[STOP_COND_IDX].m_flags= 0;
   cond_info[SLEEP_COND_IDX].m_key= (PSI_cond_key *) &(key_cond_info[SLEEP_COND_IDX]);
-  cond_info[SLEEP_COND_IDX].m_name= "Rpl_info_coordinator::sleep_cond";
+  cond_info[SLEEP_COND_IDX].m_name= "Rpl_info::sleep_cond";
   cond_info[SLEEP_COND_IDX].m_flags= 0;
 
   if (PSI_server)
   {
     PSI_server->register_mutex(description, mutex_info,
                                NUMBER_MUTEX_INFO);
-
     PSI_server->register_cond(description, cond_info,
                               NUMBER_COND_INFO);
   }
@@ -104,11 +118,9 @@ bool Rpl_info_coordinator::register_mute
   mysql_cond_init(key_cond_info[SLEEP_COND_IDX], &sleep_cond, NULL);
 
   registered_mutexes= TRUE; 
-#endif
 
   return (FALSE);
 
-#ifdef HAVE_PSI_INTERFACE
 err:
   delete []key_mutex_info;
   delete []key_cond_info;
@@ -121,39 +133,18 @@ err:
   cond_info= NULL;
 
   return (TRUE);
-#endif
-}
+#else
+  mysql_mutex_init(NULL, &run_lock, MY_MUTEX_INIT_FAST);
+  mysql_mutex_init(NULL, &data_lock, MY_MUTEX_INIT_FAST);
+  mysql_mutex_init(NULL, &sleep_lock, MY_MUTEX_INIT_FAST);
+
+  mysql_cond_init(NULL, &data_cond, NULL);
+  mysql_cond_init(NULL, &start_cond, NULL);
+  mysql_cond_init(NULL, &stop_cond, NULL);
+  mysql_cond_init(NULL, &sleep_cond, NULL);
 
-Rpl_info_coordinator::~Rpl_info_coordinator()
-{
-  DBUG_ENTER("Rpl_info_coordinator::~Rpl_info_coordinator");
+  registered_mutexes= TRUE; 
 
-#ifdef HAVE_PSI_INTERFACE
-  if (registered_mutexes)
-  {
-    mysql_mutex_destroy(&run_lock);
-    mysql_mutex_destroy(&data_lock);
-    mysql_mutex_destroy(&sleep_lock);
-    mysql_cond_destroy(&data_cond);
-    mysql_cond_destroy(&start_cond);
-    mysql_cond_destroy(&stop_cond);
-    mysql_cond_destroy(&sleep_cond);
-  
-    delete []key_mutex_info;
-    delete []key_cond_info;
-    delete []mutex_info;
-    delete []cond_info;
-  }
+  return (FALSE);
 #endif
-
-  DBUG_VOID_RETURN;
-}
-
-Rpl_info_worker::Rpl_info_worker(const char* type, const char* pfs)
-  : Rpl_info(type)
-{
-}
-
-Rpl_info_worker::~Rpl_info_worker()
-{
 }

=== modified file 'sql/rpl_info.h'
--- a/sql/rpl_info.h	2011-06-09 15:27:47 +0000
+++ b/sql/rpl_info.h	2011-06-13 00:07:26 +0000
@@ -46,6 +46,31 @@ public:
   volatile uint slave_running;
   volatile ulong slave_run_id;
 
+  /*
+    standard lock acquisition order to avoid deadlocks:
+    run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index
+    run_lock, sleep_lock
+  */
+  mysql_mutex_t data_lock, run_lock, sleep_lock;
+
+  /*
+    start_cond is broadcast when SQL thread is started
+    stop_cond  - when stopped
+    data_cond  - when data protected by data_lock changes
+    sleep_cond - when killed
+  */
+  mysql_cond_t data_cond, start_cond, stop_cond, sleep_cond;
+
+#ifndef DBUG_OFF
+  int events_until_exit;
+#endif
+
+  /**
+    Identifies if mutexes and condition variables were successfuly
+    created and registered. 
+  */
+  bool registered_mutexes;
+
   /**
     Defines the type of the repository that is used.
 
@@ -129,48 +154,6 @@ protected:
   Rpl_info_handler *handler;
   uint rpl_info_type;
 
-  Rpl_info(const char *type);
-
-private:
-  virtual bool read_info(Rpl_info_handler *from)= 0;
-  virtual bool write_info(Rpl_info_handler *to)= 0;
-
-  Rpl_info(const Rpl_info& info);
-  Rpl_info& operator=(const Rpl_info& info);
-};
-
-class Rpl_info_coordinator: public Rpl_info
-{
-public:
-  /*
-    standard lock acquisition order to avoid deadlocks:
-    run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index
-    run_lock, sleep_lock
-  */
-  mysql_mutex_t data_lock, run_lock, sleep_lock;
-
-  /*
-    start_cond is broadcast when SQL thread is started
-    stop_cond  - when stopped
-    data_cond  - when data protected by data_lock changes
-    sleep_cond - when killed
-  */
-  mysql_cond_t data_cond, start_cond, stop_cond, sleep_cond;
-
-#ifndef DBUG_OFF
-  int events_until_exit;
-#endif
-
-  Rpl_info_coordinator(const char* type, const char* pfs);
-  virtual ~Rpl_info_coordinator();
-
-  /**
-    Identifies if mutexes and condition variables were successfuly
-    created and registered. 
-  */
-  bool registered_mutexes;
-
-protected:
   /**
     Registers mutexes and condition variables in the performance
     schema.
@@ -182,6 +165,8 @@ protected:
   */
   bool register_mutexes(const char* description);
 
+  Rpl_info(const char *type, const char* description);
+
 private:
 #ifdef HAVE_PSI_INTERFACE
   PSI_mutex_info *mutex_info;
@@ -190,19 +175,10 @@ private:
   PSI_cond_key *key_cond_info;
 #endif
 
-  Rpl_info_coordinator& operator=(const Rpl_info_coordinator& info);
-  Rpl_info_coordinator(const Rpl_info_coordinator& info);
-};
-
-class Rpl_info_worker: public Rpl_info
-{
-public:
-
-  Rpl_info_worker(const char* type, const char* pfs);
-  virtual ~Rpl_info_worker();
+  virtual bool read_info(Rpl_info_handler *from)= 0;
+  virtual bool write_info(Rpl_info_handler *to)= 0;
 
-private:
-  Rpl_info_worker& operator=(const Rpl_info_worker& info);
-  Rpl_info_worker(const Rpl_info_worker& info);
+  Rpl_info(const Rpl_info& info);
+  Rpl_info& operator=(const Rpl_info& info);
 };
 #endif /* RPL_INFO_H */

=== modified file 'sql/rpl_mi.cc'
--- a/sql/rpl_mi.cc	2011-06-09 15:27:47 +0000
+++ b/sql/rpl_mi.cc	2011-06-13 00:07:26 +0000
@@ -77,7 +77,7 @@ const char *info_mi_fields []=
 };
 
 Master_info::Master_info()
-   :Rpl_info_coordinator("I/O", "IO-Thread"),
+   :Rpl_info("I/O", "IO-Thread"),
    ssl(0), ssl_verify_server_cert(0),
    port(MYSQL_PORT), connect_retry(DEFAULT_CONNECT_RETRY),
    clock_diff_with_master(0), heartbeat_period(0),

=== modified file 'sql/rpl_mi.h'
--- a/sql/rpl_mi.h	2011-06-09 15:27:47 +0000
+++ b/sql/rpl_mi.h	2011-06-13 00:07:26 +0000
@@ -61,7 +61,7 @@ class Rpl_info_factory;
 
 *****************************************************************************/
 
-class Master_info : public Rpl_info_coordinator
+class Master_info : public Rpl_info
 {
 friend class Rpl_info_factory;
 

=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc	2011-06-12 19:05:05 +0000
+++ b/sql/rpl_rli.cc	2011-06-13 00:07:26 +0000
@@ -47,7 +47,7 @@ const char* info_rli_fields[]=
   "number_of_workers"
 };
 
-// ALFRANIO
+#ifdef HAVE_PSI_INTERFACE
 static PSI_mutex_info *worker_mutexes= NULL;
 static PSI_cond_info *worker_conds= NULL;
 
@@ -57,9 +57,10 @@ PSI_mutex_key key_mutex_mts_temp_tables_
 
 PSI_cond_key *key_cond_slave_parallel_worker= NULL;
 PSI_cond_key key_cond_slave_parallel_pend_jobs;
+#endif
 
 Relay_log_info::Relay_log_info(bool is_slave_recovery)
-   :Rpl_info_coordinator("SQL", "SQL-Thread"), checkpoint_thd(0), checkpoint_running(0),
+   :Rpl_info("SQL", "SQL-Thread"), checkpoint_thd(0), checkpoint_running(0),
    replicate_same_server_id(::replicate_same_server_id),
    cur_log_fd(-1), relay_log(&sync_relaylog_period),
    is_relay_log_recovery(is_slave_recovery),
@@ -106,8 +107,6 @@ Relay_log_info::Relay_log_info(bool is_s
 */
 void Relay_log_info::init_workers(ulong n)
 {
-  uint wi= 0;
-
   /*
     Parallel slave parameters initialization is done regardless
     whether the feature is or going to be active or not.
@@ -115,11 +114,15 @@ void Relay_log_info::init_workers(ulong
   trans_jobs= stmt_jobs= pending_jobs= wait_jobs= 0;
   mts_wqs_underrun_cnt= mts_wqs_overfill_cnt= 0;
 
+  my_init_dynamic_array(&workers, sizeof(Slave_worker *), slave_parallel_workers, 4);
+  my_atomic_rwlock_init(&slave_open_temp_tables_lock);
+
+#ifdef HAVE_PSI_INTERFACE
   key_mutex_slave_parallel_worker= new PSI_mutex_key[slave_parallel_workers];
   key_cond_slave_parallel_worker= new PSI_cond_key[slave_parallel_workers];
   worker_mutexes= new PSI_mutex_info[slave_parallel_workers];
   worker_conds= new PSI_cond_info[slave_parallel_workers];
-  for (wi= 0; wi < slave_parallel_workers; wi++)
+  for (uint wi= 0; wi < slave_parallel_workers; wi++)
   {
      worker_mutexes[wi].m_key= (PSI_mutex_key *) &(key_mutex_slave_parallel_worker[wi]);
      worker_mutexes[wi].m_name= "Slave_worker::jobs_lock";
@@ -137,11 +140,14 @@ void Relay_log_info::init_workers(ulong
   }
   mysql_mutex_init(key_mutex_slave_parallel_pend_jobs, &pending_jobs_lock,
                    MY_MUTEX_INIT_FAST);
-  mysql_cond_init(key_cond_slave_parallel_pend_jobs, &pending_jobs_cond, NULL);
   mysql_mutex_init(key_mutex_mts_temp_tables_lock, &mts_temp_tables_lock,
                    MY_MUTEX_INIT_FAST);
-  my_init_dynamic_array(&workers, sizeof(Slave_worker *), slave_parallel_workers, 4);
-  my_atomic_rwlock_init(&slave_open_temp_tables_lock);
+  mysql_cond_init(key_cond_slave_parallel_pend_jobs, &pending_jobs_cond, NULL);
+#else
+  mysql_mutex_init(NULL, &pending_jobs_lock, MY_MUTEX_INIT_FAST);
+  mysql_mutex_init(NULL, &mts_temp_tables_lock, MY_MUTEX_INIT_FAST);
+  mysql_cond_init(NULL, &pending_jobs_cond, NULL);
+#endif
 }
 
 /**

=== modified file 'sql/rpl_rli.h'
--- a/sql/rpl_rli.h	2011-06-12 19:05:05 +0000
+++ b/sql/rpl_rli.h	2011-06-13 00:07:26 +0000
@@ -103,7 +103,7 @@ transactional or non-transactional is us
 To correctly recovery from failures, one should combine transactional system
 tables along with the --relay-log-recovery.
 *******************************************************************************/
-class Relay_log_info : public Rpl_info_coordinator
+class Relay_log_info : public Rpl_info
 {
   friend class Rpl_info_factory;
 
@@ -757,5 +757,11 @@ inline bool mts_is_worker(THD *thd)
 {
   return thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER;
 }
+#ifdef HAVE_PSI_INTERFACE
+extern PSI_mutex_key *key_mutex_slave_parallel_worker;
+extern PSI_mutex_key key_mutex_slave_parallel_pend_jobs;
 
+extern PSI_cond_key *key_cond_slave_parallel_worker;
+extern PSI_cond_key key_cond_slave_parallel_pend_jobs;
+#endif
 #endif /* RPL_RLI_H */

=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	2011-06-12 17:36:17 +0000
+++ b/sql/rpl_rli_pdb.cc	2011-06-13 00:07:26 +0000
@@ -250,8 +250,11 @@ bool Slave_worker::commit_positions(Log_
 static HASH mapping_db_to_worker;
 static bool inited_hash_workers= FALSE;
 
+#ifdef HAVE_PSI_INTERFACE
 PSI_mutex_key key_mutex_slave_worker_hash;
 PSI_cond_key key_cond_slave_worker_hash;
+#endif
+
 static  mysql_mutex_t slave_worker_hash_lock;
 static  mysql_cond_t slave_worker_hash_cond;
 
@@ -295,9 +298,15 @@ bool init_hash_workers(ulong slave_paral
 {
   DBUG_ENTER("init_hash_workers");
 
+#ifdef HAVE_PSI_INTERFACE
   mysql_mutex_init(key_mutex_slave_worker_hash, &slave_worker_hash_lock,
                    MY_MUTEX_INIT_FAST);
   mysql_cond_init(key_cond_slave_worker_hash, &slave_worker_hash_cond, NULL);
+#else
+  mysql_mutex_init(NULL, &slave_worker_hash_lock,
+                   MY_MUTEX_INIT_FAST);
+  mysql_cond_init(NULL, &slave_worker_hash_cond, NULL);
+#endif
 
   inited_hash_workers=
     (my_hash_init(&mapping_db_to_worker, &my_charset_bin,

=== modified file 'sql/rpl_rli_pdb.h'
--- a/sql/rpl_rli_pdb.h	2011-06-10 08:04:00 +0000
+++ b/sql/rpl_rli_pdb.h	2011-06-13 00:07:26 +0000
@@ -269,11 +269,6 @@ public:
   volatile bool checkpoint_notified; // Coord sets and resets, W can read
   ulong bitmap_shifted;   // shift the last bitmap at receiving new CP
   bool wq_overrun_set;  // W monitors its queue usage to incr/decr rli->mts_wqs_overrun
-  /*
-    We need to make this a dynamic field. /Alfranio
-  */
-  char partitions[FN_REFLEN];
-  // todo: remove
   char checkpoint_relay_log_name[FN_REFLEN];
   ulonglong checkpoint_relay_log_pos;
 
@@ -315,10 +310,4 @@ private:
 
 TABLE* mts_move_temp_table_to_entry(TABLE*, THD*, db_worker_hash_entry*);
 TABLE* mts_move_temp_tables_to_thd(THD*, TABLE*);
-
-extern PSI_mutex_key *key_mutex_slave_parallel_worker;
-extern PSI_mutex_key key_mutex_slave_parallel_pend_jobs;
-
-extern PSI_cond_key *key_cond_slave_parallel_worker;
-extern PSI_cond_key key_cond_slave_parallel_pend_jobs;
 #endif

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-06-12 19:05:05 +0000
+++ b/sql/rpl_slave.cc	2011-06-13 00:07:26 +0000
@@ -404,11 +404,6 @@ int init_info(Master_info* mi, bool igno
     thread is being started and the relay log info if either the
     SLAVE_SQL thread is being started or was not initialized as it is
     required by the SLAVE_IO thread.
-
-    In a multi-master envinroment, we need to make sure that both master
-    info and relay log info are prepared to handle events from all
-    masters. In such case, we need to execute the code below for each
-    master and correctly set the key_info_idx. /Alfranio
   */
   necessary_to_configure= mi->check_info();
   if (!(ignore_if_no_info && necessary_to_configure))
@@ -440,11 +435,6 @@ void end_info(Master_info* mi)
   /*
     The previous implementation was not acquiring locks.  We do the same here.
     However, this is quite strange.
-
-    In a multi-master envinroment, we need to make sure that both master
-    info and relay log info are prepared to handle events from all
-    masters. In such case, we need to execute the code below for each
-    master and correctly set the key_info_idx. /Alfranio
   */
   mi->end_info();
   mi->rli->end_info();
@@ -472,12 +462,6 @@ int remove_info(Master_info* mi)
   mi->rli->clear_until_condition();
   mi->rli->clear_sql_delay();
 
-  /*
-    In a multi-master envinroment, we need to make sure that both master
-    info and relay log info are prepared to handle events from all
-    masters. In such case, we need to execute the code below for each
-    master and correctly set the key_info_idx. /Alfranio
-  */
   mi->end_info();
   mi->rli->end_info();
 
@@ -536,12 +520,6 @@ int flush_master_info(Master_info* mi, b
 
   mysql_mutex_lock(log_lock);
 
-  /*
-    In a multi-master envinroment, we need to make sure that both master
-    info and relay log info are prepared to handle events from all
-    masters. In such case, we need to execute the code below for each
-    master and correctly set the key_info_idx. /Alfranio
-  */
   int err=  (mi->rli->flush_current_log() ||
              mi->flush_info(force));
 
@@ -718,11 +696,6 @@ int terminate_slave_threads(Master_info*
 
     /*
       Flushes the master info regardles of the sync_master_info option.
-
-      In a multi-master envinroment, we need to make sure that both master
-      info and relay log info are prepared to handle events from all
-      masters. In such case, we need to execute the code below for each
-      master and correctly set the key_info_idx. /Alfranio
     */
     if (mi->flush_info(TRUE))
       DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
@@ -3819,7 +3792,6 @@ bool mts_recovery_groups(Relay_log_info
   Slave_job_group job_file;
   IO_CACHE log;
   File file;
-  MY_STAT s;
 
   LOG_POS_COORD cp=
   {
@@ -3883,9 +3855,7 @@ bool mts_recovery_groups(Relay_log_info
     goto err;
   }
              
-  DBUG_ASSERT(my_stat(log_name, &s, MYF(0))); // TODO: Alfranio, why my_stat?
   my_b_seek(&log, (my_off_t) rli->get_group_relay_log_pos());
-
   bitmap_clear_all(groups);
   rli->mts_recovery_group_cnt= 0;
   for (uint it_job= 0; it_job < above_lwm_jobs.elements; it_job++)
@@ -4125,9 +4095,14 @@ int slave_start_single_worker(Relay_log_
   
   w->wq_overrun_set= FALSE;
   set_dynamic(&rli->workers, (uchar*) &w, i);
+#ifdef HAVE_PSI_INTERFACE
   mysql_mutex_init(key_mutex_slave_parallel_worker[i], &w->jobs_lock,
                    MY_MUTEX_INIT_FAST);
   mysql_cond_init(key_cond_slave_parallel_worker[i], &w->jobs_cond, NULL);
+#else
+  mysql_mutex_init(NULL, &w->jobs_lock, MY_MUTEX_INIT_FAST);
+  mysql_cond_init(NULL, &w->jobs_cond, NULL);
+#endif
 
   w->curr_group_seen_begin= FALSE;
   if (pthread_create(&th, &connection_attrib, handle_slave_worker,
@@ -6990,13 +6965,10 @@ bool change_master(THD* thd, Master_info
     in-memory value at restart (thus causing errors, as the old relay log does
     not exist anymore).
 
-    In a multi-master envinroment, we need to make sure that both master
-    info and relay log info are prepared to handle events from all
-    masters. In such case, we need to execute the code below for each
-    master and correctly set the key_info_idx. /Alfranio
+    Notice that there are not writes to the rli table as slave is not
+    running.
   */
-
-  DBUG_ASSERT(!mi->rli->slave_running); // none writes in rli table
+  DBUG_ASSERT(!mi->rli->slave_running);
   ret= mi->rli->flush_info(TRUE);
   mysql_cond_broadcast(&mi->data_cond);
   mysql_mutex_unlock(&mi->rli->data_lock);


Attachment: [text/bzr-bundle] bzr/alfranio.correia@oracle.com-20110613000726-hs649xzho5iyfz7t.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3287) Alfranio Correia13 Jun