From: Andrei Elkin Date: July 6 2011 10:29am Subject: bzr push into mysql-next-mr-wl5569 branch (andrei.elkin:3334 to 3335) WL#5569 List-Archive: http://lists.mysql.com/commits/140216 Message-Id: <201107061029.p66AT8uJ007947@mysql1000.dsl.inet.fi> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3335 Andrei Elkin 2011-07-06 wl#5569 MTS refining wait for db-hash entry release at event distribution. The graceful STOP is not accepted at this point so Coordinator continues to stay in a loop. modified: sql/rpl_rli_pdb.cc 3334 Andrei Elkin 2011-07-05 bug#12719875 possible MTS recovery issue. MTS stopped with an error after failing to apply an event. It turned out that the event was sceduled incorrectly due to earlier stop by Single-Threaded Slave not at the group boundary but rather in the middle of it. Fixed with forcing CREATE..SELECT be logged as two groups. The CREATE-TABLE group is surrounded with its own BEGIN/COMMIT braces. @ mysql-test/suite/rpl/r/rpl_parallel_switch_sequential.result new results file is added. @ mysql-test/suite/rpl/t/rpl_parallel_switch_sequential-slave.opt transaction retry is not supported yet by MTS. @ mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test Regression test for bug#12719875 is added. Notice, created tables engine is Innodb also because with MyISAM stop-slave can be actually in the middle a group of myisam table events so the following restart fails with a dup key error. CREATE-SELECT is not tested according to another bug as commented. @ sql/log_event.cc changing error report style to be actually effective: rli->report() does not make rli->info_thd to return from is_error() true. my_error() message eventually gets to the show-slave-status sql-error at the end of slave sql thread. @ sql/rpl_slave.cc fixing a possible hanging that can happen due to errored-out worker at time of gaq is full and the worker was the first to update it; refining asserts; shifting stop_workers() routine to a point where slave sql has not reset its errors which pleases a refined assert in slave_stop_workers(rli). added: mysql-test/suite/rpl/r/rpl_parallel_switch_sequential.result mysql-test/suite/rpl/t/rpl_parallel_switch_sequential-slave.opt mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test modified: sql/log_event.cc sql/rpl_slave.cc === modified file 'sql/rpl_rli_pdb.cc' --- a/sql/rpl_rli_pdb.cc 2011-07-02 07:58:56 +0000 +++ b/sql/rpl_rli_pdb.cc 2011-07-06 09:46:05 +0000 @@ -772,17 +772,22 @@ Slave_worker *map_db_to_worker(const cha // future assignenment and marking at the same time entry->worker= last_worker; - sprintf(wait_info, info_format, entry->worker->id, entry->db); + // loop while a user thread is stopping Coordinator gracefully + do + { + proc_info= thd->enter_cond(&slave_worker_hash_cond, + &slave_worker_hash_lock, wait_info); + mysql_cond_wait(&slave_worker_hash_cond, &slave_worker_hash_lock); + } while (entry->usage != 0 && !thd->killed); - proc_info= thd->enter_cond(&slave_worker_hash_cond, &slave_worker_hash_lock, - wait_info); - mysql_cond_wait(&slave_worker_hash_cond, &slave_worker_hash_lock); thd->exit_cond(proc_info); + if (thd->killed) + { + entry= NULL; + goto err; + } mysql_mutex_lock(&slave_worker_hash_lock); - - DBUG_ASSERT(entry->usage == 0 || thd->killed); - entry->usage= 1; entry->worker->usage_partition++; } No bundle (reason: useless for push emails).