List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:July 1 2011 9:01am
Subject:bzr push into mysql-next-mr-wl5569 branch (alfranio.correia:3329 to 3330)
View as plain text  
 3330 Alfranio Correia	2011-07-01
      Improved mts recovery routines.

    modified:
      mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc
      mysql-test/suite/rpl/r/rpl_mixed_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_stm_mts_crash_safe.result
      sql/rpl_rli.cc
      sql/rpl_rli_pdb.cc
      sql/rpl_slave.cc
 3329 Alfranio Correia	2011-06-29
      Post-merge fixes.

    modified:
      mysql-test/extra/rpl_tests/rpl_loaddata.test
      mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
      mysql-test/suite/rpl/r/rpl_loaddata.result
      mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
      mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
      mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
      mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
=== modified file 'mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc'
--- a/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc	2011-06-28 16:12:24 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc	2011-07-01 08:45:11 +0000
@@ -88,10 +88,15 @@ if (`SELECT HEX(@commands) = HEX('recove
 
   #### Checking if the recovery worked and the coordinator has an updated state. ####
   --connection slave
-  START SLAVE SQL_THREAD;
+  --source include/start_slave_io.inc
+  let $wait_condition=SELECT Master_log_pos = $m_before_master_pos AND Master_log_name = "$m_before_master_file" FROM mysql.slave_master_info;
+  --source include/wait_condition.inc
+
+  --source include/start_slave_sql.inc
   let $wait_condition=SELECT Master_log_pos = $m_before_master_pos AND Master_log_name = "$m_before_master_file" FROM mysql.slave_relay_log_info;
   --source include/wait_condition.inc
-  --source include/stop_slave_sql.inc
+
+  --source include/stop_slave.inc
   eval SET @@global.slave_parallel_workers= $saved_current_workers;
   eval SET @@global.slave_checkpoint_period= $saved_current_checkpoint;
 

=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_mts_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_mts_crash_safe.result	2011-06-25 14:14:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mts_crash_safe.result	2011-07-01 08:45:11 +0000
@@ -233,8 +233,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -273,8 +274,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -326,8 +328,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -353,8 +356,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -393,8 +397,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -446,8 +451,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -486,8 +492,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -539,8 +546,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -579,8 +587,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -632,8 +641,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -672,8 +682,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -725,8 +736,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -778,8 +790,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -831,8 +844,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -884,8 +898,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -937,8 +952,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 3;
 SET @command= '';

=== modified file 'mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result	2011-06-25 14:14:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result	2011-07-01 08:45:11 +0000
@@ -235,8 +235,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -279,8 +280,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -338,8 +340,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -367,8 +370,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -411,8 +415,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -470,8 +475,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -514,8 +520,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -573,8 +580,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -617,8 +625,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -676,8 +685,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -720,8 +730,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -779,8 +790,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -838,8 +850,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -897,8 +910,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -956,8 +970,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -1015,8 +1030,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 3;
 SET @command= '';

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_mts_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_mts_crash_safe.result	2011-06-25 14:14:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_mts_crash_safe.result	2011-07-01 08:45:11 +0000
@@ -233,8 +233,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -273,8 +274,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -326,8 +328,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -353,8 +356,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -393,8 +397,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -446,8 +451,9 @@ SET @@global.slave_checkpoint_group= 1;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -486,8 +492,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -539,8 +546,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -579,8 +587,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -632,8 +641,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -672,8 +682,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -725,8 +736,9 @@ SET @@global.slave_checkpoint_group= 2;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -778,8 +790,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 0;
 SET @command= '';
@@ -831,8 +844,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 1;
 SET @command= '';
@@ -884,8 +898,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 2;
 SET @command= '';
@@ -937,8 +952,9 @@ SET @@global.slave_checkpoint_group= 3;
 SET GLOBAL debug="d,check_slave_debug_group";
 START SLAVE SQL_THREAD;
 include/rpl_reconnect.inc
-START SLAVE SQL_THREAD;
-include/stop_slave_sql.inc
+include/start_slave_io.inc
+include/start_slave_sql.inc
+include/stop_slave.inc
 SET @@global.slave_parallel_workers= 1;
 SET @@global.slave_checkpoint_period= 3;
 SET @command= '';

=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc	2011-06-29 07:04:19 +0000
+++ b/sql/rpl_rli.cc	2011-07-01 08:45:11 +0000
@@ -73,7 +73,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),
+   recovery_parallel_workers(0), checkpoint_seqno(0),
    checkpoint_group(mts_checkpoint_group), mts_recovery_group_cnt(0),
    mts_recovery_index(0), mts_recovery_group_seen_begin(0),
    mts_group_status(MTS_NOT_IN_GROUP),
@@ -238,22 +238,27 @@ void Relay_log_info::reset_notified_chec
       Reseting the notification information in order to force workers to
       assign jobs with the new updated information.
       Notice that the bitmap_shifted is accumulated to indicate how many
-      consecutive jobs were successfully processed. Then the worker when
-      assigning a new job will set the value back to zero.
+      consecutive jobs were successfully processed. 
+
+      The worker when assigning a new job will set the value back to
+      zero.
     */
     w->checkpoint_notified= FALSE;
-    w->bitmap_shifted= (shift == 0 ? 0 : w->bitmap_shifted + shift);
+    w->bitmap_shifted= w->bitmap_shifted + shift;
 
     DBUG_PRINT("Mts-reset_checkpoint", ("reset_notified_checkpoint shift "
                "--> %lu, worker->bitmap_shifted --> %lu, worker --> %u\n",
                shift, w->bitmap_shifted, i));  
   }
   /*
-    The new checkpoint sequence is updated by subtracting the number
+    There should not be a call where (shift == 0 && checkpoint_seqno != 0).
+
+    Then the new checkpoint sequence is updated by subtracting the number
     of consecutive jobs that were successfully processed.
   */
-  checkpoint_seqno= (shift == 0 ? 0 : checkpoint_seqno - shift);
-  DBUG_PRINT("Mts-reset_checkpoint", ("reset_notified_checkpoint shift --> %lu, "
+  DBUG_ASSERT(!(shift == 0 && checkpoint_seqno != 0));
+  checkpoint_seqno= checkpoint_seqno - shift;
+  DBUG_PRINT("mts", ("reset_notified_checkpoint shift --> %lu, "
              "checkpoint_seqno --> %u\n", shift, checkpoint_seqno));  
 
   if (new_ts)
@@ -1102,8 +1107,6 @@ void Relay_log_info::stmt_done(my_off_t
     DBUG_ASSERT(this_worker == NULL);
 
     flush_info(is_transactional() ? TRUE : FALSE); // TODO: ALFRANIO ERROR
-    if (is_parallel_exec())
-      reset_notified_checkpoint(0);
   }
 }
 
@@ -1276,7 +1279,7 @@ int Relay_log_info::init_info()
     if (hot_log)
       mysql_mutex_unlock(log_lock);
 
-    DBUG_RETURN(recovery_parallel_workers ?
+    DBUG_RETURN(recovery_parallel_workers && !is_mts_recovery() ?
                 mts_recovery_groups(this, &recovery_groups) : 0);
   }
 

=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	2011-06-27 17:31:45 +0000
+++ b/sql/rpl_rli_pdb.cc	2011-07-01 08:45:11 +0000
@@ -12,19 +12,39 @@
 */
 const char *info_slave_worker_fields []=
 {
-  "relay_log_name",
-  "relay_log_pos",
-  "master_log_name",
-  "master_log_pos",
+  /*
+    These positions identify what has been executed. Notice that they are
+    redudant and only the group_master_log_name and group_master_log_pos
+    are really necessary. However, the additional information is kept to
+    ease debugging.
+  */
+  "group_relay_log_name",
+  "group_relay_log_pos",
+  "group_master_log_name",
+  "group_master_log_pos",
 
-  // todo: remove the next four
+  /*
+    These positions identify what a worker knew about the coordinator at
+    the time a job was assigned. Notice that they are redudant and are
+    kept to ease debugging.
+  */
   "checkpoint_relay_log_name",
   "checkpoint_relay_log_pos",
   "checkpoint_master_log_name",
   "checkpoint_master_log_pos",
 
-  "checkpoint_seqno", // index of the last committed group in the bitmap
+  /*
+    Identify the greatest job, i.e. group, processed by a worker.
+  */
+  "checkpoint_seqno",
+  /*
+    Maximum number of jobs that can be assigned to a worker. This
+    information is necessary to read the next entry.
+  */
   "checkpoint_group_size",
+  /*
+    Bitmap used to identify what jobs were processed by a worker.
+  */
   "checkpoint_group_bitmap"
 };
 
@@ -241,7 +261,6 @@ bool Slave_worker::commit_positions(Log_
     my_free(ptr_g->checkpoint_relay_log_name);
     ptr_g->checkpoint_relay_log_name= NULL;
 
-    // TODO: shift `group_execed' << ptr_g->shifted
     bitmap_copy(&group_shifted, &group_execed);
     bitmap_clear_all(&group_execed);
     for (uint pos= ptr_g->shifted; pos < c_rli->checkpoint_group; pos++)
@@ -250,7 +269,9 @@ bool Slave_worker::commit_positions(Log_
         bitmap_set_bit(&group_execed, pos - ptr_g->shifted);
     }
   }
-  // extract an updated relay-log name to store in Worker's rli.
+  /*
+    Extracts an updated relay-log name to store in Worker's rli.
+  */
   if (ptr_g->group_relay_log_name)
   {
     DBUG_ASSERT(strlen(ptr_g->group_relay_log_name) + 1
@@ -258,11 +279,19 @@ bool Slave_worker::commit_positions(Log_
     strmake(group_relay_log_name, ptr_g->group_relay_log_name,
             sizeof(group_relay_log_name) - 1);
   }
+
+  DBUG_ASSERT(ptr_g->checkpoint_seqno <= (c_rli->checkpoint_group - 1));
   
   bitmap_set_bit(&group_execed, ptr_g->checkpoint_seqno);
   checkpoint_seqno= ptr_g->checkpoint_seqno;
   group_relay_log_pos= ev->future_event_relay_log_pos;
   group_master_log_pos= ev->log_pos;
+
+  /*
+    Directly accessing c_rli->get_group_master_log_name() does not
+    represent a concurrency issue because the current code places
+    a synchronization point when master rotates.
+  */
   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	2011-06-29 07:04:19 +0000
+++ b/sql/rpl_slave.cc	2011-07-01 08:45:11 +0000
@@ -390,8 +390,24 @@ int init_recovery(Master_info* mi, const
   Relay_log_info *rli= mi->rli;
   char *group_master_log_name= NULL;
 
+  if (rli->recovery_parallel_workers)
+  {
+    /*
+      This is not idempotent and a crash after this function and before
+      the recovery is actually done may lead the system to an inconsistent
+      state.
+
+      This may happen because the gap is not persitent stored anywhere
+      and eventually old relay log files will be removed and further
+      calculations on the gaps will be impossible.
+
+      We need to improve this. /Alfranio.
+    */
+    error= mts_recovery_groups(rli, &rli->recovery_groups);
+  }
+
   group_master_log_name= const_cast<char *>(rli->get_group_master_log_name());
-  if (group_master_log_name[0])
+  if (!error && group_master_log_name[0])
   {
     mi->set_master_log_pos(max(BIN_LOG_HEADER_SIZE,
                            rli->get_group_master_log_pos()));
@@ -2773,8 +2789,8 @@ int apply_event_and_update_pos(Log_event
     reason= ev->shall_skip(rli);
   }
 
-  DBUG_PRINT("Mts", ("Mts is recovering %d, number of bits set %d, "
-             "bitmap is set %d, index %lu.",
+  DBUG_PRINT("mts", ("Mts is recovering %d, number of bits set %d, "
+             "bitmap is set %d, index %lu.\n",
              rli->is_mts_recovery(), bitmap_bits_set(&rli->recovery_groups),
              bitmap_is_set(&rli->recovery_groups, rli->mts_recovery_index),
              rli->mts_recovery_index));
@@ -2936,7 +2952,7 @@ int apply_event_and_update_pos(Log_event
       rli->inc_event_relay_log_pos();
     }
 
-    if (!error && rli->is_mts_recovery() && 
+    if (!error && rli->is_mts_recovery() &&
         ev->get_type_code() != ROTATE_EVENT &&
         ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
     {
@@ -3895,6 +3911,9 @@ bool mts_recovery_groups(Relay_log_info
   LOG_INFO linfo;
   my_off_t offset= 0;
 
+  /*
+    Save relay log position to compare with worker's position.
+  */
   LOG_POS_COORD cp=
   {
     (char *) rli->get_group_master_log_name(),
@@ -6027,8 +6046,8 @@ static Log_event* next_event(Relay_log_i
       DBUG_PRINT("info", ("my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s",
                           llstr(my_b_tell(cur_log),llbuf1),
                           llstr(rli->get_event_relay_log_pos(),llbuf2)));
-      DBUG_ASSERT(my_b_tell(cur_log) >= BIN_LOG_HEADER_SIZE);
 
+      DBUG_ASSERT(my_b_tell(cur_log) >= BIN_LOG_HEADER_SIZE);
       DBUG_ASSERT(my_b_tell(cur_log) == rli->get_event_relay_log_pos() || rli->is_parallel_exec());
 
       DBUG_PRINT("info", ("next_event group master %s %lu group relay %s %lu event %s %lu\n",
@@ -6080,6 +6099,7 @@ static Log_event* next_event(Relay_log_i
           the checkpoint routine must be periodically invoked.
         */
         (void) mts_checkpoint_routine(rli, period, force, TRUE); // TODO: ALFRANIO ERROR
+        DBUG_ASSERT(!force || (force && (rli->checkpoint_seqno <= (rli->checkpoint_group - 1))));
         mysql_mutex_lock(&rli->data_lock);
       }
       DBUG_RETURN(ev);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-next-mr-wl5569 branch (alfranio.correia:3329 to 3330) Alfranio Correia4 Jul