List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:December 3 2010 10:24am
Subject:bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3226)
View as plain text  
#At file:///home/acorreia/workspace.sun/repository.mysql.new/bzrwork/wl-5569/mysql-next-mr-wl5569/ based on revid:andrei.elkin@stripped

 3226 Alfranio Correia	2010-12-03
      Fixed commit_positions() and removed unnecessary checkpoint thread. 

    modified:
      sql/rpl_rli_pdb.cc
      sql/rpl_slave.cc
=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	2010-12-02 18:13:12 +0000
+++ b/sql/rpl_rli_pdb.cc	2010-12-03 10:15:45 +0000
@@ -160,7 +160,7 @@ bool Slave_worker::commit_positions(Log_
   bool error= FALSE;
 
   group_relay_log_pos= ev->future_event_relay_log_pos;
-  group_master_log_pos= ev->mts_group_cnt;
+  group_master_log_pos= ev->log_pos;
   strmake(group_master_log_name, c_rli->get_group_master_log_name(),
           sizeof(group_master_log_name)-1);
 

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2010-12-02 18:13:12 +0000
+++ b/sql/rpl_slave.cc	2010-12-03 10:15:45 +0000
@@ -3627,122 +3627,6 @@ bool checkpoint_routine(Relay_log_info *
   DBUG_RETURN(error);
 }
 
-pthread_handler_t handle_slave_checkpoint(void *arg)
-{
-  THD *thd;                     /* needs to be first for thread_stack */
-  int error= 0;
-  Relay_log_info *rli= (Relay_log_info *) arg;
-
-  my_thread_init();
-  DBUG_ENTER("handle_slave_worker");
-
-  rli->checkpoint_running= 1;
-
-  thd= new THD;
-  if (!thd)
-  {
-    sql_print_error("Failed during slave checkpoint initialization");
-
-    mysql_mutex_lock(&rli->data_lock);
-    mysql_cond_broadcast(&rli->checkpoint_start_cond);
-    mysql_mutex_unlock(&rli->data_lock);
-
-    goto err;
-  }
-
-  thd->thread_stack = (char*)&thd;
-  
-  pthread_detach_this_thread();
-
-  mysql_mutex_lock(&rli->data_lock);
-  rli->checkpoint_thd= thd;
-  mysql_cond_broadcast(&rli->checkpoint_start_cond);
-  mysql_mutex_unlock(&rli->data_lock);
-
-  if (init_slave_thread(thd, SLAVE_THD_CHECKPOINT))
-  {
-    // todo make SQL thread killed
-    sql_print_error("Failed during slave worker initialization");
-    goto err;
-  }
-  thd->init_for_queries();
-  mysql_mutex_lock(&LOCK_thread_count);
-  threads.append(thd);
-  mysql_mutex_unlock(&LOCK_thread_count);
-
-  DBUG_ASSERT(thd->is_slave_error == 0);
-
-  while (!thd->killed && !error)
-  {
-    checkpoint_routine(rli);
-    sleep(1);
-  }
-
-  mysql_mutex_lock(&rli->data_lock);
-  rli->checkpoint_running= 0;
-  rli->checkpoint_thd= NULL;
-  mysql_cond_broadcast(&rli->checkpoint_stop_cond);
-  mysql_mutex_unlock(&rli->data_lock);
-
-  if (error)
-  {
-    mysql_mutex_lock(&rli->info_thd->LOCK_thd_data);
-    rli->info_thd->awake(THD::KILL_QUERY);          // notify Crdn
-    mysql_mutex_unlock(&rli->info_thd->LOCK_thd_data);
-  }
-
-err:
-
-  if (thd)
-  {
-    mysql_mutex_lock(&LOCK_thread_count);
-    THD_CHECK_SENTRY(thd);
-    delete thd;
-    mysql_mutex_unlock(&LOCK_thread_count);
-  }
-
-  my_thread_end();
-  pthread_exit(0);
-  DBUG_RETURN(0); 
-}
-
-int slave_start_checkpoint(Relay_log_info *rli)
-{
-  pthread_t th;
-  int error= 0;
-
-  if (pthread_create(&th, &connection_attrib, handle_slave_checkpoint,
-                     (void*) rli))
-  {
-    sql_print_error("Failed during slave checkpoint thread create");
-    error= 1;
-  }
-
-  while (error == 0 && rli->checkpoint_running == 0)
-    mysql_cond_wait(&rli->checkpoint_start_cond, &rli->data_lock);
-
-  mysql_mutex_unlock(&rli->data_lock);
-
-  return (error);
-}
-
-int slave_stop_checkpoint(Relay_log_info *rli)
-{
-  mysql_mutex_lock(&rli->info_thd->LOCK_thd_data);
-  mysql_mutex_lock(&rli->data_lock);
-  if (rli->checkpoint_thd)
-    rli->checkpoint_thd->awake(THD::KILL_QUERY);
-  mysql_mutex_unlock(&rli->data_lock);
-  mysql_mutex_unlock(&rli->info_thd->LOCK_thd_data);
- 
-  mysql_mutex_lock(&rli->data_lock);
-  while (rli->checkpoint_running == 1)
-    mysql_cond_wait(&rli->checkpoint_stop_cond, &rli->data_lock);
-  mysql_mutex_unlock(&rli->data_lock);
-
-  return 0;
-}
-
 /**
    A single Worker thread is forked out.
    
@@ -3873,12 +3757,6 @@ int slave_start_workers(Relay_log_info *
     goto err;
   }
 
-  /* if (rli->is_parallel_exec())
-  {
-    slave_start_checkpoint(rli);
-  }
-  */
-
 err:
   return error;
 }


Attachment: [text/bzr-bundle] bzr/alfranio.correia@oracle.com-20101203101545-8rvcpbwdzoz8rxuu.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3226) Alfranio Correia3 Dec