List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:September 15 2010 11:52am
Subject:bzr push into mysql-next-mr branch (aelkin:3198 to 3199) WL#5563
View as plain text  
 3199 Andrei Elkin	2010-09-15
      wl#5563
      
      tests for the wl. Number of workers and iterations can be tuned. todo: convert as param:s to pass to the test through mtr

    added:
      mysql-test/suite/rpl/r/rpl_parallel.result
      mysql-test/suite/rpl/t/rpl_parallel.test
    modified:
      sql/log_event.cc
 3198 Andrei Elkin	2010-09-13
      wl#5563
      
      adding an ingeneous no-stress-attempting-yet test that also fired an assert. Refined the Worker instance ref computing because cleanup_context() is executed by the sql-thread the coordinator as well

    modified:
      sql/rpl_rli.cc
=== added file 'mysql-test/suite/rpl/r/rpl_parallel.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result	2010-09-15 11:51:49 +0000
@@ -0,0 +1,40 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+include/stop_slave.inc
+set @save.slave_exec_mode= @@global.slave_exec_mode;
+set @@global.slave_exec_mode = 'Parallel';
+start slave io_thread;
+create database test3;
+use test3;
+create table tm_nk (a int, b int) engine=myisam;
+create table tm_wk (a int auto_increment primary key, b int) engine=myisam;
+create table ti_nk (a int, b int) engine=innodb;
+create table ti_wk (a int auto_increment primary key, b int) engine=innodb;
+create database test2;
+use test2;
+create table tm_nk (a int, b int) engine=myisam;
+create table tm_wk (a int auto_increment primary key, b int) engine=myisam;
+create table ti_nk (a int, b int) engine=innodb;
+create table ti_wk (a int auto_increment primary key, b int) engine=innodb;
+create database test1;
+use test1;
+create table tm_nk (a int, b int) engine=myisam;
+create table tm_wk (a int auto_increment primary key, b int) engine=myisam;
+create table ti_nk (a int, b int) engine=innodb;
+create table ti_wk (a int auto_increment primary key, b int) engine=innodb;
+create database test0;
+use test0;
+create table tm_nk (a int, b int) engine=myisam;
+create table tm_wk (a int auto_increment primary key, b int) engine=myisam;
+create table ti_nk (a int, b int) engine=innodb;
+create table ti_wk (a int auto_increment primary key, b int) engine=innodb;
+start slave sql_thread;
+Comparing tables master:test0.tm_nk and slave:test0.tm_nk
+Comparing tables master:test0.tm_wk and slave:test0.tm_wk
+Comparing tables master:test0.ti_nk and slave:test0.ti_nk
+Comparing tables master:test0.ti_wk and slave:test0.ti_wk
+set @@global.slave_exec_mode= @save.slave_exec_mode;

=== added file 'mysql-test/suite/rpl/t/rpl_parallel.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test	2010-09-15 11:51:49 +0000
@@ -0,0 +1,161 @@
+source include/master-slave.inc;
+
+let $workers = 4;
+let $iter = 50;
+
+connection slave;
+source include/stop_slave.inc;
+set @save.slave_exec_mode= @@global.slave_exec_mode;
+set @@global.slave_exec_mode = 'Parallel';
+start slave io_thread;
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+use test;
+delimiter |;
+create procedure one_session(k int)
+begin
+  while k > 0 do
+    insert into tm_nk values(k, 0);
+    insert into tm_wk values(null, 0);
+    insert into ti_nk values(k, 0);
+    insert into ti_wk values(null, 0);
+    set k = k - 1;
+  end while;
+end|
+delimiter ;|
+
+--enable_result_log
+--enable_query_log
+
+## let $i = $workers + 1;
+##eval 
+# delimiter |;
+# create procedure p1(i int)
+# begin
+#     while i > 0
+#       ##while ($i)
+#       ##{
+#       ## let $i1=$i;
+#       ## dec $i1;
+#       ## use test$i1;
+#       ## call on_session();
+#       ## dec $i;
+#       ##}
+#       use test0;
+#       call one_session();
+#       use test1;
+#       call one_session();
+#       use test2;
+#       call one_session();
+#       use test3;
+#       call one_session();
+#       i= i-1;
+#     end while;
+# end|
+# delimiter ;|
+
+
+let $i = $workers + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+  
+  eval create database test$i1;
+  eval use test$i1;
+  create table tm_nk (a int, b int) engine=myisam;
+  create table tm_wk (a int auto_increment primary key, b int) engine=myisam;
+  create table ti_nk (a int, b int) engine=innodb;
+  create table ti_wk (a int auto_increment primary key, b int) engine=innodb;
+
+  dec $i;
+}
+
+##call p1(1);
+
+--disable_query_log
+--disable_result_log
+
+#
+# Load producer
+#
+while ($iter)
+{
+    let $i = $workers + 1;
+
+    while ($i)
+    {
+	let $i1 = $i;
+	dec $i1;
+
+	eval use test$i1;
+	##call test.one_session(1);
+	eval insert into tm_nk values($iter, $i1);
+	eval insert into tm_wk values(null, $i1);
+	eval insert into ti_nk values($iter, $i1);
+	eval insert into ti_wk values(null, $i1);
+    
+	dec $i;
+    }
+
+    dec $iter;
+}
+
+--enable_result_log
+--enable_query_log
+
+connection slave;
+
+## todo: record start and end time of appying to compare times of
+#  parallel and serial execution.
+
+start slave sql_thread;
+
+--sleep 5  # todo: convert to wait for the last event has been applied
+
+let $diff_table_1=master:test0.tm_nk;
+let $diff_table_2=slave:test0.tm_nk;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test0.tm_wk;
+let $diff_table_2=slave:test0.tm_wk;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test0.ti_nk;
+let $diff_table_2=slave:test0.ti_nk;
+source include/diff_tables.inc;
+
+let $diff_table_1=master:test0.ti_wk;
+let $diff_table_2=slave:test0.ti_wk;
+source include/diff_tables.inc;
+
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+let $i = $workers + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+
+  #eval drop database test$i1;
+  dec $i;
+}
+
+--enable_result_log
+--enable_query_log
+
+connection slave;
+set @@global.slave_exec_mode= @save.slave_exec_mode;
+
+connection master;
+### select sleep(10000);
+
+# End of 4.1 tests

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2010-09-13 10:15:38 +0000
+++ b/sql/log_event.cc	2010-09-15 11:51:49 +0000
@@ -2275,7 +2275,7 @@ int slave_worker_exec_job(struct slave_w
   THD *thd= w->thd;
   Log_event *ev= NULL;
 
-  DBUG_ENTER("slave_worker_exec_job()");
+  DBUG_ENTER("slave_worker_exec_job");
 
   if (!(job_item= pop_jobs_item(w)))
   {
@@ -2326,6 +2326,7 @@ int slave_worker_exec_job(struct slave_w
            (used_ev=
             static_cast<Log_event *>(w->data_in_use.first_node()->info))->soiled)
     {
+      DBUG_PRINT("slave_worker_exec_job GC:", ("W_%lu, event %p", w->id, used_ev));
       delete used_ev;
       w->data_in_use.pop();
     }


Attachment: [text/bzr-bundle] bzr/aelkin@mysql.com-20100915115149-onkk1vpkbxksa2c2.bundle
Thread
bzr push into mysql-next-mr branch (aelkin:3198 to 3199) WL#5563Andrei Elkin15 Sep