List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:July 26 2011 6:48pm
Subject:bzr push into mysql-next-mr-wl5569 branch (alfranio.correia:3358 to 3359)
View as plain text  
 3359 Alfranio Correia	2011-07-26
      Added a test case that checks if MTS allows to concurrently access the replication
      tables, and as such, concurrently commit transactions that update different
      databases.

    added:
      mysql-test/suite/rpl/r/rpl_mts_check_concurrency.result
      mysql-test/suite/rpl/t/rpl_mts_check_concurrency-slave.opt
      mysql-test/suite/rpl/t/rpl_mts_check_concurrency.test
    modified:
      sql/rpl_info_handler.h
      sql/rpl_info_table.cc
      sql/rpl_rli_pdb.cc
      sql/rpl_rli_pdb.h
 3358 Alfranio Correia	2011-07-22
      Configured rpl_parallel_switch_sequential to run in row and mixed mode to avoid
      cluttering the error log with messages on unsafe execution. 

    modified:
      mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test
=== added file 'mysql-test/suite/rpl/r/rpl_mts_check_concurrency.result'
--- a/mysql-test/suite/rpl/r/rpl_mts_check_concurrency.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mts_check_concurrency.result	2011-07-26 18:46:41 +0000
@@ -0,0 +1,21 @@
+include/master-slave.inc
+[connection master]
+CREATE DATABASE db_1;
+CREATE DATABASE db_2;
+CREATE TABLE db_1.test_1 (id INTEGER) engine=Innodb;
+CREATE TABLE db_2.test_1 (id INTEGER) engine=Innodb;
+include/stop_slave.inc
+SET @@global.slave_parallel_workers= 2;
+ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
+ALTER TABLE mysql.slave_worker_info ENGINE= Innodb;
+include/start_slave.inc
+SET GLOBAL debug="d,mts_debug_concurrent_access";
+INSERT INTO db_1.test_1 VALUES(1);
+INSERT INTO db_2.test_1 VALUES(1);
+DROP DATABASE db_1;
+DROP DATABASE db_2;
+include/stop_slave.inc
+SET @@global.slave_parallel_workers= 0;
+SET @@global.debug= "";
+include/start_slave.inc
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_mts_check_concurrency-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_mts_check_concurrency-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mts_check_concurrency-slave.opt	2011-07-26 18:46:41 +0000
@@ -0,0 +1 @@
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE

=== added file 'mysql-test/suite/rpl/t/rpl_mts_check_concurrency.test'
--- a/mysql-test/suite/rpl/t/rpl_mts_check_concurrency.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mts_check_concurrency.test	2011-07-26 18:46:41 +0000
@@ -0,0 +1,48 @@
+################################################################################
+# This test case checks if MTS allows to concurrently access the replication
+# tables, and as such, concurrently commit transactions that update different
+# databases.
+#
+# It does so by making the workers' threads to sleep after updating replication
+# tables but before releasing locks and committing the current transaction.
+################################################################################
+
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+
+--connection master
+CREATE DATABASE db_1;
+CREATE DATABASE db_2;
+
+CREATE TABLE db_1.test_1 (id INTEGER) engine=Innodb;
+CREATE TABLE db_2.test_1 (id INTEGER) engine=Innodb;
+
+--connection master
+--sync_slave_with_master
+
+--connection slave
+--source include/stop_slave.inc
+--let $save_slave_parallel_workers= `SELECT @@global.slave_parallel_workers`
+--let $save_debug= `SELECT @@global.debug`
+SET @@global.slave_parallel_workers= 2;
+ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
+ALTER TABLE mysql.slave_worker_info ENGINE= Innodb;
+--source include/start_slave.inc
+
+--connection master
+--sync_slave_with_master
+SET GLOBAL debug="d,mts_debug_concurrent_access";
+
+--connection master
+INSERT INTO db_1.test_1 VALUES(1);
+INSERT INTO db_2.test_1 VALUES(1);
+DROP DATABASE db_1;
+DROP DATABASE db_2;
+--sync_slave_with_master
+
+--source include/stop_slave.inc
+--eval SET @@global.slave_parallel_workers= $save_slave_parallel_workers
+--eval SET @@global.debug= "$save_debug"
+--source include/start_slave.inc
+--source include/rpl_end.inc

=== modified file 'sql/rpl_info_handler.h'
--- a/sql/rpl_info_handler.h	2011-07-08 06:44:35 +0000
+++ b/sql/rpl_info_handler.h	2011-07-26 18:46:41 +0000
@@ -371,4 +371,8 @@ private:
 
   Rpl_info_handler& operator=(const Rpl_info_handler& handler);
 };
+#ifndef DBUG_OFF
+ extern ulong w_rr;
+ extern uint mts_debug_concurrent_access;
+#endif
 #endif /* RPL_INFO_HANDLER_H */

=== modified file 'sql/rpl_info_table.cc'
--- a/sql/rpl_info_table.cc	2011-07-08 06:44:35 +0000
+++ b/sql/rpl_info_table.cc	2011-07-26 18:46:41 +0000
@@ -198,6 +198,18 @@ int Rpl_info_table::do_flush_info(const
   }
 
 end:
+  DBUG_EXECUTE_IF("mts_debug_concurrent_access",
+    {
+      while (mts_debug_concurrent_access < 2 && mts_debug_concurrent_access >  0)
+      {
+        DBUG_PRINT("mts", ("Waiting while locks are acquired to show "
+          "concurrency in mts: %u %lu\n", mts_debug_concurrent_access,
+          (ulong) thd->thread_id));
+        my_sleep(6000000);
+      }
+    };
+  );
+
   /*
     Unlocks and closes the rpl_info table.
   */

=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	2011-07-19 19:26:30 +0000
+++ b/sql/rpl_rli_pdb.cc	2011-07-26 18:46:41 +0000
@@ -8,6 +8,7 @@
 
 #ifndef DBUG_OFF
   ulong w_rr= 0;
+  uint mts_debug_concurrent_access= 0;
 #endif
 
 /*
@@ -355,6 +356,12 @@ bool Slave_worker::commit_positions(Log_
              "group master log name %s checkpoint sequence number %lu.",
              id, group_master_log_pos, group_master_log_name, checkpoint_seqno));
 
+  DBUG_EXECUTE_IF("mts_debug_concurrent_access",
+    {
+      mts_debug_concurrent_access++;
+    };
+  );
+
   DBUG_RETURN(flush_info(force));
 }
 

=== modified file 'sql/rpl_rli_pdb.h'
--- a/sql/rpl_rli_pdb.h	2011-07-16 21:51:45 +0000
+++ b/sql/rpl_rli_pdb.h	2011-07-26 18:46:41 +0000
@@ -364,10 +364,5 @@ private:
 
 TABLE* mts_move_temp_table_to_entry(TABLE*, THD*, db_worker_hash_entry*);
 TABLE* mts_move_temp_tables_to_thd(THD*, TABLE*);
-
 #endif // HAVE_REPLICATION
-
-#ifndef DBUG_OFF
-  extern ulong w_rr;
-#endif
 #endif

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