List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:December 21 2010 7:35pm
Subject:bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3255)
View as plain text  
#At file:///home/andrei/MySQL/BZR/2a-23May/WL/mysql-next-mr-wl5569/ based on revid:andrei.elkin@stripped

 3255 Andrei Elkin	2010-12-21 [merge]
      merging with repo

    modified:
      mysql-test/suite/funcs_1/r/is_columns_mysql.result
      scripts/mysql_system_tables.sql
      sql/rpl_info_table.cc
      sql/rpl_info_table_access.cc
      sql/rpl_rli.cc
      sql/rpl_rli.h
      sql/rpl_slave.cc
=== modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result	2010-12-20 22:18:33 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result	2010-12-21 17:30:50 +0000
@@ -179,7 +179,7 @@ def	mysql	slave_relay_log_info	Number_of
 def	mysql	slave_relay_log_info	Relay_log_name	3	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
 def	mysql	slave_relay_log_info	Relay_log_pos	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	mysql	slave_relay_log_info	Sql_delay	7	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	mysql	slave_worker_info	Checkpoint_group_bitmap	12	NULL	YES	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_group_bitmap	12	NULL	NO	blob	65535	65535	NULL	NULL	NULL	NULL	blob			select,insert,update,references	
 def	mysql	slave_worker_info	Checkpoint_group_size	11	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	mysql	slave_worker_info	Checkpoint_master_log_name	9	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
 def	mysql	slave_worker_info	Checkpoint_master_log_pos	10	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
@@ -525,7 +525,7 @@ NULL	mysql	slave_worker_info	Checkpoint_
 1.0000	mysql	slave_worker_info	Checkpoint_master_log_name	text	65535	65535	utf8	utf8_bin	text
 NULL	mysql	slave_worker_info	Checkpoint_master_log_pos	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 NULL	mysql	slave_worker_info	Checkpoint_group_size	int	NULL	NULL	NULL	NULL	int(10) unsigned
-1.0000	mysql	slave_worker_info	Checkpoint_group_bitmap	text	65535	65535	utf8	utf8_bin	text
+1.0000	mysql	slave_worker_info	Checkpoint_group_bitmap	blob	65535	65535	NULL	NULL	blob
 NULL	mysql	slow_log	start_time	timestamp	NULL	NULL	NULL	NULL	timestamp
 1.0000	mysql	slow_log	user_host	mediumtext	16777215	16777215	utf8	utf8_general_ci	mediumtext
 NULL	mysql	slow_log	query_time	time	NULL	NULL	NULL	NULL	time

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2010-12-20 22:18:33 +0000
+++ b/scripts/mysql_system_tables.sql	2010-12-21 17:30:50 +0000
@@ -104,7 +104,7 @@ CREATE TABLE IF NOT EXISTS slave_relay_l
 
 CREATE TABLE IF NOT EXISTS slave_master_info (Master_id INTEGER UNSIGNED NOT NULL, Number_of_lines INTEGER UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Host TEXT CHARACTER SET utf8 COLLATE utf8_bin, User_name TEXT CHARACTER SET utf8 COLLATE utf8_bin, User_password TEXT CHARACTER SET utf8 COLLATE utf8_bin, Port INTEGER UNSIGNED NOT NULL, Connect_retry INTEGER UNSIGNED NOT NULL, Enabled_ssl BOOLEAN NOT NULL, Ssl_ca TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_capath TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_cert TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_cipher TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_key TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_verify_servert_cert BOOLEAN NOT NULL, Heartbeat FLOAT NOT NULL, Bind TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ignored_server_ids TEXT CHARACTER SET utf8 COLLATE utf8_bin, Uuid TEXT CHARACTER SET utf8 COLLATE utf8_bin, Retry_count BIGIN!
 T UNSIGNED NOT NULL, PRIMARY KEY(Master_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Master Information';
 
-CREATE TABLE IF NOT EXISTS slave_worker_info (Master_id INTEGER UNSIGNED NOT NULL, Worker_id INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_relay_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_group_size INTEGER UNSIGNED NOT NULL, Checkpoint_group_bitmap TEXT CHARACTER SET utf8 COLLATE utf8_bin, PRIMARY KEY(Master_id, Worker_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Worker Information';
+CREATE TABLE IF NOT EXISTS slave_worker_info (Master_id INTEGER UNSIGNED NOT NULL, Worker_id INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_relay_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_group_size INTEGER UNSIGNED NOT NULL, Checkpoint_group_bitmap BLOB NOT NULL, PRIMARY KEY(Master_id, Worker_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Worker Information';
 
 --
 -- PERFORMANCE SCHEMA INSTALLATION

=== modified file 'sql/rpl_info_table.cc'
--- a/sql/rpl_info_table.cc	2010-12-15 17:46:05 +0000
+++ b/sql/rpl_info_table.cc	2010-12-21 17:30:50 +0000
@@ -339,8 +339,7 @@ bool Rpl_info_table::do_set_info(const i
 bool Rpl_info_table::do_set_info(const int pos, const uchar *value,
                                  const size_t size)
 {
-  // TODO  -- ALFRANIO - ANDREI
-  return (field_values->value[pos].copy((char *) "", 0,
+  return (field_values->value[pos].copy((char *) value, size,
                                         &my_charset_bin));
 }
 
@@ -385,10 +384,12 @@ bool Rpl_info_table::do_get_info(const i
 }
 
 bool Rpl_info_table::do_get_info(const int pos, uchar *value, const size_t size,
-                                 const uchar *default_value)
+                                 const uchar *default_value __attribute__((unused)))
 {
-  // TODO  -- ALFRANIO - ANDREI
-  return FALSE;
+  if (field_values->value[pos].length() == size)
+    return (!memcpy((char *) value, (char *)
+            field_values->value[pos].c_ptr_safe(), size));
+  return TRUE;
 }
 
 bool Rpl_info_table::do_get_info(const int pos, ulong *value,

=== modified file 'sql/rpl_info_table_access.cc'
--- a/sql/rpl_info_table_access.cc	2010-12-15 17:46:05 +0000
+++ b/sql/rpl_info_table_access.cc	2010-12-21 17:30:50 +0000
@@ -246,7 +246,7 @@ bool Rpl_info_table_access::load_info_va
   {
     fields[field_idx]->val_str(&str);
     field_values->value[field_idx].copy(str.c_ptr_safe(), str.length(),
-                                             &my_charset_bin);
+                                        &my_charset_bin);
     field_idx++;
   }
 

=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc	2010-12-20 22:18:33 +0000
+++ b/sql/rpl_rli.cc	2010-12-21 14:11:05 +0000
@@ -70,6 +70,7 @@ Relay_log_info::Relay_log_info(bool is_s
    tables_to_lock(0), tables_to_lock_count(0),
    rows_query_ev(NULL), last_event_start_time(0),
    this_worker(NULL), slave_parallel_workers(0),
+   recovery_parallel_workers(0),
    checkpoint_group(mts_checkpoint_group),
    sql_delay(0), sql_delay_end(0), m_flags(0)
 {
@@ -1260,9 +1261,8 @@ int Relay_log_info::init_info()
     if (hot_log)
       mysql_mutex_unlock(log_lock);
 
-    // Please, Andrei, move this call to the right place.
     bitmap_clear_all(&groups);
-    DBUG_RETURN(slave_parallel_workers ? mts_recovery_groups(this, &groups) : 0);
+    DBUG_RETURN(recovery_parallel_workers ? mts_recovery_groups(this, &groups) : 0);
   }
 
   cur_log_fd = -1;
@@ -1662,7 +1662,7 @@ bool Relay_log_info::read_info(Rpl_info_
 
   if (lines >= LINES_IN_RELAY_LOG_INFO_WITH_WORKERS)
   {
-    if (from->get_info(&slave_parallel_workers,(ulong) 0))
+    if (from->get_info(&recovery_parallel_workers,(ulong) 0))
       DBUG_RETURN(TRUE);
   }
 
@@ -1690,7 +1690,7 @@ bool Relay_log_info::write_info(Rpl_info
       to->set_info(group_master_log_name) ||
       to->set_info((ulong) group_master_log_pos) ||
       to->set_info((int) sql_delay) ||
-      to->set_info(slave_parallel_workers))
+      to->set_info(recovery_parallel_workers))
     DBUG_RETURN(TRUE);
 
   DBUG_RETURN(FALSE);

=== modified file 'sql/rpl_rli.h'
--- a/sql/rpl_rli.h	2010-12-20 22:18:33 +0000
+++ b/sql/rpl_rli.h	2010-12-21 14:11:05 +0000
@@ -461,6 +461,7 @@ public:
  
   bool curr_group_is_parallel; // a mark for Coord to indicate on T-event of the curr group at delete
   ulong slave_parallel_workers; // one slave session time number of workers
+  ulong recovery_parallel_workers; // number of workers while recovering.
   /* 
      A sorted array of Worker current assignements number to provide
      approximate view on Workers loading.

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2010-12-21 19:31:29 +0000
+++ b/sql/rpl_slave.cc	2010-12-21 19:34:58 +0000
@@ -2810,6 +2810,9 @@ int apply_event_and_update_pos(Log_event
   else
     mysql_mutex_unlock(&rli->data_lock);
 
+  // TODO -- ALFRANIO
+  rli->recovery_parallel_workers= rli->slave_parallel_workers;
+
   DBUG_PRINT("info", ("apply_event error = %d", exec_res));
   if (exec_res == 0)
   {
@@ -3821,16 +3824,16 @@ bool mts_recovery_groups(Relay_log_info 
   };
 
   DBUG_ENTER("mts_recovery_groups");
-  DBUG_ASSERT(rli->slave_parallel_workers > 0);
+  DBUG_ASSERT(rli->recovery_parallel_workers > 0);
 
   /*
     Gathers information on valuable workers and stores it in 
     above_lwm_jobs in asc ordered by the master binlog coordinates.
   */
   my_init_dynamic_array(&above_lwm_jobs, sizeof(Slave_job_group),
-                        rli->slave_parallel_workers, rli->slave_parallel_workers);
+                        rli->recovery_parallel_workers, rli->recovery_parallel_workers);
 
-  for (uint id= 0; id < rli->slave_parallel_workers; id++)
+  for (uint id= 0; id < rli->recovery_parallel_workers; id++)
   {
     Slave_worker *worker=
       Rpl_info_factory::create_worker(opt_worker_repository_id, id, rli);
@@ -4129,7 +4132,7 @@ bool mts_checkpoint_routine(Relay_log_in
   do
   {
     cnt= rli->gaq->move_queue_head(&rli->workers);
-  } while (cnt == 0 && rli->gaq->full() &&
+  } while (cnt == 0 && (rli->gaq->full()  || force) &&
            (my_sleep(rli->mts_coordinator_basic_nap), 1));
   if (cnt == 0)
     goto end;
@@ -6515,9 +6518,6 @@ int start_slave(THD* thd , Master_info* 
         /*
           To cache the system var value and used it in the following.
           The system var can change but not the cached.
-
-          We cannot change this variable in other places, otherwise,
-          recovery will break.
         */
         mi->rli->slave_parallel_workers= opt_mts_slave_parallel_workers;
 


Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20101221193458-dha63d1348f3trsz.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3255) Andrei Elkin21 Dec