List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:June 15 2011 5:12pm
Subject:bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3291) WL#5569
View as plain text  
#At file:///home/andrei/MySQL/BZR/2a-23May/WL/mysql-next-mr-wl5569/ based on revid:alfranio.correia@stripped

 3291 Andrei Elkin	2011-06-15
      wl#5569 MTS
      
      Cleanup, including
      
      1. decreasing number and renaming system variables.
         Important for debugging command line options are replaced with reasonble constant values 
         and only necessary are retained.
      
      2. Small encapsulation in ha_blackhole.cc is done.
     @ mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test
        cleanup.
     @ mysql-test/extra/rpl_tests/rpl_parallel_load.test
        cleanup.
     @ mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test
        cleanup.
     @ mysql-test/r/mysqld--help-notwin.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_benchmark.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_conflicts.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_ddl.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_multi_db.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
        cleanup.
     @ mysql-test/suite/rpl/r/rpl_parallel_temp_query.result
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_benchmark.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_conflicts.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_ddl.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_innodb.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_multi_db.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
        cleanup.
     @ mysql-test/suite/rpl/t/rpl_parallel_temp_query.test
        cleanup.
     @ mysql-test/suite/sys_vars/r/all_vars.result
        cleanup.
     @ mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result
        cleanup.
     @ mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result
        cleanup.
     @ mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result
        cleanup.
     @ mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test
        cleanup.
     @ mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test
        cleanup.
     @ sql/log_event.cc
        removing experimental (for benchmarking) mts_slave_local_timestamp option.
     @ sql/mysqld.cc
        few debugging time options are replaced with constants.
        Interface-variables are non needed anymore.
     @ sql/mysqld.h
        few debugging time options are replaced with constants.
        Interface-variables are non needed anymore.
     @ sql/rpl_rli_pdb.cc
        few debugging time options are replaced with constants.
     @ sql/rpl_slave.cc
        few debugging time options are replaced with constants.
     @ sql/sys_vars.cc
        few debugging time options are replaced with constants;
        renaming the rest that deal with MTS to be prefixed with `slave_'.

    renamed:
      mysql-test/include/not_worker_info_table.inc => mysql-test/include/not_slave_worker_info_table.inc
      mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result => mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result
      mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result => mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result
      mysql-test/suite/sys_vars/r/worker_info_repository_basic.result => mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result
      mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test => mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test
      mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test => mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test
      mysql-test/suite/sys_vars/t/worker_info_repository_basic.test => mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test
    modified:
      mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test
      mysql-test/extra/rpl_tests/rpl_parallel_load.test
      mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/suite/rpl/r/rpl_parallel_benchmark.result
      mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result
      mysql-test/suite/rpl/r/rpl_parallel_conflicts.result
      mysql-test/suite/rpl/r/rpl_parallel_ddl.result
      mysql-test/suite/rpl/r/rpl_parallel_innodb.result
      mysql-test/suite/rpl/r/rpl_parallel_multi_db.result
      mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result
      mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
      mysql-test/suite/rpl/r/rpl_parallel_temp_query.result
      mysql-test/suite/rpl/t/rpl_parallel.test
      mysql-test/suite/rpl/t/rpl_parallel_benchmark.test
      mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test
      mysql-test/suite/rpl/t/rpl_parallel_conflicts.test
      mysql-test/suite/rpl/t/rpl_parallel_ddl.test
      mysql-test/suite/rpl/t/rpl_parallel_innodb.test
      mysql-test/suite/rpl/t/rpl_parallel_multi_db.test
      mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test
      mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
      mysql-test/suite/rpl/t/rpl_parallel_temp_query.test
      mysql-test/suite/sys_vars/r/all_vars.result
      sql/log_event.cc
      sql/mysqld.cc
      sql/mysqld.h
      sql/rpl_rli_pdb.cc
      sql/rpl_slave.cc
      sql/sys_vars.cc
      storage/blackhole/ha_blackhole.cc
      mysql-test/include/not_slave_worker_info_table.inc
      mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result
      mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result
      mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result
      mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test
      mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test
      mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test
=== modified file 'mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test'
--- a/mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test	2011-06-12 17:36:17 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test	2011-06-15 17:12:11 +0000
@@ -253,8 +253,9 @@ insert into test1.benchmark set state='s
 # To force filling timestamp cols with the slave local clock values
 # to implement benchmarking.
 
-set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
-set @@global.mts_exp_slave_local_timestamp=1;
+# TODO: replace with another alg
+#set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
+#set @@global.mts_exp_slave_local_timestamp=1;
 
 --sleep 1
 
@@ -305,7 +306,3 @@ drop procedure one_session;
 --enable_query_log
 
 sync_slave_with_master;
-#connection slave;
-set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
-
-# End of the tests

=== modified file 'mysql-test/extra/rpl_tests/rpl_parallel_load.test'
--- a/mysql-test/extra/rpl_tests/rpl_parallel_load.test	2011-05-06 18:33:32 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_parallel_load.test	2011-06-15 17:12:11 +0000
@@ -239,11 +239,13 @@ connection slave;
 
 insert into test0.benchmark set state='slave is processing load';
 
+# todo: replace with another algorithm of measuring time
 # To force filling timestamp cols with the slave local clock values
 # to implement benchmarking.
 
-set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
-set @@global.mts_exp_slave_local_timestamp=1;
+#set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
+#set @@global.mts_exp_slave_local_timestamp=1;
+
 start slave sql_thread;
 
 let $wait_timeout= 600;
@@ -306,7 +308,3 @@ drop procedure one_session;
 --enable_query_log
 
 sync_slave_with_master;
-#connection slave;
-set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
-
-# End of the tests

=== modified file 'mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test'
--- a/mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test	2011-05-30 10:05:07 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test	2011-06-15 17:12:11 +0000
@@ -265,8 +265,9 @@ insert into test0.benchmark set state='s
 # To force filling timestamp cols with the slave local clock values
 # to implement benchmarking.
 
-set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
-set @@global.mts_exp_slave_local_timestamp=1;
+# TODO: replace with another algorithm
+#set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
+#set @@global.mts_exp_slave_local_timestamp=1;
 start slave sql_thread;
 
 let $wait_timeout= 600;
@@ -327,7 +328,4 @@ while($i)
 --enable_query_log
 
 sync_slave_with_master;
-#connection slave;
-set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
 
-# End of the tests

=== renamed file 'mysql-test/include/not_worker_info_table.inc' => 'mysql-test/include/not_slave_worker_info_table.inc'
--- a/mysql-test/include/not_worker_info_table.inc	2010-12-09 13:23:19 +0000
+++ b/mysql-test/include/not_slave_worker_info_table.inc	2011-06-15 17:12:11 +0000
@@ -1,4 +1,4 @@
-if (`SELECT @@GLOBAL.worker_info_repository = 'TABLE'`)
+if (`SELECT @@GLOBAL.slave_worker_info_repository = 'TABLE'`)
 {
      skip Test cannot run with worker.info repository table;
 }

=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	2011-06-09 15:27:47 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2011-06-15 17:12:11 +0000
@@ -277,8 +277,6 @@ The following options may be given as th
  If set to 1 table names are stored in lowercase on disk
  and table names will be case-insensitive.  Should be set
  to 2 if you are using a case insensitive file system
- --master-info-engine=name 
- The storage engine for the master info repository
  --master-info-file=name 
  The location and name of the file that remembers the
  master and where the I/O replication thread is in the
@@ -348,41 +346,6 @@ The following options may be given as th
  --min-examined-row-limit=# 
  Don't write queries to slow log that examine fewer rows
  than that
- --mts-checkpoint-group=# 
- Define the number of transactions before a checkpoint
- operation is called.
- --mts-checkpoint-period=# 
- Gather workers' activities to flush the relay log info to
- disk after every #th milli-seconds. The zero value
- disables the checkpoint routine (makes sense for
- debugging).
- --mts-coordinator-basic-nap=# 
- Time in msec to sleep by MTS Coordinator to avoid the
- Worker queues room overrun
- --mts-exp-slave-local-timestamp 
- If enabled slave itself computes the event appying time
- value to implicitly affected timestamp columms. Otherwise
- (default) it installs prescribed by the master value
- --mts-partition-hash-soft-max=# 
- Number of records in the mts partition hash below which
- entries with zero usage are tolerated
- --mts-pending-jobs-size-max=# 
- Max size of Slave Worker queues holding yet not applied
- events.The least possible value must be not less than the
- master size max_allowed_packet.
- --mts-slave-parallel-workers=# 
- Number of worker threads for executing events in parallel
- --mts-slave-worker-queue-len-max=# 
- Max length of one MTS Worker queue. Presence in the queue
- indicates a replication event was read out of Relay log
- and not yet applied. Notice the max size of event data in
- all queues are governed by mts_pending_jobs_size_max.
- Whichever limit is reached Coordinator threadsuspends
- further jobs assigning until conditions have been
- improved.
- --mts-worker-underrun-level=# 
- percent of Worker queue size at which Worker is
- considered to become hungry
  --multi-range-count=# 
  Number of key ranges to request at once
  --myisam-block-size=# 
@@ -559,8 +522,6 @@ The following options may be given as th
  --relay-log=name    The location and name to use for relay logs
  --relay-log-index=name 
  File that holds the names for relay log files.
- --relay-log-info-engine=name 
- The storage engine for the relay info repository
  --relay-log-info-file=name 
  The location and name of the file that remembers where
  the SQL replication thread is in the relay logs
@@ -677,6 +638,15 @@ The following options may be given as th
  Don't allow 'SHOW DATABASE' commands
  --skip-slave-start  If set, slave is not autostarted.
  --skip-stack-trace  Don't print a stack trace on failure.
+ --slave-checkpoint-group=# 
+ Maximum number of processed transactions by
+ Multi-threaded slave before a checkpoint operation is
+ called to update progress status.
+ --slave-checkpoint-period=# 
+ Gather workers' activities to Update progress status of
+ Multi-threaded slave and flush the relay log info to disk
+ after every #th milli-seconds. The zero value disables
+ the checkpoint routine (makes sense for debugging).
  --slave-compressed-protocol 
  Use compression on master/slave protocol
  --slave-exec-mode=name 
@@ -692,6 +662,12 @@ The following options may be given as th
  --slave-net-timeout=# 
  Number of seconds to wait for more data from a
  master/slave connection before aborting the read
+ --slave-parallel-workers=# 
+ Number of worker threads for executing events in parallel
+ --slave-pending-jobs-size-max=# 
+ Max size of Slave Worker queues holding yet not applied
+ events.The least possible value must be not less than the
+ master side max_allowed_packet.
  --slave-skip-errors=name 
  Tells the slave thread to continue replication when a
  query event returns an error from the provided list
@@ -712,6 +688,9 @@ The following options may be given as th
  ALL_NON_LOSSY to enable non-lossy conversions. If the
  variable is assigned the empty set, no conversions are
  allowed and it is expected that the types match exactly.
+ --slave-worker-info-repository=name 
+ Defines the type of the repository for the worker
+ information.
  --slow-launch-time=# 
  If creating the thread takes longer than this value (in
  seconds), the Slow_launch_threads counter will be
@@ -795,11 +774,6 @@ The following options may be given as th
  -V, --version       Output version information and exit.
  --wait-timeout=#    The number of seconds the server waits for activity on a
  connection before closing it
- --worker-info-engine=name 
- The storage engine for the worker info repository
- --worker-info-repository=name 
- Defines the type of the repository for the worker
- information.
 
 Variables (--variable-name=value)
 abort-slave-event-count 0
@@ -890,7 +864,6 @@ log-warnings 1
 long-query-time 10
 low-priority-updates FALSE
 lower-case-table-names 1
-master-info-engine (No default value)
 master-info-file master.info
 master-info-repository FILE
 master-retry-count 86400
@@ -917,15 +890,6 @@ max-user-connections 0
 max-write-lock-count 18446744073709551615
 memlock FALSE
 min-examined-row-limit 0
-mts-checkpoint-group 512
-mts-checkpoint-period 300
-mts-coordinator-basic-nap 5
-mts-exp-slave-local-timestamp FALSE
-mts-partition-hash-soft-max 16
-mts-pending-jobs-size-max 16777216
-mts-slave-parallel-workers 0
-mts-slave-worker-queue-len-max 40000
-mts-worker-underrun-level 0
 multi-range-count 256
 myisam-block-size 1024
 myisam-data-pointer-size 6
@@ -991,7 +955,6 @@ read-only FALSE
 read-rnd-buffer-size 262144
 relay-log (No default value)
 relay-log-index (No default value)
-relay-log-info-engine (No default value)
 relay-log-info-file relay-log.info
 relay-log-info-repository FILE
 relay-log-purge TRUE
@@ -1012,13 +975,18 @@ skip-name-resolve FALSE
 skip-networking FALSE
 skip-show-database FALSE
 skip-slave-start FALSE
+slave-checkpoint-group 512
+slave-checkpoint-period 300
 slave-compressed-protocol FALSE
 slave-exec-mode STRICT
 slave-net-timeout 3600
+slave-parallel-workers 0
+slave-pending-jobs-size-max 16777216
 slave-skip-errors (No default value)
 slave-sql-verify-checksum TRUE
 slave-transaction-retries 10
 slave-type-conversions 
+slave-worker-info-repository FILE
 slow-launch-time 2
 slow-query-log FALSE
 sort-buffer-size 2097152
@@ -1047,8 +1015,6 @@ transaction-prealloc-size 4096
 updatable-views-with-limit YES
 verbose TRUE
 wait-timeout 28800
-worker-info-engine (No default value)
-worker-info-repository FILE
 
 To see what values a running MySQL server is using, type
 'mysqladmin variables' instead of 'mysqld --verbose --help'.

=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	2011-06-09 15:27:47 +0000
+++ b/mysql-test/r/mysqld--help-win.result	2011-06-15 17:12:11 +0000
@@ -347,44 +347,6 @@ The following options may be given as th
  --min-examined-row-limit=# 
  Don't write queries to slow log that examine fewer rows
  than that
- --mts-checkpoint-group=# 
- Define the number of transactions before a checkpoint
- operation is called.
- --mts-checkpoint-period=# 
- Gather workers' activities to flush the relay log info to
- disk after every #th milli-seconds. The zero value
- disables the checkpoint routine (makes sense for
- debugging).
- --mts-coordinator-basic-nap=# 
- Time in msec to sleep by MTS Coordinator to avoid the
- Worker queues room overrun
- --mts-exp-slave-local-timestamp 
- If enabled slave itself computes the event appying time
- value to implicitly affected timestamp columms. Otherwise
- (default) it installs prescribed by the master value
- --mts-exp-slave-run-query-in-parallel 
- The default not an actual database name is used as
- partition info for parallel execution of Query_log_event 
- --mts-partition-hash-soft-max=# 
- Number of records in the mts partition hash below which
- entries with zero usage are tolerated
- --mts-pending-jobs-size-max=# 
- Max size of Slave Worker queues holding yet not applied
- events.The least possible value must be not less than the
- master size max_allowed_packet.
- --mts-slave-parallel-workers=# 
- Number of worker threads for executing events in parallel
- --mts-slave-worker-queue-len-max=# 
- Max length of one MTS Worker queue. Presence in the queue
- indicates a replication event was read out of Relay log
- and not yet applied. Notice the max size of event data in
- all queues are governed by mts_pending_jobs_size_max.
- Whichever limit is reached Coordinator threadsuspends
- further jobs assigning until conditions have been
- improved.
- --mts-worker-underrun-level=# 
- percent of Worker queue size at which Worker is
- considered to become hungry
  --multi-range-count=# 
  Number of key ranges to request at once
  --myisam-block-size=# 
@@ -802,9 +764,7 @@ The following options may be given as th
  -V, --version       Output version information and exit.
  --wait-timeout=#    The number of seconds the server waits for activity on a
  connection before closing it
- --worker-info-engine=name 
- The storage engine for the worker info repository
- --worker-info-repository=name 
+ --slave-worker-info-repository=name 
  Defines the type of the repository for the worker
  information.
 
@@ -923,16 +883,6 @@ max-user-connections 0
 max-write-lock-count 18446744073709551615
 memlock FALSE
 min-examined-row-limit 0
-mts-checkpoint-group 512
-mts-checkpoint-period 300
-mts-coordinator-basic-nap 5
-mts-exp-slave-local-timestamp FALSE
-mts-exp-slave-run-query-in-parallel FALSE
-mts-partition-hash-soft-max 16
-mts-pending-jobs-size-max 16777216
-mts-slave-parallel-workers 0
-mts-slave-worker-queue-len-max 40000
-mts-worker-underrun-level 0
 multi-range-count 256
 myisam-block-size 1024
 myisam-data-pointer-size 6
@@ -1022,9 +972,13 @@ skip-name-resolve FALSE
 skip-networking FALSE
 skip-show-database FALSE
 skip-slave-start FALSE
+slave-checkpoint-group 512
+slave-checkpoint-period 300
 slave-compressed-protocol FALSE
 slave-exec-mode STRICT
 slave-net-timeout 3600
+slave-parallel-workers 0
+slave-pending-jobs-size-max 16777216
 slave-skip-errors (No default value)
 slave-sql-verify-checksum TRUE
 slave-transaction-retries 10
@@ -1057,8 +1011,7 @@ transaction-prealloc-size 4096
 updatable-views-with-limit YES
 verbose TRUE
 wait-timeout 28800
-worker-info-engine (No default value)
-worker-info-repository FILE
+slave-worker-info-repository FILE
 
 To see what values a running MySQL server is using, type
 'mysqladmin variables' instead of 'mysqld --verbose --help'.

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_benchmark.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_benchmark.result	2011-06-12 17:36:17 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_benchmark.result	2011-06-15 17:12:11 +0000
@@ -1,6 +1,6 @@
 include/master-slave.inc
 [connection master]
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
 call mtr.add_suppression('Slave: Error dropping database');
 include/stop_slave.inc
 start slave;
@@ -13,5 +13,4 @@ select ts from test1.benchmark where sta
 select ts from test1.benchmark where state like 'slave ends load' into @s_1;
 select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m', 
 time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s' into outfile 'MYSQLD_DATADIR/delta.out';
-set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
 include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result	2011-06-15 17:12:11 +0000
@@ -4,187 +4,29 @@ create view coord_wait_list as
 SELECT id from Information_Schema.processlist
 where state like 'Waiting for Slave Worker%';
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
-set @save_mts_slave_worker_queue_len_max= @@global.mts_slave_worker_queue_len_max;
-set @@global.mts_slave_worker_queue_len_max= 5;
-include/start_slave.inc
-create database d0;
-create table d0.t1 (a int auto_increment primary key) engine=innodb;
-begin;
-insert into d0.t1 set a=null;
-begin;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-commit;
-*** Coordinator must be waiting a for Worker to process its queue ***
-rollback;
-set @@global.mts_slave_worker_queue_len_max= @save_mts_slave_worker_queue_len_max;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
+create view worker_wait_list as
+SELECT id from Information_Schema.processlist
+where state like 'Waiting for an event from sql thread%';
 include/stop_slave.inc
-set @save_mts_pending_jobs_size_max = @@global.mts_pending_jobs_size_max;
-set @@global.mts_pending_jobs_size_max= 1024;
+Warnings:
+Note	1255	Slave already has been stopped
+set @save_slave_pending_jobs_size_max = @@global.slave_pending_jobs_size_max;
+set @@global.slave_pending_jobs_size_max= 1024;
 include/start_slave.inc
-create table d0.t2 (a int auto_increment primary key, b text null) engine=innodb;
+Configured number of Workers is started.
+create database d0;
+create table d0.t0 (a int auto_increment primary key, b text null) engine=innodb;
 begin;
-insert into d0.t2 set a= 1;
+insert into d0.t0 set a= 1;
 begin;
 commit;
 *** Coordinator must be waiting for Workers have released pending events mem ***
 rollback;
-set @@global.mts_pending_jobs_size_max= @save_mts_pending_jobs_size_max;
-set @save.mts_partition_hash_soft_max= @@global.mts_partition_hash_soft_max;
-set @@global.mts_partition_hash_soft_max= 0;
-create database d16;
-create table d16.t1 (a int auto_increment primary key) engine=innodb;
-create database d15;
-create table d15.t1 (a int auto_increment primary key) engine=innodb;
-create database d14;
-create table d14.t1 (a int auto_increment primary key) engine=innodb;
-create database d13;
-create table d13.t1 (a int auto_increment primary key) engine=innodb;
-create database d12;
-create table d12.t1 (a int auto_increment primary key) engine=innodb;
-create database d11;
-create table d11.t1 (a int auto_increment primary key) engine=innodb;
-create database d10;
-create table d10.t1 (a int auto_increment primary key) engine=innodb;
-create database d9;
-create table d9.t1 (a int auto_increment primary key) engine=innodb;
-create database d8;
-create table d8.t1 (a int auto_increment primary key) engine=innodb;
-create database d7;
-create table d7.t1 (a int auto_increment primary key) engine=innodb;
-create database d6;
-create table d6.t1 (a int auto_increment primary key) engine=innodb;
-create database d5;
-create table d5.t1 (a int auto_increment primary key) engine=innodb;
-create database d4;
-create table d4.t1 (a int auto_increment primary key) engine=innodb;
-create database d3;
-create table d3.t1 (a int auto_increment primary key) engine=innodb;
-create database d2;
-create table d2.t1 (a int auto_increment primary key) engine=innodb;
-create database d1;
-create table d1.t1 (a int auto_increment primary key) engine=innodb;
-begin;
-insert into d16.t1 set a=null;
-insert into d16.t1 set a=null;
-insert into d16.t1 set a=null;
-insert into d16.t1 set a=null;
-commit;
-begin;
-insert into d15.t1 set a=null;
-insert into d15.t1 set a=null;
-insert into d15.t1 set a=null;
-insert into d15.t1 set a=null;
-commit;
-begin;
-insert into d14.t1 set a=null;
-insert into d14.t1 set a=null;
-insert into d14.t1 set a=null;
-insert into d14.t1 set a=null;
-commit;
-begin;
-insert into d13.t1 set a=null;
-insert into d13.t1 set a=null;
-insert into d13.t1 set a=null;
-insert into d13.t1 set a=null;
-commit;
-begin;
-insert into d12.t1 set a=null;
-insert into d12.t1 set a=null;
-insert into d12.t1 set a=null;
-insert into d12.t1 set a=null;
-commit;
-begin;
-insert into d11.t1 set a=null;
-insert into d11.t1 set a=null;
-insert into d11.t1 set a=null;
-insert into d11.t1 set a=null;
-commit;
-begin;
-insert into d10.t1 set a=null;
-insert into d10.t1 set a=null;
-insert into d10.t1 set a=null;
-insert into d10.t1 set a=null;
-commit;
-begin;
-insert into d9.t1 set a=null;
-insert into d9.t1 set a=null;
-insert into d9.t1 set a=null;
-insert into d9.t1 set a=null;
-commit;
-begin;
-insert into d8.t1 set a=null;
-insert into d8.t1 set a=null;
-insert into d8.t1 set a=null;
-insert into d8.t1 set a=null;
-commit;
-begin;
-insert into d7.t1 set a=null;
-insert into d7.t1 set a=null;
-insert into d7.t1 set a=null;
-insert into d7.t1 set a=null;
-commit;
-begin;
-insert into d6.t1 set a=null;
-insert into d6.t1 set a=null;
-insert into d6.t1 set a=null;
-insert into d6.t1 set a=null;
-commit;
-begin;
-insert into d5.t1 set a=null;
-insert into d5.t1 set a=null;
-insert into d5.t1 set a=null;
-insert into d5.t1 set a=null;
-commit;
-begin;
-insert into d4.t1 set a=null;
-insert into d4.t1 set a=null;
-insert into d4.t1 set a=null;
-insert into d4.t1 set a=null;
-commit;
-begin;
-insert into d3.t1 set a=null;
-insert into d3.t1 set a=null;
-insert into d3.t1 set a=null;
-insert into d3.t1 set a=null;
-commit;
-begin;
-insert into d2.t1 set a=null;
-insert into d2.t1 set a=null;
-insert into d2.t1 set a=null;
-insert into d2.t1 set a=null;
-commit;
-begin;
-insert into d1.t1 set a=null;
-insert into d1.t1 set a=null;
-insert into d1.t1 set a=null;
-insert into d1.t1 set a=null;
-commit;
-set @@global.mts_partition_hash_soft_max= @save.mts_partition_hash_soft_max;
-drop database d16;
-drop database d15;
-drop database d14;
-drop database d13;
-drop database d12;
-drop database d11;
-drop database d10;
-drop database d9;
-drop database d8;
-drop database d7;
-drop database d6;
-drop database d5;
-drop database d4;
-drop database d3;
-drop database d2;
-drop database d1;
+set @@global.slave_pending_jobs_size_max= @save_slave_pending_jobs_size_max;
 drop database d0;
 drop view coord_wait_list;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+drop view worker_wait_list;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_conflicts.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result	2011-06-15 17:12:11 +0000
@@ -2,8 +2,8 @@ include/master-slave.inc
 [connection master]
 create view coord_wait_list  as SELECT id from Information_Schema.processlist where state like 'Waiting for Slave Worker%';
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 include/start_slave.inc
 create database d1;
 create database d2;
@@ -71,6 +71,5 @@ drop database d1;
 drop database d2;
 drop database d3;
 drop view coord_wait_list;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
-*** End of the tests ***
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_ddl.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_ddl.result	2011-05-30 10:05:07 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_ddl.result	2011-06-15 17:12:11 +0000
@@ -1,8 +1,8 @@
 include/master-slave.inc
 [connection master]
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 include/start_slave.inc
 include/diff_tables.inc [master:d32.t8, slave:d32.t8]
 include/diff_tables.inc [master:d32.t7, slave:d32.t7]
@@ -260,4 +260,5 @@ include/diff_tables.inc [master:d1.t4, s
 include/diff_tables.inc [master:d1.t3, slave:d1.t3]
 include/diff_tables.inc [master:d1.t2, slave:d1.t2]
 include/diff_tables.inc [master:d1.t1, slave:d1.t1]
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_innodb.result	2011-06-15 14:59:23 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_innodb.result	2011-06-15 17:12:11 +0000
@@ -49,5 +49,4 @@ include/diff_tables.inc [master:test1.v_
 include/diff_tables.inc [master:test1.v_ti_wk, slave:test1.v_ti_wk]
 include/diff_tables.inc [master:test0.v_ti_nk, slave:test0.v_ti_nk]
 include/diff_tables.inc [master:test0.v_ti_wk, slave:test0.v_ti_wk]
-set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
 include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_multi_db.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result	2011-06-14 18:23:13 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result	2011-06-15 17:12:11 +0000
@@ -1,8 +1,8 @@
 include/master-slave.inc
 [connection master]
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 include/start_slave.inc
 create database d8;
 create table d8.t8 (a int);
@@ -368,6 +368,5 @@ include/diff_tables.inc [master:d4.t1, s
 include/diff_tables.inc [master:d3.t1, slave:d3.t1]
 include/diff_tables.inc [master:d2.t1, slave:d2.t1]
 include/diff_tables.inc [master:d1.t1, slave:d1.t1]
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 include/rpl_end.inc
-end of the tests

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result	2011-06-14 18:23:13 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result	2011-06-15 17:12:11 +0000
@@ -1,10 +1,10 @@
 include/master-slave.inc
 [connection master]
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
-set @save.mts_checkpoint_period= @@global.mts_checkpoint_period;
-set @@global.mts_checkpoint_period= 500;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
+set @save.slave_checkpoint_period= @@global.slave_checkpoint_period;
+set @@global.slave_checkpoint_period= 500;
 set @save.slave_transaction_retries= @@global.slave_transaction_retries;
 start slave io_thread;
 include/wait_for_slave_io_to_start.inc
@@ -27,8 +27,7 @@ Seconds_Behind_Master after first transa
 unlock tables;
 include/wait_for_slave_param.inc [Seconds_Behind_Master]
 drop tables t1, t2;
-set @@global.mts_checkpoint_period= @save.mts_checkpoint_period;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_checkpoint_period= @save.slave_checkpoint_period;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 set @@global.slave_transaction_retries= @save.slave_transaction_retries;
 include/rpl_end.inc
-end of the tests

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_start_stop.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result	2011-06-14 18:23:13 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result	2011-06-15 17:12:11 +0000
@@ -6,8 +6,8 @@ create view worker_proc_list as SELECT i
 where state like 'Waiting for an event from sql thread%';
 create view coord_proc_list  as SELECT id from Information_Schema.processlist where state like 'Slave has read all relay log%';
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 include/start_slave.inc
 select min(id) from worker_proc_list into @w_id;
 kill query @w_id;
@@ -74,7 +74,6 @@ drop table t2m;
 drop table t2;
 drop view worker_proc_list;
 drop view coord_proc_list;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 set @@global.slave_transaction_retries= @save.slave_transaction_retries;
 include/rpl_end.inc
-end of the tests

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_temp_query.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result	2011-05-30 10:05:07 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result	2011-06-15 17:12:11 +0000
@@ -3,8 +3,8 @@ include/master-slave.inc
 call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table.*');
 flush status;
 include/stop_slave.inc
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 include/start_slave.inc
 create database d2;
 use d2;
@@ -47,4 +47,4 @@ drop temporary table tt_1;
 drop database d4;
 drop database d3;
 include/stop_slave.inc
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel.test	2011-06-09 15:27:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test	2011-06-15 17:12:11 +0000
@@ -1,7 +1,7 @@
 #
-# WL#5563 Prototype for Parallel Slave with db name partitioning.
+# WL#5569 MTS
 #
-# The test checks correctness of replication and is designed for 
+# The test checks correctness of replication and can be used for 
 # benchmarking and comparision with results of its sequential
 # counterpart rpl_sequential.test.
 # Both tests leave mysqld.2/data/test/delta.out file
@@ -13,12 +13,6 @@
 #  The duration recorded in the file accounts the SQL thread/workers work.
 #  That is benchmarking on the slave side is effectively started with
 #  `start slave sql_thread'.
-#  NOTICE, there is set @@global.slave_local_timestamp=1;
-#  
-#
-# of load that rpl_parallel_load.test represents.
-# See there how to tune load and concurrency parameters.
-#
 # Example of usage.
 # To gather a collection of figures:
 #  mysql-test$ export slave;
@@ -39,8 +33,4 @@ let $rpl_skip_reset_master_and_slave= 1;
 connection master;
 source extra/rpl_tests/rpl_parallel_load.test;
 
-# TODO: sort out 
-# mysqltest: In included file "./include/rpl_end.inc": At line 70: Error running query 'SHOW SLAVE STATUS': 2006 MySQL server has gone away
-# --source include/rpl_end.inc
-
 --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_benchmark.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_benchmark.test	2011-04-02 11:32:02 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_benchmark.test	2011-06-15 17:12:11 +0000
@@ -1,36 +1,10 @@
 #
-# WL#5563 Prototype for Parallel Slave with db name partitioning.
+# WL#5569 MTS
 #
-# The test checks correctness of replication and is designed for 
-# benchmarking and comparision with results of its sequential
-# counterpart rpl_sequential.test.
-# Both tests leave mysqld.2/data/test/delta.out file
-# that contains a row with two columns.
-#  1. the duration (in seconds) of execution on the master
-#  2. the duration of execution on the slave
-#  The 2nd column of the rpl_parallel can be compared with the 2nd of rpl_sequential.test.
-#
-#  The duration recorded in the file accounts the SQL thread/workers work.
-#  That is benchmarking on the slave side is effectively started with
-#  `start slave sql_thread'.
-#  NOTICE, there is set @@global.slave_local_timestamp=1;
-#  
-#
-# of load that rpl_parallel_load.test represents.
-# See there how to tune load and concurrency parameters.
-#
-# Example of usage.
-# To gather a collection of figures:
-#  mysql-test$ export slave;
-#  mysql-test$ slave=parallel; for n in `seq 1 10`; 
-#  do ./mtr  --vardir=/dev/shm/var1 --mtr-build-thread=765 rpl_$slave 
-#             --mysqld=--binlog-format=statement; 
-#     find /dev/shm/var1 -name delta.out -exec cat {} \; | cat >> delta.$slave.log; 
-#  done
-#
-# mysql-test$ slave=sequential; ...
-#
-# In the end there will be mysql-test/delta.{parallel,sequential}.log files.
+# The test is similar to rpl_parallel but focuses more to
+# provide benchmarking data.
+# See rpl_parallel.test comments and rpl_parallel_benchmark_load for
+# how to vary running configuration.
 #
 
 let $rpl_skip_reset_master_and_slave= 1;
@@ -38,10 +12,10 @@ let $rpl_skip_reset_master_and_slave= 1;
 --source include/master-slave.inc
 
 connection slave;
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-###select @@global.mts_slave_parallel_workers as 'non-zero means parallel';
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+###select @@global.slave_parallel_workers as 'non-zero means parallel';
 
-let $workers = `select @@global.mts_slave_parallel_workers`;
+let $workers = `select @@global.slave_parallel_workers`;
 ###let $databases= $workers;
 # workers vary db:s do not
 let $databases= 16;
@@ -51,7 +25,7 @@ source extra/rpl_tests/rpl_parallel_benc
 
 connection slave;
 --disable_query_log
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 --enable_result_log
 
 --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test	2011-06-15 17:12:11 +0000
@@ -4,9 +4,9 @@
 # The test verifies correctness of MTS execution when system meets
 # various limits due to few configuration options:
 #
-# @@global.mts_pending_jobs_size_max
-# @@global.mts_slave_worker_queue_len_max
-# @@global.mts_partition_hash_soft_max
+# A. @@global.slave_pending_jobs_size_max
+# B. @@global.slave_parallel_workers
+#
 
 --source include/master-slave.inc
 # no support for Query-log-event in this test
@@ -19,83 +19,52 @@ create view coord_wait_list as
               where state like 'Waiting for Slave Worker%';
 
 # restart in Parallel
-source include/stop_slave.inc;
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
-
-
-# max len of WQ
-set @save_mts_slave_worker_queue_len_max= @@global.mts_slave_worker_queue_len_max;
-set @@global.mts_slave_worker_queue_len_max= 5;
-source include/start_slave.inc;
-
-
-connection master;
-create database d0;
-create table d0.t1 (a int auto_increment primary key) engine=innodb;
 
+let $workers= 4;
 
-sync_slave_with_master;
-
-begin;
-insert into d0.t1 set a=null; # lock a row that master has inserted into
-
-
-connection master;
-
-begin;
-
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-insert into d0.t1 set a=null;
-
-commit;
+source include/stop_slave.inc;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+eval set @@global.slave_parallel_workers= $workers;
 
-let $d0_t1_count=`select count(*) from d0.t1`;
+#
+# A. Prescribed number of Worker threads is honored
+#
 
 connection slave;
 
---echo *** Coordinator must be waiting a for Worker to process its queue ***
+create view worker_wait_list as
+       SELECT id from Information_Schema.processlist
+              where state like 'Waiting for an event from sql thread%';
 
-let $count= 1;
-let $table= coord_wait_list;
-source include/wait_until_rows_count.inc;
+source include/stop_slave.inc;
 
-rollback;
+# relates to B preparation
+let $mts_max_q_size=1024;
+set @save_slave_pending_jobs_size_max = @@global.slave_pending_jobs_size_max;
+eval set @@global.slave_pending_jobs_size_max= $mts_max_q_size;
 
-let $count= $d0_t1_count;
-let $table= d0.t1;
-source include/wait_until_rows_count.inc;
+source include/start_slave.inc;
 
-# cleanup of the max len
-set @@global.mts_slave_worker_queue_len_max= @save_mts_slave_worker_queue_len_max;
+let $count= $workers;
+let $table= worker_wait_list;
+source include/wait_until_rows_count.inc;
 
+--echo Configured number of Workers is started.
 
 #
-# Max size of Worker queues
+# B. Max size of Worker queues
 #
 
---let $mts_max_q_size=1024
-
-connection slave;
-
-source include/stop_slave.inc;
-set @save_mts_pending_jobs_size_max = @@global.mts_pending_jobs_size_max;
-eval set @@global.mts_pending_jobs_size_max= $mts_max_q_size;
-source include/start_slave.inc;
 
 connection master;
-create table d0.t2 (a int auto_increment primary key, b text null) engine=innodb;
+create database d0;
+create table d0.t0 (a int auto_increment primary key, b text null) engine=innodb;
 
 sync_slave_with_master;
 
 
 begin;
-insert into d0.t2 set a= 1;
+insert into d0.t0 set a= 1;
 
 # master trans structure aims at testing C's wait loop
 
@@ -105,23 +74,23 @@ connection master;
 
 begin;
 --disable_query_log
-  eval insert into d0.t2 set a= 1, b=  REPEAT('b', 1);
+  eval insert into d0.t0 set a= 1, b=  REPEAT('b', 1);
 
 while ($i_loop)
 {
-  eval insert into d0.t2 set       b=  REPEAT('b', 1);
-  eval insert into d0.t2 set       b=  REPEAT('b', 1);
-  eval insert into d0.t2 set       b=  REPEAT('b', 1);
-  eval insert into d0.t2 set       b=  REPEAT('b', 1);
-  eval insert into d0.t2 set       b=  REPEAT('b', 1);
-  eval insert into d0.t2 set       b=  REPEAT('b', 1);
-  eval insert into d0.t2 set       b=  REPEAT('b', 2* $mts_max_q_size/3);
+  eval insert into d0.t0 set       b=  REPEAT('b', 1);
+  eval insert into d0.t0 set       b=  REPEAT('b', 1);
+  eval insert into d0.t0 set       b=  REPEAT('b', 1);
+  eval insert into d0.t0 set       b=  REPEAT('b', 1);
+  eval insert into d0.t0 set       b=  REPEAT('b', 1);
+  eval insert into d0.t0 set       b=  REPEAT('b', 1);
+  eval insert into d0.t0 set       b=  REPEAT('b', 2* $mts_max_q_size/3);
   dec $i_loop;
 }
 --enable_query_log
 commit;
 
-let $d0_t2_count=`select count(*) from d0.t2`;
+let $d0_t0_count=`select count(*) from d0.t0`;
 
 connection slave;
 
@@ -133,67 +102,12 @@ source include/wait_until_rows_count.inc
 
 rollback;
 
-let $count= $d0_t2_count;
-let $table= d0.t2;
+let $count= $d0_t0_count;
+let $table= d0.t0;
 source include/wait_until_rows_count.inc;
 
-# cleanup of the max len
-set @@global.mts_pending_jobs_size_max= @save_mts_pending_jobs_size_max;
-
-#
-# Number of records in the mts partition hash below which
-# entries with zero usage are tolerated.
-# The test ensures slave's stable execution.
-#
-
-# force eager garbage collecting
-set @save.mts_partition_hash_soft_max= @@global.mts_partition_hash_soft_max;
-set @@global.mts_partition_hash_soft_max= 0;
-
-let $databases= 16;
-
-connection master;
-
-let $i= $databases;
-while ($i)
-{
-  eval create database d$i;
-  eval create table d$i.t1 (a int auto_increment primary key) engine=innodb;
-  dec $i;
-}
-
-# loading slave with $databases number of parallelizable transaction
-# each leaving a dummy record after is completed on the slave
-
-let $i= $databases;
-while ($i)
-{
-  begin;
-  eval insert into d$i.t1 set a=null;
-  eval insert into d$i.t1 set a=null;
-  eval insert into d$i.t1 set a=null;
-  eval insert into d$i.t1 set a=null;
-  commit;
-
-  dec $i;
-}
-
-sync_slave_with_master;
-
-set @@global.mts_partition_hash_soft_max= @save.mts_partition_hash_soft_max;
-
-connection master;
-
-let $i= $databases;
-while ($i)
-{
-  eval drop database d$i;
-  dec $i;
-}
-
-
-#connection slave;
-sync_slave_with_master;
+# cleanup of the max size
+set @@global.slave_pending_jobs_size_max= @save_slave_pending_jobs_size_max;
 
 
 #
@@ -204,11 +118,11 @@ connection master;
 
 drop database d0;
 
-
 sync_slave_with_master;
 #connection slave;
 
 drop view coord_wait_list;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+drop view worker_wait_list;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 
 --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_conflicts.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test	2011-06-15 17:12:11 +0000
@@ -46,8 +46,8 @@ create view coord_wait_list  as SELECT i
 
 source include/stop_slave.inc;
 
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 
 source include/start_slave.inc;
 
@@ -209,8 +209,6 @@ sync_slave_with_master;
 #connection slave;
 
 drop view coord_wait_list;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
-
---echo *** End of the tests ***
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 
 --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_ddl.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_ddl.test	2011-02-27 17:35:25 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_ddl.test	2011-06-15 17:12:11 +0000
@@ -16,8 +16,8 @@ let $workers= 4;
 connection slave;
 
 source include/stop_slave.inc;
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-eval set @@global.mts_slave_parallel_workers= $workers;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+eval set @@global.slave_parallel_workers= $workers;
 
 # Note, the number of db:s should be greater than MAX_DBS_IN_QUERY_MTS
 # in order to satisfy to the over-max final test.
@@ -251,6 +251,7 @@ while ($n)
 
 sync_slave_with_master;
 
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
+
+--source include/rpl_end.inc
 
-### TODO: --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_innodb.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_innodb.test	2011-05-30 10:05:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_innodb.test	2011-06-15 17:12:11 +0000
@@ -1,36 +1,8 @@
 #
-# WL#5563 Prototype for Parallel Slave with db name partitioning.
+# WL#5569 MTS
 #
-# The test checks correctness of replication and is designed for 
-# benchmarking and comparision with results of its sequential
-# counterpart rpl_sequential.test.
-# Both tests leave mysqld.2/data/test/delta.out file
-# that contains a row with two columns.
-#  1. the duration (in seconds) of execution on the master
-#  2. the duration of execution on the slave
-#  The 2nd column of the rpl_parallel can be compared with the 2nd of rpl_sequential.test.
-#
-#  The duration recorded in the file accounts the SQL thread/workers work.
-#  That is benchmarking on the slave side is effectively started with
-#  `start slave sql_thread'.
-#  NOTICE, there is set @@global.slave_local_timestamp=1;
-#  
-#
-# of load that rpl_parallel_load.test represents.
-# See there how to tune load and concurrency parameters.
-#
-# Example of usage.
-# To gather a collection of figures:
-#  mysql-test$ export slave;
-#  mysql-test$ slave=parallel; for n in `seq 1 10`; 
-#  do ./mtr  --vardir=/dev/shm/var1 --mtr-build-thread=765 rpl_$slave 
-#             --mysqld=--binlog-format=statement; 
-#     find /dev/shm/var1 -name delta.out -exec cat {} \; | cat >> delta.$slave.log; 
-#  done
-#
-# mysql-test$ slave=sequential; ...
-#
-# In the end there will be mysql-test/delta.{parallel,sequential}.log files.
+# The test is similar to rpl_parallel (see further instruction there) but 
+# checks and provides benchmarking data with load to innodb tables.
 #
 
 let $rpl_skip_reset_master_and_slave= 1;

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test	2011-06-14 18:23:13 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test	2011-06-15 17:12:11 +0000
@@ -15,8 +15,8 @@ let $workers= 4;
 connection slave;
 
 source include/stop_slave.inc;
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-eval set @@global.mts_slave_parallel_workers= $workers;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+eval set @@global.slave_parallel_workers= $workers;
 source include/start_slave.inc;
 
 
@@ -347,8 +347,7 @@ while ($n)
 sync_slave_with_master;
 
 
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 
 --source include/rpl_end.inc
 
---echo end of the tests

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test	2011-06-14 18:23:13 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test	2011-06-15 17:12:11 +0000
@@ -20,10 +20,10 @@
 # restart slave in MTS mode
 connection slave;
 source include/stop_slave.inc;
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
-set @save.mts_checkpoint_period= @@global.mts_checkpoint_period;
-set @@global.mts_checkpoint_period= 500; # 0.5 sec
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
+set @save.slave_checkpoint_period= @@global.slave_checkpoint_period;
+set @@global.slave_checkpoint_period= 500; # 0.5 sec
 # to avoid warnings
 set @save.slave_transaction_retries= @@global.slave_transaction_retries;
 
@@ -135,10 +135,9 @@ drop tables t1, t2;
 
 sync_slave_with_master;
 
-set @@global.mts_checkpoint_period= @save.mts_checkpoint_period;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_checkpoint_period= @save.slave_checkpoint_period;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 set @@global.slave_transaction_retries= @save.slave_transaction_retries;
 
 --source include/rpl_end.inc
 
---echo end of the tests

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_start_stop.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test	2011-06-14 18:23:13 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test	2011-06-15 17:12:11 +0000
@@ -22,12 +22,12 @@ create view coord_proc_list  as SELECT i
 
 source include/stop_slave.inc;
 
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-set @@global.mts_slave_parallel_workers= 4;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+set @@global.slave_parallel_workers= 4;
 
 source include/start_slave.inc;
 
-let $count= `select @@global.mts_slave_parallel_workers`;
+let $count= `select @@global.slave_parallel_workers`;
 let $table= worker_proc_list;
 source include/wait_until_rows_count.inc;
 
@@ -50,7 +50,7 @@ source include/start_slave.inc;
 
 # testing of the poll is up
 
-let $count= `select @@global.mts_slave_parallel_workers`;
+let $count= `select @@global.slave_parallel_workers`;
 let $table= worker_proc_list;
 source include/wait_until_rows_count.inc;
 
@@ -272,9 +272,8 @@ sync_slave_with_master;
 
 drop view worker_proc_list;
 drop view coord_proc_list;
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 set @@global.slave_transaction_retries= @save.slave_transaction_retries;
 
 --source include/rpl_end.inc
 
---echo end of the tests

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_temp_query.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test	2011-05-30 10:05:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test	2011-06-15 17:12:11 +0000
@@ -18,8 +18,8 @@ flush status; # to nullify Slave_open_te
 
 # restart in Parallel
 source include/stop_slave.inc;
-set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
-eval set @@global.mts_slave_parallel_workers= $workers;
+set @save.slave_parallel_workers= @@global.slave_parallel_workers;
+eval set @@global.slave_parallel_workers= $workers;
 
 source include/start_slave.inc;
 
@@ -176,6 +176,6 @@ while ($n)
 sync_slave_with_master;
 source include/stop_slave.inc;
 
-set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 
 ### TODO: --source include/rpl_end.inc

=== modified file 'mysql-test/suite/sys_vars/r/all_vars.result'
--- a/mysql-test/suite/sys_vars/r/all_vars.result	2011-06-09 15:27:47 +0000
+++ b/mysql-test/suite/sys_vars/r/all_vars.result	2011-06-15 17:12:11 +0000
@@ -13,50 +13,36 @@ select variable_name as `There should be
 left join t1 on variable_name=test_name where test_name is null;
 There should be *no* variables listed below:
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
-MTS_PARTITION_HASH_SOFT_MAX
 INNODB_ROLLBACK_SEGMENTS
-MTS_EXP_SLAVE_LOCAL_TIMESTAMP
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
 RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
 INNODB_MONITOR_RESET
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_PRINT_ALL_DEADLOCKS
-MTS_SLAVE_PARALLEL_WORKERS
 INNODB_MONITOR_RESET_ALL
 INNODB_STATS_METHOD
+INNODB_LARGE_PREFIX
 LOG_BIN_INDEX
 INNODB_SYNC_ARRAY_SIZE
 INNODB_MONITOR_DISABLE
 INNODB_FILE_FORMAT_MAX
-MTS_PENDING_JOBS_SIZE_MAX
-MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_MONITOR_ENABLE
-MTS_COORDINATOR_BASIC_NAP
-INNODB_LARGE_PREFIX
-MTS_WORKER_UNDERRUN_LEVEL
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
-MTS_PARTITION_HASH_SOFT_MAX
 INNODB_ROLLBACK_SEGMENTS
-MTS_EXP_SLAVE_LOCAL_TIMESTAMP
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
 RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
 INNODB_MONITOR_RESET
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_PRINT_ALL_DEADLOCKS
-MTS_SLAVE_PARALLEL_WORKERS
 INNODB_MONITOR_RESET_ALL
 INNODB_STATS_METHOD
+INNODB_LARGE_PREFIX
 LOG_BIN_INDEX
 INNODB_SYNC_ARRAY_SIZE
 INNODB_MONITOR_DISABLE
 INNODB_FILE_FORMAT_MAX
-MTS_PENDING_JOBS_SIZE_MAX
-MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_MONITOR_ENABLE
-MTS_COORDINATOR_BASIC_NAP
-INNODB_LARGE_PREFIX
-MTS_WORKER_UNDERRUN_LEVEL
 drop table t1;
 drop table t2;

=== renamed file 'mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result' => 'mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result'
--- a/mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result	2010-12-18 00:33:02 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result	2011-06-15 17:12:11 +0000
@@ -1,51 +1,51 @@
-SET @start_global_value = @@global.mts_checkpoint_group;
+SET @start_global_value = @@global.slave_checkpoint_group;
 SELECT @start_global_value;
 @start_global_value
 512
-select @@global.mts_checkpoint_group;
-@@global.mts_checkpoint_group
+select @@global.slave_checkpoint_group;
+@@global.slave_checkpoint_group
 512
-select @@session.mts_checkpoint_group;
-ERROR HY000: Variable 'mts_checkpoint_group' is a GLOBAL variable
-show global variables like 'mts_checkpoint_group';
+select @@session.slave_checkpoint_group;
+ERROR HY000: Variable 'slave_checkpoint_group' is a GLOBAL variable
+show global variables like 'slave_checkpoint_group';
 Variable_name	Value
-mts_checkpoint_group	512
-show session variables like 'mts_checkpoint_group';
+slave_checkpoint_group	512
+show session variables like 'slave_checkpoint_group';
 Variable_name	Value
-mts_checkpoint_group	512
-select * from information_schema.global_variables where variable_name='mts_checkpoint_group';
+slave_checkpoint_group	512
+select * from information_schema.global_variables where variable_name='slave_checkpoint_group';
 VARIABLE_NAME	VARIABLE_VALUE
-MTS_CHECKPOINT_GROUP	512
-select * from information_schema.session_variables where variable_name='mts_checkpoint_group';
+SLAVE_CHECKPOINT_GROUP	512
+select * from information_schema.session_variables where variable_name='slave_checkpoint_group';
 VARIABLE_NAME	VARIABLE_VALUE
-MTS_CHECKPOINT_GROUP	512
-set global mts_checkpoint_group=1;
+SLAVE_CHECKPOINT_GROUP	512
+set global slave_checkpoint_group=1;
 Warnings:
-Warning	1292	Truncated incorrect mts_checkpoint_group value: '1'
-select @@global.mts_checkpoint_group;
-@@global.mts_checkpoint_group
+Warning	1292	Truncated incorrect slave_checkpoint_group value: '1'
+select @@global.slave_checkpoint_group;
+@@global.slave_checkpoint_group
 512
-set session mts_checkpoint_group=1;
-ERROR HY000: Variable 'mts_checkpoint_group' is a GLOBAL variable and should be set with SET GLOBAL
-set global mts_checkpoint_group=1.1;
-ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_group'
-set global mts_checkpoint_group=1e1;
-ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_group'
-set global mts_checkpoint_group="foo";
-ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_group'
-set global mts_checkpoint_group=0;
+set session slave_checkpoint_group=1;
+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'
+set global slave_checkpoint_group=1e1;
+ERROR 42000: Incorrect argument type to variable 'slave_checkpoint_group'
+set global slave_checkpoint_group="foo";
+ERROR 42000: Incorrect argument type to variable 'slave_checkpoint_group'
+set global slave_checkpoint_group=0;
 Warnings:
-Warning	1292	Truncated incorrect mts_checkpoint_group value: '0'
-select @@global.mts_checkpoint_group;
-@@global.mts_checkpoint_group
+Warning	1292	Truncated incorrect slave_checkpoint_group value: '0'
+select @@global.slave_checkpoint_group;
+@@global.slave_checkpoint_group
 512
-set global mts_checkpoint_group=cast(-1 as unsigned int);
+set global slave_checkpoint_group=cast(-1 as unsigned int);
 Warnings:
-Warning	1292	Truncated incorrect mts_checkpoint_group value: '18446744073709551615'
-select @@global.mts_checkpoint_group;
-@@global.mts_checkpoint_group
+Warning	1292	Truncated incorrect slave_checkpoint_group value: '18446744073709551615'
+select @@global.slave_checkpoint_group;
+@@global.slave_checkpoint_group
 4294967288
-SET @@global.mts_checkpoint_group = @start_global_value;
-SELECT @@global.mts_checkpoint_group;
-@@global.mts_checkpoint_group
+SET @@global.slave_checkpoint_group = @start_global_value;
+SELECT @@global.slave_checkpoint_group;
+@@global.slave_checkpoint_group
 512

=== renamed file 'mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result' => 'mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result'
--- a/mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result	2010-12-14 12:51:30 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result	2011-06-15 17:12:11 +0000
@@ -1,47 +1,47 @@
-SET @start_global_value = @@global.mts_checkpoint_period;
+SET @start_global_value = @@global.slave_checkpoint_period;
 SELECT @start_global_value;
 @start_global_value
 300
-select @@global.mts_checkpoint_period;
-@@global.mts_checkpoint_period
+select @@global.slave_checkpoint_period;
+@@global.slave_checkpoint_period
 300
-select @@session.mts_checkpoint_period;
-ERROR HY000: Variable 'mts_checkpoint_period' is a GLOBAL variable
-show global variables like 'mts_checkpoint_period';
+select @@session.slave_checkpoint_period;
+ERROR HY000: Variable 'slave_checkpoint_period' is a GLOBAL variable
+show global variables like 'slave_checkpoint_period';
 Variable_name	Value
-mts_checkpoint_period	300
-show session variables like 'mts_checkpoint_period';
+slave_checkpoint_period	300
+show session variables like 'slave_checkpoint_period';
 Variable_name	Value
-mts_checkpoint_period	300
-select * from information_schema.global_variables where variable_name='mts_checkpoint_period';
+slave_checkpoint_period	300
+select * from information_schema.global_variables where variable_name='slave_checkpoint_period';
 VARIABLE_NAME	VARIABLE_VALUE
-MTS_CHECKPOINT_PERIOD	300
-select * from information_schema.session_variables where variable_name='mts_checkpoint_period';
+SLAVE_CHECKPOINT_PERIOD	300
+select * from information_schema.session_variables where variable_name='slave_checkpoint_period';
 VARIABLE_NAME	VARIABLE_VALUE
-MTS_CHECKPOINT_PERIOD	300
-set global mts_checkpoint_period=1;
-select @@global.mts_checkpoint_period;
-@@global.mts_checkpoint_period
+SLAVE_CHECKPOINT_PERIOD	300
+set global slave_checkpoint_period=1;
+select @@global.slave_checkpoint_period;
+@@global.slave_checkpoint_period
 1
-set session mts_checkpoint_period=1;
-ERROR HY000: Variable 'mts_checkpoint_period' is a GLOBAL variable and should be set with SET GLOBAL
-set global mts_checkpoint_period=1.1;
-ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
-set global mts_checkpoint_period=1e1;
-ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
-set global mts_checkpoint_period="foo";
-ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
-set global mts_checkpoint_period=0;
-select @@global.mts_checkpoint_period;
-@@global.mts_checkpoint_period
+set session slave_checkpoint_period=1;
+ERROR HY000: Variable 'slave_checkpoint_period' is a GLOBAL variable and should be set with SET GLOBAL
+set global slave_checkpoint_period=1.1;
+ERROR 42000: Incorrect argument type to variable 'slave_checkpoint_period'
+set global slave_checkpoint_period=1e1;
+ERROR 42000: Incorrect argument type to variable 'slave_checkpoint_period'
+set global slave_checkpoint_period="foo";
+ERROR 42000: Incorrect argument type to variable 'slave_checkpoint_period'
+set global slave_checkpoint_period=0;
+select @@global.slave_checkpoint_period;
+@@global.slave_checkpoint_period
 0
-set global mts_checkpoint_period=cast(-1 as unsigned int);
+set global slave_checkpoint_period=cast(-1 as unsigned int);
 Warnings:
-Warning	1292	Truncated incorrect mts_checkpoint_period value: '18446744073709551615'
-select @@global.mts_checkpoint_period;
-@@global.mts_checkpoint_period
+Warning	1292	Truncated incorrect slave_checkpoint_period value: '18446744073709551615'
+select @@global.slave_checkpoint_period;
+@@global.slave_checkpoint_period
 4294967295
-SET @@global.mts_checkpoint_period = @start_global_value;
-SELECT @@global.mts_checkpoint_period;
-@@global.mts_checkpoint_period
+SET @@global.slave_checkpoint_period = @start_global_value;
+SELECT @@global.slave_checkpoint_period;
+@@global.slave_checkpoint_period
 300

=== renamed file 'mysql-test/suite/sys_vars/r/worker_info_repository_basic.result' => 'mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result'
--- a/mysql-test/suite/sys_vars/r/worker_info_repository_basic.result	2010-12-09 13:23:19 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result	2011-06-15 17:12:11 +0000
@@ -1,44 +1,44 @@
 '#---------------------BS_STVARS_002_01----------------------#'
-SELECT @@GLOBAL.worker_info_repository;
-@@GLOBAL.worker_info_repository
+SELECT @@GLOBAL.slave_worker_info_repository;
+@@GLOBAL.slave_worker_info_repository
 FILE
-SELECT COUNT(@@GLOBAL.worker_info_repository);
-COUNT(@@GLOBAL.worker_info_repository)
+SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
+COUNT(@@GLOBAL.slave_worker_info_repository)
 1
 1 Expected
-SELECT COUNT(@@SESSION.worker_info_repository);
-ERROR HY000: Variable 'worker_info_repository' is a GLOBAL variable
+SELECT COUNT(@@SESSION.slave_worker_info_repository);
+ERROR HY000: Variable 'slave_worker_info_repository' is a GLOBAL variable
 '#---------------------BS_STVARS_002_02----------------------#'
-SET @@GLOBAL.worker_info_repository= "TABLE";
-ERROR HY000: Variable 'worker_info_repository' is a read only variable
-SELECT @@GLOBAL.worker_info_repository;
-@@GLOBAL.worker_info_repository
+SET @@GLOBAL.slave_worker_info_repository= "TABLE";
+ERROR HY000: Variable 'slave_worker_info_repository' is a read only variable
+SELECT @@GLOBAL.slave_worker_info_repository;
+@@GLOBAL.slave_worker_info_repository
 FILE
 '#---------------------BS_STVARS_002_03----------------------#'
-SELECT @@GLOBAL.worker_info_repository = VARIABLE_VALUE
+SELECT @@GLOBAL.slave_worker_info_repository = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='worker_info_repository';
-@@GLOBAL.worker_info_repository = VARIABLE_VALUE
+WHERE VARIABLE_NAME='slave_worker_info_repository';
+@@GLOBAL.slave_worker_info_repository = VARIABLE_VALUE
 1
 1 Expected
-SELECT COUNT(@@GLOBAL.worker_info_repository);
-COUNT(@@GLOBAL.worker_info_repository)
+SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
+COUNT(@@GLOBAL.slave_worker_info_repository)
 1
 1 Expected
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='worker_info_repository';
+WHERE VARIABLE_NAME='slave_worker_info_repository';
 COUNT(VARIABLE_VALUE)
 1
 1 Expected
 '#---------------------BS_STVARS_002_05----------------------#'
-SELECT COUNT(@@worker_info_repository);
-COUNT(@@worker_info_repository)
+SELECT COUNT(@@slave_worker_info_repository);
+COUNT(@@slave_worker_info_repository)
 1
 1 Expected
-SELECT COUNT(@@local.worker_info_repository);
-ERROR HY000: Variable 'worker_info_repository' is a GLOBAL variable
-SELECT COUNT(@@GLOBAL.worker_info_repository);
-COUNT(@@GLOBAL.worker_info_repository)
+SELECT COUNT(@@local.slave_worker_info_repository);
+ERROR HY000: Variable 'slave_worker_info_repository' is a GLOBAL variable
+SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
+COUNT(@@GLOBAL.slave_worker_info_repository)
 1
 1 Expected

=== renamed file 'mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test' => 'mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test'
--- a/mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test	2010-12-18 00:33:02 +0000
+++ b/mysql-test/suite/sys_vars/t/slave_checkpoint_group_basic.test	2011-06-15 17:12:11 +0000
@@ -1,44 +1,44 @@
 --source include/not_embedded.inc
 
-SET @start_global_value = @@global.mts_checkpoint_group;
+SET @start_global_value = @@global.slave_checkpoint_group;
 SELECT @start_global_value;
 
 #
 # exists as global only
 #
-select @@global.mts_checkpoint_group;
+select @@global.slave_checkpoint_group;
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.mts_checkpoint_group;
-show global variables like 'mts_checkpoint_group';
-show session variables like 'mts_checkpoint_group';
-select * from information_schema.global_variables where variable_name='mts_checkpoint_group';
-select * from information_schema.session_variables where variable_name='mts_checkpoint_group';
+select @@session.slave_checkpoint_group;
+show global variables like 'slave_checkpoint_group';
+show session variables like 'slave_checkpoint_group';
+select * from information_schema.global_variables where variable_name='slave_checkpoint_group';
+select * from information_schema.session_variables where variable_name='slave_checkpoint_group';
 
 #
 # show that it's writable
 #
-set global mts_checkpoint_group=1;
-select @@global.mts_checkpoint_group;
+set global slave_checkpoint_group=1;
+select @@global.slave_checkpoint_group;
 --error ER_GLOBAL_VARIABLE
-set session mts_checkpoint_group=1;
+set session slave_checkpoint_group=1;
 
 #
 # incorrect types
 #
 --error ER_WRONG_TYPE_FOR_VAR
-set global mts_checkpoint_group=1.1;
+set global slave_checkpoint_group=1.1;
 --error ER_WRONG_TYPE_FOR_VAR
-set global mts_checkpoint_group=1e1;
+set global slave_checkpoint_group=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
-set global mts_checkpoint_group="foo";
+set global slave_checkpoint_group="foo";
 
 #
 # min/max values
 #
-set global mts_checkpoint_group=0;
-select @@global.mts_checkpoint_group;
-set global mts_checkpoint_group=cast(-1 as unsigned int);
-select @@global.mts_checkpoint_group;
+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.mts_checkpoint_group = @start_global_value;
-SELECT @@global.mts_checkpoint_group;
+SET @@global.slave_checkpoint_group = @start_global_value;
+SELECT @@global.slave_checkpoint_group;

=== renamed file 'mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test' => 'mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test'
--- a/mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test	2010-12-13 21:16:31 +0000
+++ b/mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test	2011-06-15 17:12:11 +0000
@@ -1,44 +1,44 @@
 --source include/not_embedded.inc
 
-SET @start_global_value = @@global.mts_checkpoint_period;
+SET @start_global_value = @@global.slave_checkpoint_period;
 SELECT @start_global_value;
 
 #
 # exists as global only
 #
-select @@global.mts_checkpoint_period;
+select @@global.slave_checkpoint_period;
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.mts_checkpoint_period;
-show global variables like 'mts_checkpoint_period';
-show session variables like 'mts_checkpoint_period';
-select * from information_schema.global_variables where variable_name='mts_checkpoint_period';
-select * from information_schema.session_variables where variable_name='mts_checkpoint_period';
+select @@session.slave_checkpoint_period;
+show global variables like 'slave_checkpoint_period';
+show session variables like 'slave_checkpoint_period';
+select * from information_schema.global_variables where variable_name='slave_checkpoint_period';
+select * from information_schema.session_variables where variable_name='slave_checkpoint_period';
 
 #
 # show that it's writable
 #
-set global mts_checkpoint_period=1;
-select @@global.mts_checkpoint_period;
+set global slave_checkpoint_period=1;
+select @@global.slave_checkpoint_period;
 --error ER_GLOBAL_VARIABLE
-set session mts_checkpoint_period=1;
+set session slave_checkpoint_period=1;
 
 #
 # incorrect types
 #
 --error ER_WRONG_TYPE_FOR_VAR
-set global mts_checkpoint_period=1.1;
+set global slave_checkpoint_period=1.1;
 --error ER_WRONG_TYPE_FOR_VAR
-set global mts_checkpoint_period=1e1;
+set global slave_checkpoint_period=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
-set global mts_checkpoint_period="foo";
+set global slave_checkpoint_period="foo";
 
 #
 # min/max values
 #
-set global mts_checkpoint_period=0;
-select @@global.mts_checkpoint_period;
-set global mts_checkpoint_period=cast(-1 as unsigned int);
-select @@global.mts_checkpoint_period;
+set global slave_checkpoint_period=0;
+select @@global.slave_checkpoint_period;
+set global slave_checkpoint_period=cast(-1 as unsigned int);
+select @@global.slave_checkpoint_period;
 
-SET @@global.mts_checkpoint_period = @start_global_value;
-SELECT @@global.mts_checkpoint_period;
+SET @@global.slave_checkpoint_period = @start_global_value;
+SELECT @@global.slave_checkpoint_period;

=== renamed file 'mysql-test/suite/sys_vars/t/worker_info_repository_basic.test' => 'mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test'
--- a/mysql-test/suite/sys_vars/t/worker_info_repository_basic.test	2010-12-09 13:23:19 +0000
+++ b/mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test	2011-06-15 17:12:11 +0000
@@ -10,7 +10,7 @@
 # Author : Alfranio Correia                                                   #
 #                                                                             #
 #                                                                             #
-# Description:Test Cases of System Variable worker_info_repository            #
+# Description:Test Cases of System Variable slave_worker_info_repository            #
 #             that checks the behavior of this variable in the following ways #
 #              * Value Check                                                  #
 #              * Scope Check                                                  #
@@ -19,58 +19,58 @@
 #    http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html      #
 #                                                                             #
 ###############################################################################
---source include/not_worker_info_table.inc
+--source include/not_slave_worker_info_table.inc
 
 --echo '#---------------------BS_STVARS_002_01----------------------#'
 ####################################################################
 #   Displaying default value                                       #
 ####################################################################
-SELECT @@GLOBAL.worker_info_repository;
+SELECT @@GLOBAL.slave_worker_info_repository;
 
-SELECT COUNT(@@GLOBAL.worker_info_repository);
+SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
 --echo 1 Expected
 
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.worker_info_repository);
+SELECT COUNT(@@SESSION.slave_worker_info_repository);
 
 --echo '#---------------------BS_STVARS_002_02----------------------#'
 ####################################################################
 #   Check if Value can set                                         #
 ####################################################################
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.worker_info_repository= "TABLE";
+SET @@GLOBAL.slave_worker_info_repository= "TABLE";
 
-SELECT @@GLOBAL.worker_info_repository;
+SELECT @@GLOBAL.slave_worker_info_repository;
 
 
 --echo '#---------------------BS_STVARS_002_03----------------------#'
 #################################################################
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
-SELECT @@GLOBAL.worker_info_repository = VARIABLE_VALUE
+SELECT @@GLOBAL.slave_worker_info_repository = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='worker_info_repository';
+WHERE VARIABLE_NAME='slave_worker_info_repository';
 --echo 1 Expected
 
-SELECT COUNT(@@GLOBAL.worker_info_repository);
+SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
 --echo 1 Expected
 
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='worker_info_repository';
+WHERE VARIABLE_NAME='slave_worker_info_repository';
 --echo 1 Expected
 
 
 --echo '#---------------------BS_STVARS_002_05----------------------#'
 ################################################################################
-#   Check if worker_info_repository can be accessed with and without @@ sign   #
+# Check if slave_worker_info_repository can be accessed with and without @@ sign
 ################################################################################
 
-SELECT COUNT(@@worker_info_repository);
+SELECT COUNT(@@slave_worker_info_repository);
 --echo 1 Expected
 
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.worker_info_repository);
+SELECT COUNT(@@local.slave_worker_info_repository);
 
-SELECT COUNT(@@GLOBAL.worker_info_repository);
+SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
 --echo 1 Expected

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2011-06-14 18:23:13 +0000
+++ b/sql/log_event.cc	2011-06-15 17:12:11 +0000
@@ -4540,8 +4540,7 @@ int Query_log_event::do_apply_event(Rela
   */
   if (is_trans_keyword() || rpl_filter->db_ok(thd->db))
   {
-    // TODO: MTS testing|benchmarking feature to remove|separate out
-    thd->set_time(!opt_mts_slave_local_timestamp ? (time_t)when : my_time(0));
+    thd->set_time((time_t) when);
     thd->set_query_and_id((char*)query_arg, q_len_arg,
                           thd->charset(), next_query_id());
     thd->variables.pseudo_thread_id= thread_id;		// for temp tables
@@ -6257,7 +6256,7 @@ int Load_log_event::do_apply_event(NET* 
   */
   if (rpl_filter->db_ok(thd->db))
   {
-    thd->set_time(!opt_mts_slave_local_timestamp ? (time_t)when : my_time(0));
+    thd->set_time((time_t) when);
     thd->set_query_id(next_query_id());
     thd->warning_info->opt_clear_warning_info(thd->query_id);
 
@@ -9137,7 +9136,7 @@ int Rows_log_event::do_apply_event(Relay
       TIMESTAMP column to a table with one.
       So we call set_time(), like in SBR. Presently it changes nothing.
     */
-    thd->set_time(!opt_mts_slave_local_timestamp ? (time_t)when : my_time(0));
+    thd->set_time((time_t) when);
 
     /*
       Now we are in a statement and will stay in a statement until we

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2011-06-09 17:35:59 +0000
+++ b/sql/mysqld.cc	2011-06-15 17:12:11 +0000
@@ -463,12 +463,8 @@ uint  slave_net_timeout;
 ulong slave_exec_mode_options;
 ulonglong slave_type_conversions_options;
 ulong opt_mts_slave_parallel_workers;
-ulong opt_mts_slave_worker_queue_len_max;
-my_bool opt_mts_slave_local_timestamp;
-ulong opt_mts_partition_hash_soft_max;
 ulonglong opt_mts_pending_jobs_size_max;
 ulong opt_mts_coordinator_basic_nap;
-ulong opt_mts_worker_underrun_level;
 ulong thread_cache_size=0;
 ulong binlog_cache_size=0;
 ulonglong  max_binlog_cache_size=0;

=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h	2011-06-09 17:35:59 +0000
+++ b/sql/mysqld.h	2011-06-15 17:12:11 +0000
@@ -184,13 +184,7 @@ extern LEX_CSTRING reason_slave_blocked;
 extern ulong slave_trans_retries;
 extern uint  slave_net_timeout;
 extern ulong opt_mts_slave_parallel_workers;
-extern ulong opt_mts_slave_worker_queue_len_max;
-extern my_bool opt_mts_slave_local_timestamp;
-extern ulong opt_mts_partition_hash_soft_max;
 extern ulonglong opt_mts_pending_jobs_size_max;
-extern ulong opt_mts_coordinator_basic_nap;
-extern ulong opt_mts_worker_underrun_level;
-
 extern uint max_user_connections;
 extern ulong what_to_log,flush_time;
 extern ulong max_prepared_stmt_count, prepared_stmt_count;

=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	2011-06-14 10:35:20 +0000
+++ b/sql/rpl_rli_pdb.cc	2011-06-15 17:12:11 +0000
@@ -27,6 +27,13 @@ const char *info_slave_worker_fields []=
   "checkpoint_group_bitmap"
 };
 
+/*
+  Number of records in the mts partition hash below which 
+  entries with zero usage are tolerated so could be quickly
+  recycled.
+*/
+ulong mts_partition_hash_soft_max= 16;
+
 Slave_worker::Slave_worker(const char* type, const char* pfs,
                            Relay_log_info *rli)
   : Relay_log_info(FALSE), c_rli(rli),
@@ -571,7 +578,7 @@ Slave_worker *get_slave_worker(const cha
 
     mysql_mutex_lock(&slave_worker_hash_lock);
 
-    if (mapping_db_to_worker.records > opt_mts_partition_hash_soft_max)
+    if (mapping_db_to_worker.records > mts_partition_hash_soft_max)
     {
       /* remove zero-usage (todo: rare or long ago scheduled) records */
       for (uint i= 0; i < mapping_db_to_worker.records; i++)

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-06-15 14:59:23 +0000
+++ b/sql/rpl_slave.cc	2011-06-15 17:12:11 +0000
@@ -78,6 +78,30 @@ ulonglong relay_log_space_limit = 0;
 const char *relay_log_index= 0;
 const char *relay_log_basename= 0;
 
+/*
+  MTS load-ballancing parameter.
+  Max length of one MTS Worker queue. The value also determines the size
+  of Relay_log_info::gaq (see @c slave_start_workers()).
+  It can be set to any value in [1, ULONG_MAX - 1] range.
+*/
+ulong mts_slave_worker_queue_len_max= 32768;
+
+/*
+  MTS load-ballancing parameter.
+  Time in microsecs to sleep by MTS Coordinator to avoid the Worker queues
+  room overrun.
+*/
+ulong mts_coordinator_basic_nap= 5;
+
+/*
+  MTS load-ballancing parameter.
+  Percent of Worker queue size at which Worker is considered to become
+  hungry.
+*/
+ulong mts_worker_underrun_level= 10;
+
+
+
 void append_item_to_jobs(slave_job_item *job_item,
                          Slave_worker *w, Relay_log_info *rli);
 
@@ -4168,20 +4192,22 @@ int slave_start_workers(Relay_log_info *
   // CGAP dynarray holds id:s of partitions of the Current being executed Group
   my_init_dynamic_array(&rli->curr_group_assigned_parts, sizeof(db_worker_hash_entry*),
                         SLAVE_INIT_DBS_IN_GROUP, 1);
-  rli->last_assigned_worker= NULL; /* associated with curr_group_assigned */
+  rli->last_assigned_worker= NULL;     // associated with curr_group_assigned
   my_init_dynamic_array(&rli->curr_group_da, sizeof(Log_event*), 8, 2);
   // Least_occupied_workers array to hold items size of Slave_jobs_queue::len
   my_init_dynamic_array(&rli->least_occupied_workers, sizeof(ulong), n, 0); 
 
-  // GAQ  queue holds seqno:s of scheduled groups. C polls workers in 
-  //      @c lwm_checkpoint_period to update GAQ (see @c next_event())
-  // The length of GAQ is derived from @c opt_mts_slave_worker_queue_len_max to guarantee
-  // each assigned job being sent to a WQ will find room in GAQ.
-  // opt_mts_slave_worker_queue_len_max * num-of-W:s is the max length case 
-  // all jobs contain one event.
+  /* 
+     GAQ  queue holds seqno:s of scheduled groups. C polls workers in 
+     @c lwm_checkpoint_period to update GAQ (see @c next_event())
+     The length of GAQ is derived from @c opt_mts_slave_worker_queue_len_max to guarantee
+     each assigned job being sent to a WQ will find room in GAQ.
+     mts_slave_worker_queue_len_max * num-of-W:s is the max length case 
+     all jobs contain one event.
+  */
 
   // size of WQ stays fixed in one slave session
-  rli->mts_slave_worker_queue_len_max= ::opt_mts_slave_worker_queue_len_max;
+  rli->mts_slave_worker_queue_len_max= mts_slave_worker_queue_len_max;
   rli->gaq= new Slave_committed_queue(rli->get_group_master_log_name(),
                                       sizeof(Slave_job_group),
                                       1 + rli->opt_slave_parallel_workers *
@@ -4194,8 +4220,8 @@ int slave_start_workers(Relay_log_info *
   rli->mts_wqs_underrun_w_id= (ulong) -1;
   rli->mts_wqs_overrun= 0;
   rli->mts_wqs_oversize= FALSE;
-  rli->mts_coordinator_basic_nap= ::opt_mts_coordinator_basic_nap;
-  rli->mts_worker_underrun_level= ::opt_mts_worker_underrun_level;
+  rli->mts_coordinator_basic_nap= mts_coordinator_basic_nap;
+  rli->mts_worker_underrun_level= mts_worker_underrun_level;
   rli->mts_total_groups= 0;
   rli->curr_group_seen_begin= FALSE;
   rli->curr_group_isolated= FALSE;

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2011-06-09 15:27:47 +0000
+++ b/sql/sys_vars.cc	2011-06-15 17:12:11 +0000
@@ -588,7 +588,7 @@ static Sys_var_enum Sys_rli_repository(
 
 ulong opt_worker_repository_id;
 static Sys_var_enum Sys_worker_repository(
-       "worker_info_repository",
+       "slave_worker_info_repository",
        "Defines the type of the repository for the worker information."
        , READ_ONLY GLOBAL_VAR(opt_worker_repository_id), CMD_LINE(REQUIRED_ARG),
        repository_names, DEFAULT(0));
@@ -3314,15 +3314,17 @@ static Sys_var_uint Sys_sync_relayloginf
        VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
 
 static Sys_var_uint Sys_checkpoint_mts_period(
-       "mts_checkpoint_period", "Gather workers' activities to "
-       "flush the relay log info to disk after every #th milli-seconds. "
-       "The zero value disables the checkpoint routine (makes sense for debugging).",
+       "slave_checkpoint_period", "Gather workers' activities to "
+       "Update progress status of Multi-threaded slave and flush "
+       "the relay log info to disk after every #th milli-seconds. The zero "
+       "value disables the checkpoint routine (makes sense for debugging).",
        GLOBAL_VAR(mts_checkpoint_period), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(0, UINT_MAX), DEFAULT(300), BLOCK_SIZE(1));
 
 static Sys_var_uint Sys_checkpoint_mts_group(
-       "mts_checkpoint_group", "Define the number of transactions "
-       "before a checkpoint operation is called.",
+       "slave_checkpoint_group",
+       "Maximum number of processed transactions by Multi-threaded slave "
+       "before a checkpoint operation is called to update progress status.",
        GLOBAL_VAR(mts_checkpoint_group), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(512, UINT_MAX), DEFAULT(512), BLOCK_SIZE(8));
 #endif
@@ -3348,50 +3350,19 @@ static Sys_var_ulong Sys_slave_trans_ret
        VALID_RANGE(0, ULONG_MAX), DEFAULT(10), BLOCK_SIZE(1));
 
 static Sys_var_ulong Sys_slave_parallel_workers(
-       "mts_slave_parallel_workers",
+       "slave_parallel_workers",
        "Number of worker threads for executing events in parallel ",
        GLOBAL_VAR(opt_mts_slave_parallel_workers), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1));
-static Sys_var_ulong Sys_mts_slave_worker_queue_len_max(
-       "mts_slave_worker_queue_len_max",
-       "Max length of one MTS Worker queue. Presence in the queue indicates "
-       "a replication event was read out of Relay log and not yet applied. "
-       "Notice the max size of event data in all queues are governed by "
-       "mts_pending_jobs_size_max. Whichever limit is reached Coordinator thread"
-       "suspends further jobs assigning until conditions have been improved.",
-       GLOBAL_VAR(opt_mts_slave_worker_queue_len_max), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1, ULONG_MAX - 1), DEFAULT(40000), BLOCK_SIZE(1));
-static Sys_var_mybool Sys_slave_local_timestamp(
-       "mts_exp_slave_local_timestamp", "If enabled slave itself computes the event appying "
-       "time value to implicitly affected timestamp columms. Otherwise (default) "
-       "it installs prescribed by the master value",
-       GLOBAL_VAR(opt_mts_slave_local_timestamp), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
-static Sys_var_ulong Sys_mts_partition_hash_soft_max(
-       "mts_partition_hash_soft_max",
-       "Number of records in the mts partition hash below which "
-       "entries with zero usage are tolerated",
-       GLOBAL_VAR(opt_mts_partition_hash_soft_max), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(0, ULONG_MAX), DEFAULT(16), BLOCK_SIZE(1));
+
 static Sys_var_ulonglong Sys_mts_pending_jobs_size_max(
-       "mts_pending_jobs_size_max",
+       "slave_pending_jobs_size_max",
        "Max size of Slave Worker queues holding yet not applied events."
-       "The least possible value must be not less than the master size "
+       "The least possible value must be not less than the master side "
        "max_allowed_packet.",
        GLOBAL_VAR(opt_mts_pending_jobs_size_max), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1024, (ulonglong)~(intptr)0), DEFAULT(16 * 1024*1024),
        BLOCK_SIZE(1024), ON_CHECK(0));
-static Sys_var_ulong Sys_mts_coordinator_basic_nap(
-       "mts_coordinator_basic_nap",
-       "Time in msec to sleep by MTS Coordinator to avoid the Worker queues "
-       "room overrun",
-       GLOBAL_VAR(opt_mts_coordinator_basic_nap), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(0, ULONG_MAX), DEFAULT(5), BLOCK_SIZE(1));
-static Sys_var_ulong Sys_mts_worker_underrun_level(
-       "mts_worker_underrun_level",
-       "percent of Worker queue size at which Worker is considered to become "
-       "hungry",
-       GLOBAL_VAR(opt_mts_worker_underrun_level), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(0, 100), DEFAULT(0), BLOCK_SIZE(1));
 #endif
 
 static bool check_locale(sys_var *self, THD *thd, set_var *var)

=== modified file 'storage/blackhole/ha_blackhole.cc'
--- a/storage/blackhole/ha_blackhole.cc	2011-06-12 19:05:05 +0000
+++ b/storage/blackhole/ha_blackhole.cc	2011-06-15 17:12:11 +0000
@@ -21,6 +21,12 @@
 #include "ha_blackhole.h"
 #include "sql_class.h"                          // THD, SYSTEM_THREAD_SLAVE_*
 
+static bool is_slave_applier(THD *thd)
+{
+  return thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
+    thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER;
+}
+
 /* Static declarations for handlerton */
 
 static handler *blackhole_create_handler(handlerton *hton,
@@ -114,8 +120,7 @@ int ha_blackhole::update_row(const uchar
 {
   DBUG_ENTER("ha_blackhole::update_row");
   THD *thd= ha_thd();
-  if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
-       thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) && thd->query() == NULL)
+  if (is_slave_applier(thd) && thd->query() == NULL)
     DBUG_RETURN(0);
   DBUG_RETURN(HA_ERR_WRONG_COMMAND);
 }
@@ -124,8 +129,7 @@ int ha_blackhole::delete_row(const uchar
 {
   DBUG_ENTER("ha_blackhole::delete_row");
   THD *thd= ha_thd();
-  if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
-       thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) && thd->query() == NULL)
+  if (is_slave_applier(thd) && thd->query() == NULL)
     DBUG_RETURN(0);
   DBUG_RETURN(HA_ERR_WRONG_COMMAND);
 }
@@ -144,8 +148,7 @@ int ha_blackhole::rnd_next(uchar *buf)
   MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
                        TRUE);
   THD *thd= ha_thd();
-  if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
-       thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) && thd->query() == NULL)
+  if (is_slave_applier(thd) && thd->query() == NULL)
     rc= 0;
   else
     rc= HA_ERR_END_OF_FILE;
@@ -235,8 +238,7 @@ int ha_blackhole::index_read_map(uchar *
   DBUG_ENTER("ha_blackhole::index_read");
   MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
   THD *thd= ha_thd();
-  if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
-       thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) && thd->query() == NULL)
+  if (is_slave_applier(thd) && thd->query() == NULL)
     rc= 0;
   else
     rc= HA_ERR_END_OF_FILE;
@@ -253,8 +255,7 @@ int ha_blackhole::index_read_idx_map(uch
   DBUG_ENTER("ha_blackhole::index_read_idx");
   MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
   THD *thd= ha_thd();
-  if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
-       thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) && thd->query() == NULL)
+  if (is_slave_applier(thd) && thd->query() == NULL)
     rc= 0;
   else
     rc= HA_ERR_END_OF_FILE;
@@ -270,8 +271,7 @@ int ha_blackhole::index_read_last_map(uc
   DBUG_ENTER("ha_blackhole::index_read_last");
   MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
   THD *thd= ha_thd();
-  if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL ||
-       thd->system_thread == SYSTEM_THREAD_SLAVE_WORKER) && thd->query() == NULL)
+  if (is_slave_applier(thd) && thd->query() == NULL)
     rc= 0;
   else
     rc= HA_ERR_END_OF_FILE;


Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20110615171211-2j5lu5sj98r68n07.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3291) WL#5569Andrei Elkin16 Jun