List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:July 13 2011 3:24pm
Subject:bzr push into mysql-next-mr-wl5569 branch (alfranio.correia:3344 to 3345)
WL#5569
View as plain text  
 3345 Alfranio Correia	2011-07-13
      WL#5569
     @ mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/include/not_slave_worker_info_table.inc
        Removed this feature as option --slave-worker-info-repository was removed too.
     @ mysql-test/suite/rpl/t/rpl_mixed_mts_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_row_mts_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_row_mts_rec_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_stm_mts_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/rpl/t/rpl_stm_mts_rec_crash_safe-slave.opt
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test
        Removed this test case as option --slave-worker-info-repository was removed too.
     @ sql/binlog.cc
        Improved code as requested by reviewers.
     @ sql/lock.cc
        Removed mistake that got into sql/lock.cc after merging with trunk.
     @ sql/log_event.cc
        Introduced parameter force in commit_positions function to determine if
        flush must be executed regardless of sync options.
     @ sql/rpl_info.h
        Updated doxygen comments and removed a change to avoid conflicts when merging with trunk.
     @ sql/rpl_info_factory.h
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.
     @ sql/rpl_rli.cc
        Introduced parameter force in commit_positions function to determine if
        flush must be executed regardless of sync options.
     @ sql/rpl_rli_pdb.cc
        Improved the code and introduced parameter force in commit_positions
        function to determine if flush must be executed regardless of sync options.
     @ sql/rpl_rli_pdb.h
        Introduced parameter force in commit_positions function to determine if
        flush must be executed regardless of sync options.
     @ sql/rpl_slave.cc
        Removed duplicated code.
     @ sql/sql_parse.cc
        Reintroduced flag removed by mistake when merging with trunk.
        See also sql/lock.cc.
     @ sql/sys_vars.cc
        Removed option --slave-worker-info-repository as workers repositories are defined according to --relay-log-info-repository.

    removed:
      mysql-test/include/not_slave_worker_info_table.inc
      mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result
      mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test
    modified:
      mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/suite/rpl/t/rpl_mixed_mts_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_row_mts_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_row_mts_rec_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_stm_mts_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_stm_mts_rec_crash_safe-slave.opt
      sql/binlog.cc
      sql/lock.cc
      sql/log_event.cc
      sql/rpl_info.h
      sql/rpl_info_factory.h
      sql/rpl_rli.cc
      sql/rpl_rli_pdb.cc
      sql/rpl_rli_pdb.h
      sql/rpl_slave.cc
      sql/sql_parse.cc
      sql/sys_vars.cc
 3344 Andrei Elkin	2011-07-13 [merge]
      wl#5569 MTS
      
      merge trunk -> wl5569-tree

    modified:
      client/mysqlbinlog.cc
      include/welcome_copyright_notice.h
      mysql-test/include/mix1.inc
      mysql-test/suite/innodb/r/innodb-index.result
      mysql-test/suite/innodb/r/innodb_mysql.result
      mysql-test/suite/innodb/t/innodb-index.test
      mysys/psi_noop.cc
      plugin/audit_null/audit_null.c
      sql/handler.cc
      sql/item_geofunc.cc
      sql/partition_info.cc
      sql/rpl_info_file.cc
      sql/sql_load.cc
      sql/sql_select.cc
      storage/innobase/row/row0row.c
      storage/innobase/trx/trx0purge.c
      storage/innobase/trx/trx0rec.c
      storage/perfschema/pfs_instr.cc
      storage/perfschema/unittest/pfs_instr_class-t.cc
      support-files/mysql-log-rotate.sh
=== modified file 'mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc'
--- a/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc	2011-07-09 22:08:07 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc	2011-07-13 15:23:57 +0000
@@ -80,7 +80,7 @@ if (`SELECT HEX(@commands) = HEX('recove
   --error 0, 2013
   START SLAVE SQL_THREAD;
   --source include/wait_until_disconnected.inc
-  --exec echo "restart --skip-slave-start --slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+  --exec echo "restart --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
   --let $rpl_server_number= 2
   --source include/rpl_reconnect.inc
 

=== removed file 'mysql-test/include/not_slave_worker_info_table.inc'
--- a/mysql-test/include/not_slave_worker_info_table.inc	2011-06-15 17:12:11 +0000
+++ b/mysql-test/include/not_slave_worker_info_table.inc	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-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-07-08 06:44:35 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2011-07-13 15:23:57 +0000
@@ -530,7 +530,7 @@ The following options may be given as th
  the SQL replication thread is in the relay logs
  --relay-log-info-repository=name 
  Defines the type of the repository for the relay log
- information.
+ information and associated workers.
  --relay-log-purge   if disabled - do not purge relay logs. if enabled - purge
  them as soon as they are no more needed
  (Defaults to on; use --skip-relay-log-purge to disable.)
@@ -648,8 +648,7 @@ The following options may be given as th
  --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).
+ after every #th milli-seconds.
  --slave-compressed-protocol 
  Use compression on master/slave protocol
  --slave-exec-mode=name 
@@ -691,9 +690,6 @@ 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
@@ -990,7 +986,6 @@ 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

=== modified file 'mysql-test/suite/rpl/t/rpl_mixed_mts_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_mixed_mts_crash_safe-slave.opt	2011-06-25 14:14:24 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_mts_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1

=== modified file 'mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe-slave.opt	2011-07-09 22:08:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 --relay-log-recovery=1
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 --relay-log-recovery=1

=== modified file 'mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt	2011-07-08 19:40:52 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --slave-worker-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1

=== modified file 'mysql-test/suite/rpl/t/rpl_row_mts_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_mts_crash_safe-slave.opt	2011-06-25 14:14:24 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_mts_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1

=== modified file 'mysql-test/suite/rpl/t/rpl_row_mts_rec_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_mts_rec_crash_safe-slave.opt	2011-07-09 22:08:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_mts_rec_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 --relay-log-recovery=1
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 --relay-log-recovery=1

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt	2011-07-08 19:40:52 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --slave-worker-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mts_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_mts_crash_safe-slave.opt	2011-06-25 14:14:24 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mts_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mts_rec_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_mts_rec_crash_safe-slave.opt	2011-07-09 22:08:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mts_rec_crash_safe-slave.opt	2011-07-13 15:23:57 +0000
@@ -1 +1 @@
---slave-transaction-retries=0 --slave-worker-info-repository=TABLE --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 --relay-log-recovery=1
+--slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 --relay-log-recovery=1

=== removed file 'mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result'
--- a/mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result	2011-06-15 17:12:11 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_worker_info_repository_basic.result	1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-'#---------------------BS_STVARS_002_01----------------------#'
-SELECT @@GLOBAL.slave_worker_info_repository;
-@@GLOBAL.slave_worker_info_repository
-FILE
-SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
-COUNT(@@GLOBAL.slave_worker_info_repository)
-1
-1 Expected
-SELECT COUNT(@@SESSION.slave_worker_info_repository);
-ERROR HY000: Variable 'slave_worker_info_repository' is a GLOBAL variable
-'#---------------------BS_STVARS_002_02----------------------#'
-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.slave_worker_info_repository = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='slave_worker_info_repository';
-@@GLOBAL.slave_worker_info_repository = VARIABLE_VALUE
-1
-1 Expected
-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='slave_worker_info_repository';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_002_05----------------------#'
-SELECT COUNT(@@slave_worker_info_repository);
-COUNT(@@slave_worker_info_repository)
-1
-1 Expected
-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

=== removed file 'mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test'
--- a/mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test	2011-06-15 17:12:11 +0000
+++ b/mysql-test/suite/sys_vars/t/slave_worker_info_repository_basic.test	1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
-############## mysql-test\t\worker_info_repository_basic.test #################
-#                                                                             #
-# Variable Name: worker_info_repository                                       #
-# Scope: Global                                                               #
-# Access Type: Static                                                         #
-# Data Type: enumeration                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2010-12-09                                                   #
-# Author : Alfranio Correia                                                   #
-#                                                                             #
-#                                                                             #
-# 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                                                  #
-#                                                                             #
-# Reference:                                                                  #
-#    http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html      #
-#                                                                             #
-###############################################################################
---source include/not_slave_worker_info_table.inc
-
---echo '#---------------------BS_STVARS_002_01----------------------#'
-####################################################################
-#   Displaying default value                                       #
-####################################################################
-SELECT @@GLOBAL.slave_worker_info_repository;
-
-SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
---echo 1 Expected
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-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.slave_worker_info_repository= "TABLE";
-
-SELECT @@GLOBAL.slave_worker_info_repository;
-
-
---echo '#---------------------BS_STVARS_002_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
-SELECT @@GLOBAL.slave_worker_info_repository = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='slave_worker_info_repository';
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
---echo 1 Expected
-
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='slave_worker_info_repository';
---echo 1 Expected
-
-
---echo '#---------------------BS_STVARS_002_05----------------------#'
-################################################################################
-# Check if slave_worker_info_repository can be accessed with and without @@ sign
-################################################################################
-
-SELECT COUNT(@@slave_worker_info_repository);
---echo 1 Expected
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.slave_worker_info_repository);
-
-SELECT COUNT(@@GLOBAL.slave_worker_info_repository);
---echo 1 Expected

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	2011-06-29 07:04:19 +0000
+++ b/sql/binlog.cc	2011-07-13 15:23:57 +0000
@@ -3400,9 +3400,8 @@ bool MYSQL_BIN_LOG::append(Log_event* ev
   DBUG_PRINT("info",("max_size: %lu",max_size));
   if (flush_and_sync(0))
     goto err;
-  if ((uint) my_b_append_tell(&log_file) > max_size ||
-      (DBUG_EVALUATE_IF("rotate_slave_debug_group", 1, 0) &&
-       my_b_append_tell(&log_file) > 500))
+  if ((uint) my_b_append_tell(&log_file) >
+      DBUG_EVALUATE_IF("rotate_slave_debug_group", 500, max_size))
     error= new_file_without_locking();
 err:
   mysql_mutex_unlock(&LOCK_log);
@@ -3433,9 +3432,8 @@ bool MYSQL_BIN_LOG::appendv(const char*
   DBUG_PRINT("info",("max_size: %lu",max_size));
   if (flush_and_sync(0))
     goto err;
-  if ((uint) my_b_append_tell(&log_file) > max_size ||
-      (DBUG_EVALUATE_IF("rotate_slave_debug_group", 1, 0) &&
-       my_b_append_tell(&log_file) > 500))
+  if ((uint) my_b_append_tell(&log_file) >
+      DBUG_EVALUATE_IF("rotate_slave_debug_group", 500, max_size))
     error= new_file_without_locking();
 err:
   if (!error)
@@ -4249,12 +4247,15 @@ err:
 /**
   Wait until we get a signal that the relay log has been updated.
 
-  @param thd		Thread variable
+  @param[in] thd        Thread variable
+  @param[in] timeout    a pointer to a timespec;
+                        NULL means to wait w/o timeout.
+
+  @retval    0          if got signalled on update
+  @retval    non-0      if wait timeout elapsed
 
   @note
     One must have a lock on LOCK_log before calling this function.
-    This lock will be released before return! That's required by
-    THD::enter_cond() (see NOTES in sql_class.h).
 */
 
 int MYSQL_BIN_LOG::wait_for_update_relay_log(THD* thd, const struct timespec *timeout)
@@ -5231,7 +5232,6 @@ int THD::decide_logging_format(TABLE_LIS
          multi_access_engine= TRUE;
 
       prev_access_table= table->table;
-
     }
 
     DBUG_PRINT("info", ("flags_write_all_set: 0x%llx", flags_write_all_set));

=== modified file 'sql/lock.cc'
--- a/sql/lock.cc	2011-07-08 06:44:35 +0000
+++ b/sql/lock.cc	2011-07-13 15:23:57 +0000
@@ -155,9 +155,7 @@ lock_tables_check(THD *thd, TABLE **tabl
         since this would be a DOS attack.
       */
       if ((t->reginfo.lock_type >= TL_READ_NO_INSERT ||
-          thd->lex->sql_command == SQLCOM_LOCK_TABLES) && 
-          thd->lex->sql_command != SQLCOM_ALTER_TABLE &&
-          !thd->slave_thread)
+          thd->lex->sql_command == SQLCOM_LOCK_TABLES))
       {
           my_error(ER_CANT_LOCK_RPL_INFO_TABLE, MYF(0));
           DBUG_RETURN(1);

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2011-07-12 11:46:23 +0000
+++ b/sql/log_event.cc	2011-07-13 15:23:57 +0000
@@ -2603,8 +2603,7 @@ Slave_worker *Log_event::get_slave_worke
       However if the worker exits earlier reclaiming for both happens anyway at
       GAQ delete.
     */
-
-    if (!ret_worker->relay_log_change_notified) // ALFRANIO
+    if (!ret_worker->relay_log_change_notified)
     {
       /*
         Prior this event, C rotated the relay log to drop each
@@ -6675,7 +6674,7 @@ int Xid_log_event::do_apply_event_worker
     ulong gaq_idx= mts_group_cnt;
     Slave_job_group *ptr_g= gaq->get_job_group(gaq_idx);
 
-    if ((error= w->commit_positions(this, ptr_g)))
+    if ((error= w->commit_positions(this, ptr_g, true)))
       goto err;
   }
 

=== modified file 'sql/rpl_info.h'
--- a/sql/rpl_info.h	2011-07-08 06:44:35 +0000
+++ b/sql/rpl_info.h	2011-07-13 15:23:57 +0000
@@ -20,7 +20,6 @@
 #include "sql_class.h"
 #include "rpl_info_handler.h"
 #include "rpl_reporting.h"
-#include "rpl_constants.h"
 
 enum enum_info_repository
 {
@@ -58,8 +57,14 @@ public:
 
   THD *info_thd;
 
+/**
+  Defines the fields that are used as primary keys in a table.
+*/
   ulong *uidx;
 
+/**
+  The number of fields that are used as primary keys in a table.
+*/
   uint nidx;
 
   bool inited;
@@ -154,7 +159,7 @@ protected:
   Rpl_info_handler *handler;
   uint rpl_info_type;
 
-  Rpl_info(const char *type
+  Rpl_info(const char* type
 #ifdef HAVE_PSI_INTERFACE
            ,PSI_mutex_key *param_key_info_run_lock,
            PSI_mutex_key *param_key_info_data_lock,

=== modified file 'sql/rpl_info_factory.h'
--- a/sql/rpl_info_factory.h	2011-07-08 06:44:35 +0000
+++ b/sql/rpl_info_factory.h	2011-07-13 15:23:57 +0000
@@ -28,7 +28,6 @@
 
 extern ulong opt_mi_repository_id;
 extern ulong opt_rli_repository_id;
-extern ulong opt_worker_repository_id;
 
 class Rpl_info_factory
 {

=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc	2011-07-08 06:44:35 +0000
+++ b/sql/rpl_rli.cc	2011-07-13 15:23:57 +0000
@@ -770,7 +770,7 @@ void Relay_log_info::inc_group_relay_log
   */
   DBUG_ASSERT(!is_parallel_exec() ||
               mts_group_status != Relay_log_info::MTS_IN_GROUP);
-  flush_info(TRUE);  // todo: error branch
+  flush_info(is_transactional() ? TRUE : FALSE);  // todo: error branch
 
   mysql_cond_broadcast(&data_cond);
   if (!skip_lock)
@@ -1091,7 +1091,7 @@ void Relay_log_info::cleanup_context(THD
 {
   DBUG_ENTER("Relay_log_info::cleanup_context");
 
-  DBUG_ASSERT((info_thd == thd));
+  DBUG_ASSERT(info_thd == thd);
   /*
     1) Instances of Table_map_log_event, if ::do_apply_event() was called on them,
     may have opened tables, which we cannot be sure have been closed (because

=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	2011-07-12 11:46:23 +0000
+++ b/sql/rpl_rli_pdb.cc	2011-07-13 15:23:57 +0000
@@ -79,11 +79,14 @@ Slave_worker::Slave_worker(Relay_log_inf
 #endif
                   ), c_rli(rli),
     checkpoint_relay_log_pos(0), checkpoint_master_log_pos(0),
-    inited_group_executed(0),  checkpoint_seqno(0), running_status(NOT_RUNNING),
-    inited_curr_group_exec_parts(0)
+    checkpoint_seqno(0), running_status(NOT_RUNNING)
 {
   checkpoint_relay_log_name[0]= 0;
   checkpoint_master_log_name[0]= 0;
+  my_init_dynamic_array(&curr_group_exec_parts, sizeof(db_worker_hash_entry*),
+                        SLAVE_INIT_DBS_IN_GROUP, 1);
+  bitmap_init(&group_executed, NULL, c_rli->checkpoint_group, FALSE);
+  bitmap_init(&group_shifted, NULL, c_rli->checkpoint_group, FALSE);
   mysql_mutex_init(key_mutex_slave_parallel_worker, &jobs_lock,
                    MY_MUTEX_INIT_FAST);
   mysql_cond_init(key_cond_slave_parallel_worker, &jobs_cond, NULL);
@@ -91,15 +94,9 @@ Slave_worker::Slave_worker(Relay_log_inf
 
 Slave_worker::~Slave_worker() 
 {
-  if (inited_curr_group_exec_parts)
-    delete_dynamic(&curr_group_exec_parts);
-
-  if (inited_group_executed)
-  {
-    bitmap_free(&group_executed);
-    bitmap_free(&group_shifted);
-  }
-
+  delete_dynamic(&curr_group_exec_parts);
+  bitmap_free(&group_executed);
+  bitmap_free(&group_shifted);
   mysql_mutex_destroy(&jobs_lock);
   mysql_cond_destroy(&jobs_cond);
 }
@@ -160,20 +157,6 @@ int Slave_worker::init_info()
   if (inited)
     DBUG_RETURN(0);
 
-  my_init_dynamic_array(&curr_group_exec_parts, sizeof(db_worker_hash_entry*),
-                        SLAVE_INIT_DBS_IN_GROUP, 1);
-  if (curr_group_exec_parts.max_element != 0)
-    inited_curr_group_exec_parts= 1;
-  if (bitmap_init(&group_executed, NULL,
-                  c_rli->checkpoint_group, FALSE))
-    goto err;
-  
-  if (bitmap_init(&group_shifted, NULL,
-                  c_rli->checkpoint_group, FALSE))
-    goto err;
-
-  inited_group_executed= 1;
-
   /*
     The init_info() is used to either create or read information
     from the repository, in order to initialize the Slave_worker.
@@ -316,7 +299,7 @@ size_t Slave_worker::get_number_worker_f
   return sizeof(info_slave_worker_fields)/sizeof(info_slave_worker_fields[0]);
 }
 
-bool Slave_worker::commit_positions(Log_event *ev, Slave_job_group* ptr_g)
+bool Slave_worker::commit_positions(Log_event *ev, Slave_job_group* ptr_g, bool force)
 {
   DBUG_ENTER("Slave_worker::checkpoint_positions");
 
@@ -374,7 +357,7 @@ bool Slave_worker::commit_positions(Log_
              "group master log name %s checkpoint sequence number %lu.",
              id, group_master_log_pos, group_master_log_name, checkpoint_seqno));
 
-  error= flush_info(TRUE);
+  error= flush_info(force);
    
   DBUG_RETURN(error);
 }
@@ -916,7 +899,7 @@ void Slave_worker::slave_worker_ends_gro
 
     if (!(ev->get_type_code() == XID_EVENT && is_transactional()))
     {
-      commit_positions(ev, ptr_g);
+      commit_positions(ev, ptr_g, false);
 
       DBUG_EXECUTE_IF("crash_after_commit_and_update_pos",
                        DBUG_SUICIDE(););

=== modified file 'sql/rpl_rli_pdb.h'
--- a/sql/rpl_rli_pdb.h	2011-07-12 11:46:23 +0000
+++ b/sql/rpl_rli_pdb.h	2011-07-13 15:23:57 +0000
@@ -279,7 +279,6 @@ public:
   ulonglong checkpoint_master_log_pos;
   MY_BITMAP group_executed; // bitmap describes groups executed after last CP
   MY_BITMAP group_shifted;  // temporary bitmap to compute group_executed
-  bool inited_group_executed;
   ulong checkpoint_seqno;   // the most significant ON bit in group_executed
   enum en_running_state
   {
@@ -293,7 +292,6 @@ public:
     Coordinator or Worker itself needs to hold when write a new value.
   */
   en_running_state volatile running_status;
-  bool inited_curr_group_exec_parts;
 
   int init_worker(Relay_log_info*, ulong);
   int init_info();
@@ -301,7 +299,7 @@ public:
   int flush_info(bool force= FALSE);
   size_t get_number_worker_fields();
   void slave_worker_ends_group(Log_event*, int);
-  bool commit_positions(Log_event *evt, Slave_job_group *ptr_g);
+  bool commit_positions(Log_event *evt, Slave_job_group *ptr_g, bool force);
 
 protected:
 

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-07-12 11:46:23 +0000
+++ b/sql/rpl_slave.cc	2011-07-13 15:23:57 +0000
@@ -191,7 +191,7 @@ static int terminate_slave_thread(THD *t
 static bool check_io_slave_killed(THD *thd, Master_info *mi, const char *info);
 int slave_worker_exec_job(Slave_worker * w, Relay_log_info *rli);
 static int mts_event_coord_cmp(LOG_POS_COORD *id1, LOG_POS_COORD *id2);
-static bool purge_workers(Relay_log_info* rli);
+static bool remove_workers(Relay_log_info* rli);
 
 /*
   Find out which replications threads are running
@@ -485,7 +485,6 @@ void end_info(Master_info* mi)
 int remove_info(Master_info* mi)
 {
   int error= 1;
-  Slave_worker *worker= NULL;
   DBUG_ENTER("remove_info");
   DBUG_ASSERT(mi != NULL && mi->rli != NULL);
 
@@ -505,33 +504,8 @@ int remove_info(Master_info* mi)
   mi->end_info();
   mi->rli->end_info();
 
-  if (mi->remove_info())
-    goto err;
-
-  for (uint id= 0; id < mi->rli->recovery_parallel_workers; id++)
-  {
-    if (!(worker=
-          Rpl_info_factory::create_worker(opt_worker_repository_id, id, mi->rli)))
-      goto err;
-
-    if (worker->init_info())
-    {
-      delete worker;
-      goto err;
-    }
-
-    worker->end_info();
-
-    if (worker->remove_info())
-    {
-      delete worker;
-      goto err;
-    }
-
-    delete worker;
-  }
-
-  if (mi->rli->remove_info())
+  if (mi->remove_info() || remove_workers(mi->rli) ||
+      mi->rli->remove_info())
     goto err;
 
   error= 0;
@@ -576,6 +550,41 @@ int flush_master_info(Master_info* mi, b
   DBUG_RETURN (err);
 }
 
+/*
+  Remove worker's entries from the repositories.
+*/
+bool remove_workers(Relay_log_info* rli)
+{
+  Slave_worker *worker= NULL;
+
+  for (uint id= 0; id < rli->recovery_parallel_workers; id++)
+  {
+    if (!(worker=
+          Rpl_info_factory::create_worker(opt_rli_repository_id, id, rli)))
+      goto err;
+
+    if (worker->init_info())
+    {
+      delete worker;
+      goto err;
+    }
+
+    worker->end_info();
+
+    if (worker->remove_info())
+    {
+      delete worker;
+      goto err;
+    }
+
+    delete worker;
+  }
+  return false;
+
+err:
+  return true;
+}
+
 /**
   Convert slave skip errors bitmap into a printable string.
 */
@@ -3929,7 +3938,7 @@ bool mts_recovery_groups(Relay_log_info
   for (uint id= 0; id < rli->recovery_parallel_workers; id++)
   {
     Slave_worker *worker=
-      Rpl_info_factory::create_worker(opt_worker_repository_id, id, rli);
+      Rpl_info_factory::create_worker(opt_rli_repository_id, id, rli);
     worker->init_info();
     LOG_POS_COORD w_last= { const_cast<char*>(worker->get_group_master_log_name()),
                             worker->get_group_master_log_pos() };
@@ -4274,7 +4283,7 @@ int slave_start_single_worker(Relay_log_
   Slave_worker *w= NULL;
 
   if (!(w=
-      Rpl_info_factory::create_worker(opt_worker_repository_id, i, rli)))
+      Rpl_info_factory::create_worker(opt_rli_repository_id, i, rli)))
   {
     sql_print_error("Failed during slave worker thread create");
     error= 1;
@@ -7135,7 +7144,8 @@ bool change_master(THD* thd, Master_info
     THD_STAGE_INFO(thd, stage_purging_old_relay_logs);
     if (mi->rli->purge_relay_logs(thd,
                                   0 /* not only reset, but also reinit */,
-                                  &errmsg) || purge_workers(mi->rli))
+                                  &errmsg) ||
+        remove_workers(mi->rli))
     {
       my_error(ER_RELAY_LOG_FAIL, MYF(0), errmsg);
       ret= TRUE;
@@ -7211,35 +7221,6 @@ err:
     my_ok(thd);
   DBUG_RETURN(ret);
 }
-
-bool purge_workers(Relay_log_info* rli)
-{
-  /*
-    We need to test this better. ALFRANIO
-  */
-  for (uint id= 0; id < rli->recovery_parallel_workers; id++)
-  {
-    Slave_worker *worker=
-      Rpl_info_factory::create_worker(opt_worker_repository_id, id, rli);
-    /*
-      This retrieves information from repository into memory.
-    */
-    worker->init_info();
-    /*
-      This removes information from the repository.
-    */
-    worker->remove_info();
-    /*
-      This closes the repository.
-    */
-    worker->end_info();
-    delete worker;
-  }
-
-  return false;
-}
-
-
 /**
   @} (end of group Replication)
 */

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2011-07-08 06:44:35 +0000
+++ b/sql/sql_parse.cc	2011-07-13 15:23:57 +0000
@@ -300,7 +300,8 @@ void init_update_queries(void)
                                             CF_CAN_GENERATE_ROW_EVENTS;
   sql_command_flags[SQLCOM_CREATE_INDEX]=   CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_ALTER_TABLE]=    CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
-                                            CF_AUTO_COMMIT_TRANS;
+                                            CF_AUTO_COMMIT_TRANS |
+                                            CF_WRITE_RPL_INFO_COMMAND;
   sql_command_flags[SQLCOM_TRUNCATE]=       CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
                                             CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_DROP_TABLE]=     CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2011-07-08 06:44:35 +0000
+++ b/sql/sys_vars.cc	2011-07-13 15:23:57 +0000
@@ -580,19 +580,13 @@ static Sys_var_enum Sys_mi_repository(
 ulong opt_rli_repository_id;
 static Sys_var_enum Sys_rli_repository(
        "relay_log_info_repository",
-       "Defines the type of the repository for the relay log information."
+       "Defines the type of the repository for the relay log information "
+       "and associated workers."
        ,GLOBAL_VAR(opt_rli_repository_id), CMD_LINE(REQUIRED_ARG),
        repository_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
        ON_CHECK(relay_log_info_repository_check),
        ON_UPDATE(0));
 
-ulong opt_worker_repository_id;
-static Sys_var_enum Sys_worker_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));
-
 static Sys_var_mybool Sys_binlog_rows_query(
        "binlog_rows_query_log_events",
        "Allow writing of Rows_query_log events into binary log.",
@@ -3322,8 +3316,7 @@ static Sys_var_uint Sys_sync_relayloginf
 static Sys_var_uint Sys_checkpoint_mts_period(
        "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).",
+       "the relay log info to disk after every #th milli-seconds.",
        GLOBAL_VAR(mts_checkpoint_period), CMD_LINE(REQUIRED_ARG),
 #ifndef DBUG_OFF
        VALID_RANGE(0, UINT_MAX), DEFAULT(300), BLOCK_SIZE(1));

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-next-mr-wl5569 branch (alfranio.correia:3344 to 3345)WL#5569Alfranio Correia13 Jul