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

 3324 Alfranio Correia	2011-06-27
      Ensured that updates to the worker_info_repository are transactional and fixed
      the slave_checkpoint_group_basic test case.

    modified:
      mysql-test/extra/rpl_tests/rpl_crash_safe.inc
      mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_row_crash_safe.test
      mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test
      mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result
      mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test
      sql/log_event.cc
      sql/rpl_slave.cc
=== modified file 'mysql-test/extra/rpl_tests/rpl_crash_safe.inc'
--- a/mysql-test/extra/rpl_tests/rpl_crash_safe.inc	2011-06-16 00:32:37 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_crash_safe.inc	2011-06-27 12:12:52 +0000
@@ -107,8 +107,9 @@ if (`SELECT HEX(@commands) != HEX('')`)
   #
   connection master;
   sync_slave_with_master;
+
   --let $slave_after= `SELECT master_log_pos FROM mysql.slave_relay_log_info`
-  if (`SELECT $slave_after != $master_after && @@GLOBAL.slave_parallel_workers = 0`)
+  if (`SELECT $slave_after != $master_after`)
   {
     --echo Slave is out of sync.
     --echo MASTER_BEFORE $master_before MASTER_AFTER $master_after SLAVE_BEFORE $slave_before SLAVE_AFTER $slave_after

=== modified file 'mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt	2011-06-09 17:35:59 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt	2011-06-27 12:12:52 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --slave-worker-info-repository=TABLE

=== modified file 'mysql-test/suite/rpl/t/rpl_row_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_row_crash_safe.test	2011-06-17 01:24:59 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_crash_safe.test	2011-06-27 12:12:52 +0000
@@ -4,7 +4,6 @@
 --source include/have_debug.inc
 --source include/have_innodb.inc
 --source include/have_binlog_format_row.inc
---source include/not_mts_slave_parallel_workers.inc
 
 call mtr.add_suppression('Attempting backtrace');
 call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt	2011-06-09 17:35:59 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt	2011-06-27 12:12:52 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --slave-worker-info-repository=TABLE

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test	2011-06-17 01:24:59 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test	2011-06-27 12:12:52 +0000
@@ -4,7 +4,6 @@
 --source include/have_debug.inc
 --source include/have_innodb.inc
 --source include/have_binlog_format_mixed_or_statement.inc
---source include/not_mts_slave_parallel_workers.inc
 
 call mtr.add_suppression('Attempting backtrace');
 call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");

=== modified file 'mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result'
--- a/mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result	2011-06-15 17:12:11 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result	2011-06-27 12:12:52 +0000
@@ -19,13 +19,11 @@ SLAVE_CHECKPOINT_GROUP	512
 select * from information_schema.session_variables where variable_name='slave_checkpoint_group';
 VARIABLE_NAME	VARIABLE_VALUE
 SLAVE_CHECKPOINT_GROUP	512
-set global slave_checkpoint_group=1;
-Warnings:
-Warning	1292	Truncated incorrect slave_checkpoint_group value: '1'
+set global slave_checkpoint_group=1024;
 select @@global.slave_checkpoint_group;
 @@global.slave_checkpoint_group
-512
-set session slave_checkpoint_group=1;
+1024
+set session slave_checkpoint_group=1024;
 ERROR HY000: Variable 'slave_checkpoint_group' is a GLOBAL variable and should be set with SET GLOBAL
 set global slave_checkpoint_group=1.1;
 ERROR 42000: Incorrect argument type to variable 'slave_checkpoint_group'
@@ -36,15 +34,9 @@ ERROR 42000: Incorrect argument type to
 set global slave_checkpoint_group=0;
 Warnings:
 Warning	1292	Truncated incorrect slave_checkpoint_group value: '0'
-select @@global.slave_checkpoint_group;
-@@global.slave_checkpoint_group
-512
 set global slave_checkpoint_group=cast(-1 as unsigned int);
 Warnings:
 Warning	1292	Truncated incorrect slave_checkpoint_group value: '18446744073709551615'
-select @@global.slave_checkpoint_group;
-@@global.slave_checkpoint_group
-4294967288
 SET @@global.slave_checkpoint_group = @start_global_value;
 SELECT @@global.slave_checkpoint_group;
 @@global.slave_checkpoint_group

=== modified file 'mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test'
--- a/mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test	2011-06-15 17:12:11 +0000
+++ b/mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test	2011-06-27 12:12:52 +0000
@@ -17,10 +17,10 @@ select * from information_schema.session
 #
 # show that it's writable
 #
-set global slave_checkpoint_group=1;
+set global slave_checkpoint_group=1024;
 select @@global.slave_checkpoint_group;
 --error ER_GLOBAL_VARIABLE
-set session slave_checkpoint_group=1;
+set session slave_checkpoint_group=1024;
 
 #
 # incorrect types
@@ -36,9 +36,7 @@ set global slave_checkpoint_group="foo";
 # min/max values
 #
 set global slave_checkpoint_group=0;
-select @@global.slave_checkpoint_group;
 set global slave_checkpoint_group=cast(-1 as unsigned int);
-select @@global.slave_checkpoint_group;
 
 SET @@global.slave_checkpoint_group = @start_global_value;
 SELECT @@global.slave_checkpoint_group;

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2011-06-25 14:14:24 +0000
+++ b/sql/log_event.cc	2011-06-27 12:12:52 +0000
@@ -7046,6 +7046,16 @@ int Xid_log_event::do_apply_event_worker
   int error= 0;
   bool is_trans_repo= w->is_transactional();
 
+  DBUG_EXECUTE_IF("crash_before_update_pos", DBUG_SUICIDE(););
+
+  DBUG_PRINT("mts", ("do_apply group master %s %llu  group relay %s %llu event %s %llu.",
+    w->group_master_log_name,
+    w->group_master_log_pos,
+    w->group_relay_log_name,
+    w->group_relay_log_pos,
+    w->event_relay_log_name,
+    w->event_relay_log_pos));
+
   if (is_trans_repo)
   {
     ulong gaq_idx= mts_group_cnt;
@@ -7055,7 +7065,19 @@ int Xid_log_event::do_apply_event_worker
     if ((error= w->commit_positions(this, ptr_g)))
       goto err;
   }
+
+  DBUG_PRINT("mts", ("do_apply group master %s %llu  group relay %s %llu event %s %llu.",
+    w->group_master_log_name,
+    w->group_master_log_pos,
+    w->group_relay_log_name,
+    w->group_relay_log_pos,
+    w->event_relay_log_name,
+    w->event_relay_log_pos));
+
+  DBUG_EXECUTE_IF("crash_after_update_pos_before_apply", DBUG_SUICIDE(););
+
   error= trans_commit(thd); /* Automatically rolls back on error. */
+  DBUG_EXECUTE_IF("crash_after_apply", DBUG_SUICIDE(););
   thd->mdl_context.release_transactional_locks();
 
 err:
@@ -7084,13 +7106,13 @@ int Xid_log_event::do_apply_event(Relay_
     mysql_mutex_lock(&rli_ptr->data_lock);
   }
 
-  DBUG_PRINT("info", ("do_apply group master %s %lu  group relay %s %lu event %s %lu\n",
+  DBUG_PRINT("info", ("do_apply group master %s %llu  group relay %s %llu event %s %llu\n",
     rli_ptr->get_group_master_log_name(),
-    (ulong) rli_ptr->get_group_master_log_pos(),
+    rli_ptr->get_group_master_log_pos(),
     rli_ptr->get_group_relay_log_name(),
-    (ulong) rli_ptr->get_group_relay_log_pos(),
+    rli_ptr->get_group_relay_log_pos(),
     rli_ptr->get_event_relay_log_name(),
-    (ulong) rli_ptr->get_event_relay_log_pos()));
+    rli_ptr->get_event_relay_log_pos()));
 
   DBUG_EXECUTE_IF("crash_before_update_pos", DBUG_SUICIDE(););
 
@@ -7114,13 +7136,13 @@ int Xid_log_event::do_apply_event(Relay_
       goto err;
   }
 
-  DBUG_PRINT("info", ("do_apply group master %s %lu  group relay %s %lu event %s %lu\n",
+  DBUG_PRINT("info", ("do_apply group master %s %llu  group relay %s %llu event %s %llu\n",
     rli_ptr->get_group_master_log_name(),
-    (ulong) rli_ptr->get_group_master_log_pos(),
+    rli_ptr->get_group_master_log_pos(),
     rli_ptr->get_group_relay_log_name(),
-    (ulong) rli_ptr->get_group_relay_log_pos(),
+    rli_ptr->get_group_relay_log_pos(),
     rli_ptr->get_event_relay_log_name(),
-    (ulong) rli_ptr->get_event_relay_log_pos()));
+    rli_ptr->get_event_relay_log_pos()));
 
   DBUG_EXECUTE_IF("crash_after_update_pos_before_apply", DBUG_SUICIDE(););
 

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-06-25 14:14:24 +0000
+++ b/sql/rpl_slave.cc	2011-06-27 12:12:52 +0000
@@ -3775,6 +3775,13 @@ pthread_handler_t handle_slave_worker(vo
   threads.append(thd);
   mysql_mutex_unlock(&LOCK_thread_count);
 
+  if (w->update_is_transactional())
+  {
+    rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+                "Error checking if the worker repository is transactional.");
+    goto err;
+  }
+
   mysql_mutex_lock(&w->jobs_lock);
   w->running_status= Slave_worker::RUNNING;
   mysql_cond_signal(&w->jobs_cond);
@@ -4592,6 +4599,9 @@ pthread_handler_t handle_slave_sql(void
     goto err;
   }
 
+  /*
+    TODO: ALFRANIO: If workers are active, we also need to check them.
+  */
   if (!rli->is_transactional())
     rli->report(WARNING_LEVEL, 0,
     "If a crash happens this configuration does not guarantee that the relay "


Attachment: [text/bzr-bundle] bzr/alfranio.correia@oracle.com-20110627121252-u4ejo1tmrjkd6zmi.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3324) Alfranio Correia27 Jun