Skip to content

Commit 328b6c0

Browse files
author
Andrei Elkin
committed
WL#5596 MTS
Here is the total cset combining all revisions done since Sep 2010. Comments from the original commits are pasted in reverse chronological order. ------------------------------------------------------------ revno: 3364 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-08-18 17:09:22 +0300 message: wl#5569 MTS Refining rpl_rotate_logs that could not produce deterministic output. The list of binlogs contained one binlog more than expected. @ mysql-test/suite/rpl/r/rpl_rotate_logs.result results updated. @ mysql-test/suite/rpl/t/rpl_rotate_logs.test Refining a method of verification of the binlog rotation due to its max size: we check if the first log has been rotated by comparing its name before and after feeding load to the master. Notice, that as the former so the new current proof methods are not perfect as that part of the test really needs to demostrate every binlog file is less than @@max_binlog_size. ------------------------------------------------------------ revno: 3363 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-08-18 14:56:01 +0300 message: updating result files that were left incorrect by the last merge. ------------------------------------------------------------ revno: 3362 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-08-18 14:44:59 +0300 message: wl#5569 MTS Failure in recovery when binlog-checksum is active. The reason of the failure was in that parsing of relay log by MTS recovery gaps computing did not make sure to use the relay-log own FormatDescriptor events that contain checksumming info for all events in the log. Fixed with taking care to find out the checksum algorithm for every relay log as the first step of MTS recovery gaps computing. @ mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe_checksum-master.opt forcing master to checksum. @ mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe_checksum-slave.opt forcing slave to *not* checksum. @ mysql-test/suite/rpl/t/rpl_mixed_mts_rec_crash_safe_checksum.test same as rpl_mixed_mts_rec_crash_safe but to run in master with checksum and slave without own checksum. The test verifies that checksum does not affect recovery. Lack of own checksumming on slave allows to test more scenarios. @ sql/rpl_slave.cc Search for the checksum algorithm FD is added. Notice that the first three events to read is enough to find out the master side checksum alg. ------------------------------------------------------------ revno: 3361 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-08-17 11:21:23 +0300 message: merge from trunk forced to resolve few semantical conflicts caused by changes in THD::enter_cond() of the trunk. ------------------------------------------------------------ revno: 3360 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-07-27 08:56:14 +0100 message: Fixed failure in test rpl_mts_check_concurrency when running in the mts collection. ------------------------------------------------------------ revno: 3359 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-07-26 19:46:41 +0100 message: Added a test case that checks if MTS allows to concurrently access the replication tables, and as such, concurrently commit transactions that update different databases. ------------------------------------------------------------ revno: 3358 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-22 20:08:43 +0100 message: Configured rpl_parallel_switch_sequential to run in row and mixed mode to avoid cluttering the error log with messages on unsafe execution. ------------------------------------------------------------ revno: 3357 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-22 19:02:14 +0100 message: This patch contains the following fixes: . Removed suppressed warning introduced in the wrong test case (i.e. rpl_corruption) and put it in the correct one (i.e. rpl_row_corruption). . Introduced variable to avoid clutering the error log with several warning messages on unsafe execution. ------------------------------------------------------------ revno: 3356 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-22 11:01:12 +0100 message: This patch has the following changes: . Specific directories were created for the MTS runs in the default.push. . Warning message was suppressed in the rpl_corruption.test. . Annoying debug outputs were removed from the error log. However, this is a temporary solution as it forbids to enable traces. ------------------------------------------------------------ revno: 3355 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-07-20 11:56:40 +0100 message: merge mysql-trunk --> mysql-next-mr-wl5569 ------------------------------------------------------------ revno: 3354 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-07-19 22:26:30 +0300 message: wl#5569 MTS valgrind reported a stack on rpl_savepoint. The problem appears to be in that at computing slave_sql_running_state in show_mater_info() the sql thread proc_info pointer could refer to a value in a stack that has already gone. Fixed with making proc_info to point to a string literal. ------------------------------------------------------------ revno: 3353 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-07-19 17:46:43 +0100 message: Suppressed warning messages that could potentially cause problems while running mts crash safe test cases. ------------------------------------------------------------ revno: 3352 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-07-18 21:46:45 +0300 message: wl#5569 MTS Cosmetic changes are done to address readability and clearness of source code of the MTS patch. @ sql/binlog.cc Comments improved. @ sql/log_event.cc Warning text is improved. @ sql/log_event.h More comments are added. @ sql/rpl_rli.h More comments are added. @ sql/rpl_slave.cc Error constant was changed. @ sql/share/errmsg-utf8.txt Error constant is changed. ------------------------------------------------------------ revno: 3351 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-07-18 14:52:44 +0300 message: wl#5569 MTS Inadvertently introduced hunk two rev:s back is reverted to please rpl_*_mts_crash_safe. ------------------------------------------------------------ revno: 3350 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-07-17 00:51:45 +0300 message: wl#5569 MTS fixing build issue for embedded. Public visibility for Rows_log_event::do_apply_event() is restored. ------------------------------------------------------------ revno: 3349 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-07-16 20:08:31 +0300 message: wl#5569 MTS The patch contains improvements after code review. Changes are mostly consmetic. @ mysql-test/suite/rpl/r/rpl_parallel_start_stop.result results updated. @ sql/binlog.cc correcting comments. @ sql/field.cc renaming. @ sql/log_event.cc renaming and separating out a block of code in Log_event::get_slave_worker() into a new method of Slave_job_group class; some cleanup. @ sql/log_event.h Extending and improving comments; renaming to follow is_, get_, set_ pattern; restoring the private access to do_apply_event() in Rows_log_event. @ sql/mysqld.cc removing extra declaration. @ sql/rpl_info_factory.cc Minor comments is added. @ sql/rpl_rli.cc renaming to make _cnt suffix to all entities that have counter meaning in mts; improving comments. @ sql/rpl_rli.h Renaming, and improving comments for the new members to Relay_log_info. @ sql/rpl_rli_pdb.cc remaning. @ sql/rpl_rli_pdb.h Improving comments readability through adding legengs defining MTS specific abbreviations. @ sql/rpl_slave.cc Renaming; minor cleanup in sql_slave_killed(); adding comments on Seconds_behind_master update policy with MTS. @ sql/share/errmsg-utf8.txt Improving text of few errors. ------------------------------------------------------------ revno: 3348 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-07-16 02:11:11 +0300 message: bug#12755663 MTS: RPL_CIRCULAR_FOR_4_HOSTS FAILS: CANT EXECUTE THE CURRENT EVENT GROUP MTS stopped with an error in the middle of the test. The reason is that a group of events from the slave itself was processed partly to modify the group position. In the following restart the wrong group bondary made slave either to error out or assert. Fixed with locating a possible race condition allowin Coordinator to ignore actual failed status of a Worker. So in the case of the test, the slave server group can't be started. Notice, this is a trial patch since I can't catch the failure on available to me hosts at all. @ sql/rpl_rli_pdb.cc Changing the running status of the Worker before it releases assigned entries. That ensure that the waiting in wait_for_workers_to_finish() Coordinator exits the function with a negative result and therefore stops without attempting to apply an event due to which it attempted synchronization. Couple of diagnostics into error log are added. They may be removed in short while but currently might be helpful to provide details if the failure won't disappear after this push. ------------------------------------------------------------ revno: 3347 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-07-14 12:40:06 +0300 message: WL#5569 MTS further extensive rpl_circular_for_4_hosts exersices with --repeat 10 --parallel=8 revealed a race condition in that Coordinator might miss to catch not-running status for a Worker. That made Coordinator to skip only a part of a group of the slave server own events so the slave stops at not the bondary of a group. Fixed with moving marking of the errored-out Worker as failed prior to its APH entries release. TODO: notice there can be a possibility to stop at not the boundary due to graceful STOP SLAVE if one is run at time of skipping self-originated events. However this issue belongs to STS and might be similar with BUG@12604951 and BUG@12728160. @ mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result results are updated. @ mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test tests is updated with a new text of a suppression. @ sql/log_event.cc Adding clarifying text to an error message when parallel execution fails. @ sql/rpl_rli_pdb.cc Moving marking of the errored-out Worker as failed prior to its APH entries release. That ensures Coordinator always finds the non-running status in a case it has to know that (wait_for_workers_to_finish()). @ sql/share/errmsg-utf8.txt Adding a format specifier for a clarifying text. ------------------------------------------------------------ revno: 3346 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-07-14 08:03:55 +0100 message: Post-push fixes for WL#5569 Injecting faults while updating a myisam table requires to flush the changes before committing suicide. So we have introduced the follwing code: DBUG_EXECUTE_IF("crash_after_commit_and_update_pos", - DBUG_SUICIDE();); + sql_print_information("Crashing crash_after_commit_and_update_pos."); + flush_info(TRUE); + DBUG_SUICIDE(); Besides we improved some comments. ------------------------------------------------------------ revno: 3345 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-07-13 16:23:57 +0100 message: 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. ------------------------------------------------------------ revno: 3344 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-07-13 00:10:43 +0300 message: wl#5569 MTS merge trunk -> wl5569-tree ------------------------------------------------------------ revno: 3343 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-07-12 23:36:17 +0300 message: wl#5569 MTS adding suppression due to expected warning to rpl_circurlar_for_4_hosts; decreasing a loop limit in rpl_parallel_switch_sequential in case of statement format. ------------------------------------------------------------ revno: 3342 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-07-12 14:46:23 +0300 message: WL#5569 MTS Fixing code and test due to rpl.rpl_circular_for_4_hosts mismatch failure, like http://pb2.norway.sun.com/?action=archive_download&archive_id=3608382. The reason of the mismatch was that when having two group of events to execute, the first for a Worker and the 2nd for Coordinator, Coordinator waited for the 1st group completion but did not verify success of synchronization. So in a case of the failed applying of the 1st group processing of the 2nd could find an inconsistent state to end up with a segfault (even though only the mismatch has been seen so far). @ mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result results are updated. @ mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test Test is updated to include a part specific to MTS. While all former conditions hold, the new section makes sure B server has two group of events to send which was not previously guaraneed nor necessary. Further, when the first of the two fails with Duplicate entry at applying of the 2nd Coordinator senses the first failure and gives out the 2nd. The first error remains to be seen in show-slave-status. @ sql/log_event.cc Checking wait_for_workers_to_finish() return code in case Coordinator executes a sequential-mode event. Comments are deployed in few other places where that is unnecessary to do. @ sql/rpl_rli_pdb.cc Worker marks itself as failed to apply which fact is reported to Coordinator also through wait_for_workers_to_finish(). Coodinator shall check the error code in a branch of a sequential event applying. @ sql/rpl_rli_pdb.h Adding a new state that Worker sets itself to indiate its failure to apply. @ sql/rpl_slave.cc Refining an assert as consequence of the new state and its actual setting by Worker. ------------------------------------------------------------ revno: 3341 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-07-10 22:40:01 +0100 message: Avoiding busy waiting when running mts recovery tests. ------------------------------------------------------------ revno: 3340 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-07-09 23:11:58 +0100 message: Removed --slave-checkpoint-period from MTS test cases. ------------------------------------------------------------ revno: 3339 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-07-09 23:08:07 +0100 message: Improved test cases for the WL#5569. ------------------------------------------------------------ revno: 3338 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-08 22:40:52 +0300 message: wl#5569 MTS The patch refines logics of applying phase of MTS-recovery to always applying events that are for Coordinator; fixes few tests to make them passable on PB; makes GAQ size to be of checkpoint_group value. @ mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test attempting to decrease execution time that currently might be too much for some PB hosts. @ mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt Making the test to run in parallel mode with Workers having the table as their info storage. @ mysql-test/suite/sys_vars/r/slave_checkpoint_period_basic.result results updated. @ mysql-test/suite/sys_vars/t/slave_checkpoint_period_basic.test masking out the actual value of slave_checkpoint_period. @ sql/log_event.cc Never skip events that are for Coordinator as indicated by mts_execution_mode(). @ sql/rpl_rli.h Improving comments. @ sql/rpl_slave.cc Simplifying while condition of the GAQ-progress loop and deploying an assert ensuring checkpoint_group parameter and GAQ state are combined correctly. ------------------------------------------------------------ revno: 3337 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-08 07:54:34 +0100 message: Reduced the timeout period to run the checkpoint routine by setting slave-checkpoint-period to 30. ------------------------------------------------------------ revno: 3336 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-08 07:44:35 +0100 message: merge mysql-trunk --> mysql-next-mr-wl5569 ------------------------------------------------------------ revno: 3335 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-07-06 12:46:05 +0300 message: 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. ------------------------------------------------------------ revno: 3334 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-07-05 20:43:04 +0300 message: 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). ------------------------------------------------------------ revno: 3333 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-07-04 18:14:09 +0300 message: wl#5569 MTS Adding a rule to run PB with all suites in MTS with binlog-format ROW. @ .bzr-mysql/default.conf restoring commits@. @ mysql-test/collections/default.push adding a rule to run all suites in MTS with binlog-format ROW. ------------------------------------------------------------ revno: 3332 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-07-03 23:29:34 +0300 message: wl5569 MTS cleanup in one file. @ sql/rpl_rli.cc removing traces of a mutex that was served in prototyping support for temporary tables. ------------------------------------------------------------ revno: 3331 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-07-03 23:16:02 +0300 message: wl5569 MTS bzr commit mail address changed; a minor cleanup to make mts_is_worker() with const argument; releasing a test to run in MTS. ------------------------------------------------------------ revno: 3330 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-07-02 08:58:56 +0100 message: Fixed use of the performance schema in the replication code and concurrency issue in the IO Thread. In particular, the IO Thread was calling flush_master_info without grabbing locks. ------------------------------------------------------------ revno: 3329 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-01 16:41:35 +0300 message: wl5569 MTS merging from the main repo. ------------------------------------------------------------ revno: 3328 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-01 15:48:25 +0300 message: wl#5569 MTS the final cleanup patch. There are few glitches that were considered as tolerable at least for time of the total wl's code is being reviewed. That includes: - no support to old load-data events - no support for FK to add to the list, there are few places in the patch that suggests to deploy error branches each time flush_info() is called. @ sql/log_event.h cleanup. @ sql/rpl_reporting.cc introducing a new public method in order to be callable from Slave_worker executed code. @ sql/rpl_reporting.h the earlier do_report is renamed and a new do_report() is made a way to allow child classes to redefine its own way. The child class is suppose to call child->report() and to have child::do_report() 's designed behaviour. @ sql/rpl_rli_pdb.cc addressing an OOM issue at delete of curr_group_exec_parts. @ sql/rpl_rli_pdb.h deploying do_`method' pattern. @ sql/rpl_slave.cc cleanup. ------------------------------------------------------------ revno: 3327 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-07-01 13:16:52 +0300 message: wl#5569 MTS The patch cleans up some host of code. @ sql/log_event.cc cleanup, comments improved, logics of decision in Log_event::apply_event on mts execution mode is simplified. Moving flush_info() of Rotate_log_event::do_update_pos() into inc_group_relay_log_pos(). @ sql/log_event.h cleanup and merging logics of former mts_async_exec_by_coordinator() with mts_sequential_exec() which is turned to be called from a new mts_execution_mode(). Reducing visibility of mts members of Log_event hierarchy to match the needs. @ sql/rpl_rli.cc cleanup, renames and moving flush_info() inside inc_group_relay_log_pos(). @ sql/rpl_rli.h Cleanup and comments improved. @ sql/rpl_rli_pdb.cc Cleanup; renames; comments; a new Slave_worker::init_worker() is defined to be called at starting the Worker pool per each worker. Its initialization instructions are migrated from from slave_start_single_worker(). @ sql/rpl_rli_pdb.h Cleanup and comments improved. @ sql/rpl_slave.cc cleanup; replacing collection of initializations for a Worker in slave_start_single_worker() into a new Worker::init_worker(). @ sql/sql_class.h cleanup. ------------------------------------------------------------ revno: 3326 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-06-28 11:30:18 +0300 message: wl#5569 MTS replacing views with regular tables for consistency verification in rpl_parallel_innodb. Also a minor cleanup in rpl_parallel is done. ------------------------------------------------------------ revno: 3325 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-06-27 20:31:45 +0300 message: wl#5569 MTS Cleanup and addressing sporadic rpl_temp_table_mix_row failure in post-execution mtr.check_testcase(). The check of the test failure was caused by faulty optimization in avoiding to migrate temporary tables from Coordinator to Workers in case of rows-event assignement. while it's correct with the homogenous rows-event only load, the mixture can fail. Fixed with removing the optimization so map_db_to_worker() always relocates which is somewhat suboptimal and should be improved in future. @ mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test Adding slave synchronization. @ sql/log_event.cc cleanup to move circular_buffer releated definitions into rpl_rli_pdb that is specialized on objects dealing with Worker, its assignement etc. improving comments; also instead of former separate flag indicating a T-event requires post-scheduling synchronization with the Worker is turned into a bit of existing Log_event::flags which also avoids ungliness of #if/#endif:s. @ sql/log_event.h instead of former separate flag indicating a T-event requires post-scheduling synchronization with the Worker is turned into a bit of existing Log_event::flags; @ sql/rpl_rli.cc cleanup: renaming. @ sql/rpl_rli.h cleanup: renaming, more comments. The former mts_wqs_overrun is converted into two: the statistics parameter mts_wq_overrun_cnt and the internal control parameter mts_wq_excess. @ sql/rpl_rli_pdb.cc Included rpl_slave.h that holds two necessary declarations; Cleanup: accepting circular_buffer related definitions migrated from log_event, improved comments, renaming, removing dead code @ sql/rpl_rli_pdb.h Cleanup: renaming and more comments are added. @ sql/rpl_slave.cc Augmenting print-out of statistics at the end of MTS session; cleanup: renaming. @ sql/rpl_slave.h Introducing two constants to define range of worker_id domain and a magic value of undefined worker. @ sql/sys_vars.cc replacing a literal int value with a symbilic constant. ------------------------------------------------------------ revno: 3324 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-06-27 13:12:52 +0100 message: Ensured that updates to the worker_info_repository are transactional and fixed the slave_checkpoint_group_basic test case. ------------------------------------------------------------ revno: 3323 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-26 13:02:59 +0100 message: Fixed test case. ------------------------------------------------------------ revno: 3322 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-06-25 15:14:24 +0100 message: Introduced test case for recovery with MTS and fixed bugs in recovery. ------------------------------------------------------------ revno: 3321 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-24 15:38:19 +0300 message: wl#5569 MTS This patch makes a bit of cleanup, addresses one memory-allocation todo and completes fixing valgrind report (rpl_parallel_start_stop) due to strings allocation in Slave_job_group items. ------------------------------------------------------------ revno: 3320 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-24 12:38:34 +0300 message: wl#5569 MTS this patch completes the previous one to fixes a result file and make the innodb specific test verification to base on tables not views. ------------------------------------------------------------ revno: 3319 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-24 00:11:22 +0300 message: wl#5569 MTS this is an exploratory patch to sort out if verification method what was based on views has its own not related to mts flaw. The patch calls verification macro on the tables that required some adjustment. ------------------------------------------------------------ revno: 3318 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-06-23 07:56:15 +0300 message: wl#5569 MTS fixing results of mysqld--help-win. ------------------------------------------------------------ revno: 3317 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-22 19:20:40 +0100 message: merge mysql-next-mr-wl5569 (local) --> mysql-next-mr-wl5569 ------------------------------------------------------------ revno: 3316 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-22 19:17:43 +0100 message: In some platforms, such as Windows, thread's wait time is stored in 100ns units. However, when computing the difference between two values, the result value was not multiplied by 100. Besides, there was a casting problem when the aforementioned result value was assigned to an ulong. ------------------------------------------------------------ revno: 3315 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-22 18:54:23 +0100 message: Fixed how mts copes with recovery. ------------------------------------------------------------ revno: 3314 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-06-21 19:10:54 +0300 message: wl#5569 MTS Fixing valgrind warnings. @ sql/log_event.cc w->running_status is verfied to find out the actually sought running status of a Worker. THD can be unavainlable that's what a valgrind report was about. @ sql/rpl_rli_pdb.cc commenting out an assert that valgrind does not like. @ sql/rpl_rli_pdb.h new method is added to be invoked at MTS shutdown. @ sql/rpl_slave.cc Invoking gaq cleanup at the end of MTS session. ------------------------------------------------------------ revno: 3313 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-06-21 18:15:43 +0300 message: wl#5569 MTS rpl_parallel_start_stop.test could fail sporadicaly with timeout. @ mysql-test/include/wait_for_slave_param.inc Correcting comments and handling of passed by caller $slave_timeout to make sure the unit of 1 second really holds. Introduced symbolic default_timeout, sleep_freq(uency) to procude time to sleep in between of two polls. @ mysql-test/suite/rpl/t/rpl_parallel_start_stop.test Since the default time to wait is less than one for innodb's wait for lock, the time to wait for error is set explicitly. ------------------------------------------------------------ revno: 3312 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-06-20 23:21:56 +0100 message: merge mysql-next-mr-wl5569 (local) --> mysql-next-mr-wl5569 ------------------------------------------------------------ revno: 3311 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-06-20 23:19:06 +0100 message: Fixed error when computing the Lower-Water-Mark. If two or more jobs were removed from the Group of assigned jobs and one of the jobs had a non-empty group relay log but the last one had an empty group relay log. The Lower-Water-Mark was not correctly updated, because the algorithm assumed that the group relay log was null. ------------------------------------------------------------ revno: 3310 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-06-20 11:52:44 +0100 message: Fixed valgrind errors. Slave_job_group was silently being cast to LOG_POS_COORD while calling sort_dynamic(&above_lwm_jobs, (qsort_cmp) mts_event_coord_cmp) and by consequence mts_event_coord_cmp(LOG_POS_COORD *, LOG_POS_COORD *). This had two problems: . The first two entries in the Slave_job_group were not a pointer to a char * and my_offset. . Even if the first two entries were char * and my_offset, such casting could lead to alignment problems. To fix the problem, we avoid this casting. ------------------------------------------------------------ revno: 3309 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-19 19:14:50 +0300 message: wl#5569 MTS fixing slave_transaction_retries_basic_64.result ------------------------------------------------------------ revno: 3308 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-19 16:11:25 +0300 message: wl#5569 MTS fixing tests. @ mysql-test/extra/rpl_tests/rpl_extra_col_master.test MTS-supperssion is necessary because the test is supposed to stop slave due to an error. @ mysql-test/extra/rpl_tests/rpl_relayrotate.test Load decreasing to prove a warning was caused by slow environment so waiting to accept the killed status by SQL thread was ended by 1 min timeout. @ mysql-test/suite/rpl/r/rpl_relayrotate.result results updated. @ mysql-test/suite/rpl/t/rpl_stm_000001.test A macro is expanded in order to isolate which branch of two activities a suffered timeout failure belongs in. @ mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result Fixing results of 64 version of the test that was editted in the prev push. ------------------------------------------------------------ revno: 3307 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-19 12:33:36 +0300 message: wl#5569 MTS Fixing rpl.rpl_mixed_binlog_max_cache_size that revealed incorrect asynchronous handling of a Rotate event which does not split the current group and therefore has to be executed after all previously scheduled events. Fixing sensetivity of two other tests to mtr's invocation environment that includes inital values of slave_parallel_workers and slave_transaction_retries. @ mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc made test insensetive to the value of slave_transaction_retries in mtr env. @ mysql-test/suite/sys_vars/r/slave_parallel_workers_basic.result made test insensetive to the value of slave_parallel_workers in mtr env. @ mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result made test insensetive to the value of slave_transaction_retries in mtr env. @ mysql-test/suite/sys_vars/t/slave_parallel_workers_basic.test made test insensetive to the value of slave_parallel_workers in mtr env. @ sql/log_event.cc get_slave_worker() passes need_temps argument as FALSE is case of rows-events. Correcting the actual value of `mts_in_group' of mts_async_exec_by_coordinator(). ------------------------------------------------------------ revno: 3306 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-19 09:04:19 +0100 message: Fixed some windows failures. ------------------------------------------------------------ revno: 3305 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sat 2011-06-18 19:58:21 +0100 message: Fixed some recovery issues. ------------------------------------------------------------ revno: 3304 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-17 21:01:58 +0300 message: wl#5569 MTS fixing tests and a segfault at the end of handle_slave_sql() happened after worker initialization failed (e.g rpl_row_log on win). @ mysql-test/extra/rpl_tests/rpl_loaddata.test MTS-suppression is added. @ mysql-test/suite/rpl/r/rpl_loaddata.result MTS-suppression is added. @ mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result MTS-suppression is added. @ mysql-test/suite/sys_vars/t/disabled.def constant nuisanse is disabled in the feature tree. Todo: do not merge it when pushing to the main tree. @ sql/rpl_slave.cc Moved workers initialization after one of the coordinator so that failure in the former routine is handled with a proper state of coordinator. . This fix eliminates segfault at the end of handle_slave_sql() for few tests but does not address the reason of worker initialization failure, like in rpl_row_log on win: 110616 7:37:57 [Note] Info file G:\pb2\test\sb_1-3486364-1308189142.46\mysql-5.6.3-m5-win-x86_64-test\mysql-test\var-rpl-ps_row\4\mysqld.2\data\relay-log.info.0 cannot be accessed (errno 13). Most likely this is a new slave or you are changing the repository type. 110616 7:37:57 [ERROR] G:/pb2/test/sb_1-3486364-1308189142.46/mysql-5.6.3-m5-win-x86_64-test/sql/Debug/mysqld.exe: File 'G:\pb2\test\sb_1-3486364-1308189142.46\mysql-5.6.3-m5-win-x86_64-test\mysql-test\var-rpl-ps_row\4\mysqld.2\data\relay-log.info.0' not found (Errcode: 13) 110616 7:37:57 [ERROR] Failed to create a new info file (file 'G:\pb2\test\sb_1-3486364-1308189142.46\mysql-5.6.3-m5-win-x86_64-test\mysql-test\var-rpl-ps_row\4\mysqld.2\data\relay-log.info.0', errno 13) 110616 7:37:57 [ERROR] Error reading slave worker configuration 110616 7:37:57 [ERROR] Failed during slave worker thread create 110616 7:37:57 [ERROR] Slave SQL: Failed during slave workers initialization, Error_code: 1593 ------------------------------------------------------------ revno: 3303 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-17 18:34:16 +0300 message: wl#5569 MTS fixing tests. @ mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test making aux file names unique to please mtr, pb. @ mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test making aux file names unique to please mtr, pb. @ mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result MTS-suppression is added. @ mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result MTS-suppression is added. @ mysql-test/suite/rpl/r/rpl_parallel_benchmark.result making aux file names unique to please mtr, pb. @ mysql-test/suite/rpl/r/rpl_parallel_innodb.result making aux file names unique to please mtr, pb. @ mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result MTS-suppression is added. @ mysql-test/suite/rpl/r/rpl_typeconv.result MTS-suppression is added. @ mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test MTS-suppression is added. @ mysql-test/suite/rpl/t/rpl_parallel_benchmark-slave.opt cleanup. @ mysql-test/suite/rpl/t/rpl_typeconv.test MTS-suppression is added. @ mysql-test/suite/sys_vars/r/slave_parallel_workers_basic.result results updated. @ sql/sql_class.h Cleanup to remove early debug-related options. @ sql/sys_vars.cc Fixating slave_parallel_workers' max as 1024. Cleanup to remove early debug-related options. ------------------------------------------------------------ revno: 3302 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-17 14:00:41 +0300 message: wl#5569 MTS fixing rpl_row_basic_3innodb similarly to the previous patch. @ mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result a suppression is added. ------------------------------------------------------------ revno: 3301 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-17 13:51:59 +0300 message: wl#5569 MTS fixing few tests. 1. Policy is implemented for reacting with a warning in a case of failing worker leaves the total slave state with gaps thereby inconsistent. 2. Two tests that were used to time out due to reset master/slave was disabled in there. @ mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test a suppression is added. @ mysql-test/extra/rpl_tests/rpl_row_basic.test a suppression is added. @ mysql-test/suite/rpl/r/rpl_known_bugs_detection.result a suppression is added. @ mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result a suppression is added. @ mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result a suppression is added. @ mysql-test/suite/rpl/r/rpl_row_event_max_size.result a suppression is added. @ mysql-test/suite/rpl/r/rpl_row_idempotency.result a suppression is added. @ mysql-test/suite/rpl/t/rpl_known_bugs_detection.test a suppression is added. @ mysql-test/suite/rpl/t/rpl_parallel_benchmark-slave.opt removing unnecessary options causing test to fail. @ mysql-test/suite/rpl/t/rpl_parallel_benchmark.test removing an erronous assignment. The former disabling of reset was intended for benchmarking w/o binlog on the slave to please master-slave.inc. @ mysql-test/suite/rpl/t/rpl_parallel_innodb-slave.opt removing unnecessary options causing test to fail. @ mysql-test/suite/rpl/t/rpl_parallel_innodb.test removing an erronous assignment. The former disabling of reset was intended for benchmarking w/o binlog on the slave to please master-slave.inc. @ mysql-test/suite/rpl/t/rpl_row_event_max_size.test a suppression is added. @ mysql-test/suite/rpl/t/rpl_row_idempotency.test a suppression is added. @ sql/rpl_slave.cc Downgrading error to warning in a case of Coordinator fails due to a Worker error. Improving messages. Merging two if:s to have just one report(). @ sql/share/errmsg-utf8.txt Improved the text of an error; Added a new error code. ------------------------------------------------------------ revno: 3300 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Fri 2011-06-17 02:24:59 +0100 message: Removed unnecessary test cases and augment others in order to test recovery. ------------------------------------------------------------ revno: 3299 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-06-16 19:46:22 +0300 message: wl#5569 MTS fixing slave_parallel_workers_basic and rpl_stop_middle_group which cant run in MTS ------------------------------------------------------------ revno: 3298 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-06-16 11:29:53 +0300 message: wl#5569 MTS adding new tests to sys_vars.\ ------------------------------------------------------------ revno: 3297 committer: Luis Soares <luis.soares@oracle.com> branch nick: mysql-trunk-wl5569 timestamp: Thu 2011-06-16 01:41:32 +0100 message: WL#5569 Adding a global suppression for the warning that may appear when stopping the slave sql thread in the middle of a group. This should affect MTS mode only. ------------------------------------------------------------ revno: 3296 committer: Luis Soares <luis.soares@oracle.com> branch nick: mysql-trunk-wl5569 timestamp: Thu 2011-06-16 01:40:41 +0100 message: WL#5569 Renames worker-info-repository to slave-worker-info-repository in some tests option files. ------------------------------------------------------------ revno: 3295 committer: Luis Soares <luis.soares@oracle.com> branch nick: mysql-trunk-wl5569 timestamp: Thu 2011-06-16 01:32:37 +0100 message: WL#5569 More test fixes. Removing remaining prefixes 'mts' from mts variables, which have been renamed recently. ------------------------------------------------------------ revno: 3294 committer: Luis Soares <luis.soares@oracle.com> branch nick: mysql-trunk-wl5569 timestamp: Thu 2011-06-16 00:27:20 +0100 message: WL#5569 Fixing rpl_parallel result file. ------------------------------------------------------------ revno: 3293 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-15 20:41:33 +0300 message: wl#5569 MTS correcting --slave-parallel-workers in few more files ------------------------------------------------------------ revno: 3292 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-15 20:31:46 +0300 message: wl#5569 MTS correcting --slave-parallel-workers in collections/default.push ------------------------------------------------------------ revno: 3291 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-15 20:12:11 +0300 message: 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_'. ------------------------------------------------------------ revno: 3290 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Wed 2011-06-15 15:59:23 +0100 message: Fixed replication valgring failures caused by the MTS. ------------------------------------------------------------ revno: 3289 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-06-14 21:23:13 +0300 message: wl#5569 MTS wl#5754 Query event parallel execution Fixing failing tests and a failure in gathering accessed databases that was caused by a recent merge from trunk. @ mysql-test/suite/rpl/r/rpl_parallel_multi_db.result results updated. @ mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result results updated. @ mysql-test/suite/rpl/r/rpl_parallel_start_stop.result results updated. @ mysql-test/suite/rpl/t/rpl_parallel_multi_db.test moving mtr.add_supp to eliminate possibility of warning in the slave's error; adding graceful termination lines the test. @ mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test moving mtr.add_supp to eliminate possibility of warning in the slave's error. @ mysql-test/suite/rpl/t/rpl_parallel_start_stop.test Suppression are added for errors that are expected by test logics; adding graceful termination lines the test. @ sql/log_event.cc fixing the last argument to report() which should be c-string; fixing gathering of db:s on the master side. Because of a query can be preceeded in binlog by engineered BEGIN (the current pattern of logging from the trunk) resetting in Query::write() can't be any longer. However another reset point exists at the end of the top-level query and that suffices. @ sql/rpl_rli.h is_mts_in_group() to mimic STS' is_in_group() is added though semantics are different. @ sql/rpl_slave.cc further cleanup in sql_slave_killed() as requested by reviewers. ------------------------------------------------------------ revno: 3288 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-06-14 13:35:20 +0300 message: merge from trunk ------------------------------------------------------------ revno: 3287 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Tue 2011-06-14 12:27:38 +0300 message: wl#5569 MTS Fixing failing tests due to a. a flaw in `isolated parallel' mode implementation. Isolation applies to a group of event rather than to an instance. And event that contains over-max accessed db:s or event from Old master trigger marking the current being scheduled group. Such group will be executed having all prior scheduled done and nomore will be scheduled until the group is done. b. Notification to Coordinator about errored-out Worker is corrected. @ sql/log_event.cc isolation applies to a group of event rather than to an instance. Logics of isolation while the group is still executed by a Worker is refined through use of `bool curr_group_isolated' that lasts the group sceduling time and is set and reset in Log_event::get_slave_worker_id(). Assert is added to monitor tmp tables correct migration. . get_slave_worker() is called with `need_temp_tables' set to TRUE. @ sql/log_event.h Renaming to indicate that isolation applies to a group of event. Adding more candidate event to mts_do_isolate_group() assert. @ sql/rpl_rli.h Isolation mode related declaration. @ sql/rpl_rli_pdb.cc Refining notification logics. Coordinator needs both its THD::KILLED and signalling to slave_worker_hash_cond. @ sql/rpl_slave.cc Isolation mode related init-ion. ------------------------------------------------------------ revno: 3286 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-12 22:33:32 +0300 message: wl#5569 MTS making default.push to run rpl suite with non-default --mts-slave-parallel-workers > 0 in all three format/mode (row,stmt, mixed). The default is run for all suites in mixed mode and rpl suites with row+ps, stmt formats. ------------------------------------------------------------ revno: 3285 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-12 22:05:05 +0300 message: wl#5569 MTS manual merge with few fixes for segfault of the last merge from the trunk etc, compilation issue on embedded. ------------------------------------------------------------ revno: 3284 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-06-09 18:35:59 +0100 message: Post-fixes for merge. Fixed compilation in Windows and removed an used options. ------------------------------------------------------------ revno: 3283 committer: Alfranio Correia <alfranio.correia@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Thu 2011-06-09 16:27:47 +0100 message: merge mysql-trunk --> mysql-next-mr-wl5569 ------------------------------------------------------------ revno: 3282 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-06-06 13:51:19 +0300 message: wl#5569 MTS STOP SLAVE now stops consistently w/o gaps, KILL shall be used for an urgent stop, an error case behaves like the killed. For instance, a Worker errors out, it sends KILL to Coordinator through THD::awake(), and Coordinator kill the rest through setting a special Worker-running status to killed (which breaks the read-exec loop of a Worker). @ sql/log_event.cc Changing style of computing mts-in-group bool arg into mts_async_exec_by_coordinator(). @ sql/rpl_rli.cc Changing style of computing mts-in-group arg of an if in stmt_done(). @ sql/rpl_rli.h Adding more states to Coordinator's MTS-group view. @ sql/rpl_rli_pdb.cc Relocating notification of a Worker's failure by the Worker into the error-branch of a functioning releasing common resources (entries of APH hash). The failed Worker trying awakening possibly waiting for the signal Coordinator. The latter's behaviour in it's turn is refined to not enter the waiting phase when it has been already killed. @ sql/rpl_slave.cc sql_slave_killed() is made of two flavors of the error branches. STOPped MTS coordinator does not give out too early and wait till its MTS-group state allows that. Notification with kill to Coordinator from the errored-out or killed worker is moved into a functioning releasing common resources (entries of APH hash). This case designates a hard stop. In case of the soft (SLAVE-STOPped) MTS, Coordinator is made to wait for Workers' assignements full completion before to mark their running status for stopping. ------------------------------------------------------------ revno: 3281 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Sun 2011-06-05 20:01:51 +0300 message: wl#5569 MTS More cleanup, fixes due to found issues when running tests, some improvements incl in stopping Workers to make routine to distinguish between killed and gracefully stopped cases so in the end STOP SLAVE will guarantee consistent state (some todo remains still). @ mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test decreasing execution time. @ mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test Marking the test as limited to Single-Thread-Slave. @ mysql-test/suite/rpl/t/rpl_deadlock_innodb.test Marking the test as limited to Single-Thread-Slave. @ mysql-test/suite/rpl/t/rpl_slave_skip.test Marking the test as limited to Single-Thread-Slave. @ sql/log_event.cc addressing few reviewing comments; asserting do_update_pos() can't run by Workers; cleaning up and separating Slave_worker *Log_event::get_slave_worker_id() and its caller's interest to rli-> last_assigned_worker; Deploying MTS group status marking in Log_event::apply_event(); Making Worker's exec loop break to obey to a new Worker's running status too; Deploying mts_checkpoint_routine() in Rotate_log_event::do_update_pos() (sim action for FD event's handler); Fixing relay-log update notification in Log_event::get_slave_worker_id(); @ sql/log_event.h renaming and re-typing of func:s as suggested by reviewer; leaving a todo item for the final cleanup; correcting logics of mts_async_exec_by_coordinator(); @ sql/rpl_rli.cc Initialization of a new MTS group status proverty: mts_group_status(MTS_NOT_IN_GROUP); asserting Relay_log_info::stmt_done() can't be run by Workers; deploying mts_checkpoint_routine() alike Rotate_log_event::do_update_pos() this time in Relay_log_info::stmt_done() to cover FD-event case and consulting mts_group_status in order to decide which branch to follow; @ sql/rpl_rli.h Augmenting Relay_log_info with mts_group_status to contain MTS group status; @ sql/rpl_rli_pdb.cc Slave_worker::commit_positions() is fixed to carry update relay-log info further to the following checkpoint routine action; Slave_worker *get_slave_worker() was cleaned, interfaces improved, few asserts corrected; Slave_worker::slave_worker_ends_group() cleaned a bit, and now frees extra memory of CGEP dynarray. wait_for_workers_to_finish() is made to set the Coordinator's state as not in MTS group after synchronization with all workers; @ sql/rpl_rli_pdb.h Slave_jobs_queue is augmented with running_status member. @ sql/rpl_slave.cc apply_event_and_update_pos(): corrects asserts, synch with *all* Workers at the end of dynamically marked as End of group event (mts_is_event_isolated() -> TRUE); exec_relay_log_event(): correts NULL event read out case; slave_stop_workers(): simplifying logics of stopping Workers, to mark them with w->running_status= Slave_worker::KILLED instead of killing workers' thd. . slave_stop_workers() finilizes reset of Coordinator's state with rli->mts_group_status= Relay_log_info::MTS_NOT_IN_GROUP to make sure a next restart will proceed with the reset value. ------------------------------------------------------------ revno: 3280 committer: Andrei Elkin <andrei.elkin@oracle.com> branch nick: mysql-next-mr-wl5569 timestamp: Mon 2011-05-30 13:05:07 +0300 message: WL#5569 MTS WL#5754 Query event parallel applying ----------------------------------------------------------------- Aggregating 7 commits that are not pushed yet to the wl5569 repo. Find comments for each cset below. ------------------------------------------------------------------ The current patch addresses concurrent updating slave_open_temp_tables status counter. The former declaration of the underlying server variable is changed from ulong to int32. While that might affect (shrink) the actual range, there has been no specified range and now after the number of bits is the same on all platforms the range cat be set to be [0, max(int32)] ****** wl#5569 MTS Wl#5754 Query event parallel appying wl#5599 MTS recovery The patch includes some cleanup, including one for temp tables supp…
1 parent b5bd65b commit 328b6c0

File tree

274 files changed

+39744
-1190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+39744
-1190
lines changed

.bzr-mysql/default.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[MYSQL]
22
post_commit_to = "commits@lists.mysql.com"
33
post_push_to = "commits@lists.mysql.com"
4-
tree_name = "mysql-trunk"
4+
tree_name = "mysql-next-mr-wl5569"

client/mysqldump.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,9 @@ static int get_options(int *argc, char ***argv)
918918
my_hash_insert(&ignore_table,
919919
(uchar*) my_strdup("mysql.slave_master_info", MYF(MY_WME))) ||
920920
my_hash_insert(&ignore_table,
921-
(uchar*) my_strdup("mysql.slave_relay_log_info", MYF(MY_WME))))
921+
(uchar*) my_strdup("mysql.slave_relay_log_info", MYF(MY_WME))) ||
922+
my_hash_insert(&ignore_table,
923+
(uchar*) my_strdup("mysql.slave_worker_info", MYF(MY_WME))))
922924
return(EX_EOM);
923925

924926
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))

include/my_pthread.h

+16
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ struct timespec {
128128
((TS1.tv.i64 > TS2.tv.i64) ? 1 : \
129129
((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0))
130130

131+
#define diff_timespec(TS1, TS2) \
132+
((TS1.tv.i64 - TS2.tv.i64) * 100)
131133

132134
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
133135
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
@@ -455,6 +457,20 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
455457
((TS1.tv_sec < TS2.tv_sec || \
456458
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0))
457459
#endif /* !cmp_timespec */
460+
#endif /* HAVE_TIMESPEC_TS_SEC */
461+
462+
#ifdef HAVE_TIMESPEC_TS_SEC
463+
#ifndef diff_timespec
464+
#define diff_timespec(TS1, TS2) \
465+
(((TS1.ts_sec * 1000000000) + TS1.ts_nsec) - \
466+
((TS2.ts_sec * 1000000000) + TS2.ts_nsec))
467+
#endif /* !diff_timespec */
468+
#else
469+
#ifndef diff_timespec
470+
#define diff_timespec(TS1, TS2) \
471+
(((TS1.tv_sec * 1000000000) + TS1.tv_nsec) - \
472+
((TS2.tv_sec * 1000000000) + TS2.tv_nsec))
473+
#endif /* !diff_timespec */
458474
#endif /* HAVE_TIMESPEC_TS_SEC */
459475

460476
/* safe_mutex adds checking to mutex for easier debugging */

mysql-test/collections/default.push

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list --unit-tests
2-
perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_ps_row --vardir=var-main-ps_row --suite=main --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
3-
perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_embedded --vardir=var-main_emebbed --suite=main --embedded --experimental=collections/default.experimental --skip-ndb
1+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --unit-tests
2+
3+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_ps_row --vardir=var-rpl-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --suite=rpl
4+
5+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_stmt --vardir=var-rpl-stmt --mysqld=--binlog-format=statement --experimental=collections/default.experimental --skip-ndb --suite=rpl
6+
7+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_n_mix_MTS --vardir=var-mts-rpl-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --unit-tests --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl
8+
9+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_ps_row_MTS --vardir=var-mts-rpl-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl
10+
11+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_stmt_MTS --vardir=var-mts-rpl-stmt --mysqld=--binlog-format=statement --experimental=collections/default.experimental --skip-ndb --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl
12+
13+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row_MTS --vardir=var-mts-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0

mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ CALL mtr.add_suppression("Multi-statement transaction required more than 'max_bi
389389
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
390390
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
391391
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
392+
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
392393

393394
connection master;
394395
TRUNCATE t1;

mysql-test/extra/rpl_tests/rpl_conflicts.test

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRIC
9898
--eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
9999
--enable_query_log
100100
call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
101+
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
101102

102103
SELECT * FROM t1;
103104

mysql-test/extra/rpl_tests/rpl_crash_safe.inc

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
1212
--sync_slave_with_master
1313
--source include/stop_slave.inc
1414
SHOW CREATE TABLE mysql.slave_relay_log_info;
15+
SHOW CREATE TABLE mysql.slave_worker_info;
1516
ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
17+
ALTER TABLE mysql.slave_worker_info ENGINE= Innodb;
1618
SHOW CREATE TABLE mysql.slave_relay_log_info;
19+
SHOW CREATE TABLE mysql.slave_worker_info;
1720
--source include/start_slave.inc
1821

1922
connection master;
@@ -104,12 +107,13 @@ if (`SELECT HEX(@commands) != HEX('')`)
104107
#
105108
connection master;
106109
sync_slave_with_master;
110+
107111
--let $slave_after= `SELECT master_log_pos FROM mysql.slave_relay_log_info`
108-
connection master;
109-
if ($slave_after != $master_after)
112+
if (`SELECT $slave_after != $master_after`)
110113
{
111114
--echo Slave is out of sync.
112115
--echo MASTER_BEFORE $master_before MASTER_AFTER $master_after SLAVE_BEFORE $slave_before SLAVE_AFTER $slave_after
116+
connection slave;
113117
--source include/show_rpl_debug_info.inc
114118
--die
115119
}

mysql-test/extra/rpl_tests/rpl_crash_safe.test

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
--echo ###################################################################################
8282
connection master;
8383
SET @verbose= 'Y';
84-
let $engine_type=Innodb;
8584
SET @commands= 'configure';
8685
--source extra/rpl_tests/rpl_crash_safe.inc
8786

mysql-test/extra/rpl_tests/rpl_extra_col_master.test

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.*
128128
call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* Error_code: 1054");
129129
call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* Error_code: 1072");
130130
call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677");
131+
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
131132
--enable_query_log
132133

133134
sync_slave_with_master;

mysql-test/extra/rpl_tests/rpl_extra_col_slave.test

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
call mtr.add_suppression("Slave: Unknown table 'test.t6' Error_code: 1051");
1717
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
18+
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
1819

1920
--echo **** Diff Table Def Start ****
2021

mysql-test/extra/rpl_tests/rpl_loaddata.test

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ connection slave;
7171
# 1062 = ER_DUP_ENTRY
7272
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
7373
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
74+
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
7475
--let $slave_sql_errno= 1062
7576
--source include/wait_for_slave_sql_error_and_skip.inc
7677

@@ -157,10 +158,11 @@ if (`SELECT @@global.binlog_format != 'ROW'`)
157158
{
158159
# Query causes error on master but not on slave. This causes the slave to
159160
# stop with error code 0 (which is wrong: see BUG#57287)
160-
--let $slave_sql_errno= 0
161+
--let $slave_sql_errno= 0,1742
161162
--source include/wait_for_slave_sql_error.inc
162163
drop table t1, t2;
163164
}
165+
164166
connection master;
165167
drop table t1, t2;
166168

mysql-test/extra/rpl_tests/rpl_mixing_engines.inc

+23-21
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,15 @@
88
if (`SELECT HEX(@commands) = HEX('configure')`)
99
{
1010
connection master;
11+
12+
--disable_query_log
13+
if ($database_name != 'test')
14+
{
15+
--eval CREATE DATABASE $database_name
16+
}
17+
--eval use $database_name
18+
--enable_query_log
1119

12-
SET SQL_LOG_BIN=0;
13-
eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
14-
eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
15-
eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
16-
eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
17-
eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
18-
eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
19-
eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
20-
eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
21-
eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
22-
eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
23-
eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
24-
eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
25-
eval SET SQL_LOG_BIN=1;
26-
27-
connection slave;
28-
29-
SET SQL_LOG_BIN=0;
3020
eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
3121
eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
3222
eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -39,9 +29,6 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
3929
eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
4030
eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
4131
eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
42-
SET SQL_LOG_BIN=1;
43-
44-
connection master;
4532

4633
INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
4734
INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
@@ -150,6 +137,10 @@ if (`SELECT HEX(@commands) = HEX('clean')`)
150137
{
151138
connection master;
152139

140+
--disable_query_log
141+
--eval use $database_name
142+
--enable_query_log
143+
153144
DROP TABLE tt_1;
154145
DROP TABLE tt_2;
155146
DROP TABLE tt_3;
@@ -169,13 +160,24 @@ if (`SELECT HEX(@commands) = HEX('clean')`)
169160
DROP FUNCTION fc_i_tt_5_suc;
170161
DROP FUNCTION fc_i_nt_5_suc;
171162

163+
--disable_query_log
164+
if ($database_name != 'test')
165+
{
166+
--eval DROP DATABASE $database_name
167+
}
168+
--enable_query_log
169+
172170
sync_slave_with_master;
173171

174172
SET @commands= '';
175173
}
176174

177175
while (`SELECT HEX(@commands) != HEX('')`)
178176
{
177+
--disable_query_log
178+
--eval use $database_name
179+
--enable_query_log
180+
179181
--disable_query_log
180182
SET @command= SUBSTRING_INDEX(@commands, ' ', 1);
181183
let $command= `SELECT @command`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#
2+
# This file relies on the rpl_mixing_engines.inc which provides an engine
3+
# to process commands.
4+
#
5+
6+
#
7+
# Creates tables used throughout the test and changes the type of the
8+
# mysql.slave_relay_log_info to Innodb.
9+
#
10+
if (`SELECT HEX(@commands) = HEX('configure')`)
11+
{
12+
--let $count_database=1
13+
while ($count_database <= $max_workers)
14+
{
15+
--connection master
16+
SET @commands= 'configure';
17+
--let $database_name=test_$count_database
18+
--source extra/rpl_tests/rpl_mixing_engines.inc
19+
inc $count_database;
20+
}
21+
22+
--sync_slave_with_master
23+
--source include/stop_slave.inc
24+
let $saved_workers= `SELECT @@global.slave_parallel_workers`;
25+
let $saved_checkpoint= `SELECT @@global.slave_checkpoint_period`;
26+
27+
SHOW CREATE TABLE mysql.slave_master_info;
28+
SHOW CREATE TABLE mysql.slave_relay_log_info;
29+
SHOW CREATE TABLE mysql.slave_worker_info;
30+
ALTER TABLE mysql.slave_master_info ENGINE= Innodb;
31+
ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
32+
ALTER TABLE mysql.slave_worker_info ENGINE= Innodb;
33+
SHOW CREATE TABLE mysql.slave_master_info;
34+
SHOW CREATE TABLE mysql.slave_relay_log_info;
35+
SHOW CREATE TABLE mysql.slave_worker_info;
36+
}
37+
38+
if (`SELECT HEX(@commands) = HEX('clean')`)
39+
{
40+
--connection slave
41+
--source include/stop_slave.inc
42+
--disable_query_log
43+
eval SET @@global.slave_parallel_workers= $saved_workers;
44+
eval SET @@global.slave_checkpoint_period= $saved_checkpoint;
45+
--enable_query_log
46+
--source include/start_slave.inc
47+
48+
--connection master
49+
--let $count_database=1
50+
while ($count_database <= $max_workers)
51+
{
52+
SET @commands= 'clean';
53+
--let $database_name=test_$count_database
54+
--source extra/rpl_tests/rpl_mixing_engines.inc
55+
inc $count_database;
56+
}
57+
}
58+
59+
if (`SELECT HEX(@commands) = HEX('recovery')`)
60+
{
61+
--connection master
62+
let $m_before_master_file= query_get_value("SHOW MASTER STATUS", "File", 1);
63+
let $m_before_master_pos= query_get_value("SHOW MASTER STATUS", "Position", 1);
64+
65+
#### Guaranteeing that all events in the binary log are transfered to the slave ######
66+
--connection slave
67+
let $saved_current_workers= `SELECT @@global.slave_parallel_workers`;
68+
let $saved_current_checkpoint= `SELECT @@global.slave_checkpoint_period`;
69+
SET GLOBAL debug="d,rotate_slave_debug_group";
70+
--source include/start_slave_io.inc
71+
let $wait_condition=SELECT Master_log_pos = $m_before_master_pos AND Master_log_name = "$m_before_master_file" FROM mysql.slave_master_info;
72+
--source include/wait_condition.inc
73+
74+
#### Crashing server after assigning and processing jobs ######
75+
--connection slave
76+
eval SET @@global.slave_checkpoint_group= $count_debug_groups;
77+
SET GLOBAL debug="d,check_slave_debug_group";
78+
SET GLOBAL debug="+d,mts_distribute_round_robin";
79+
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
80+
--error 0, 2013
81+
START SLAVE SQL_THREAD;
82+
--source include/wait_until_disconnected.inc
83+
--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
84+
--let $rpl_server_number= 2
85+
--source include/rpl_reconnect.inc
86+
87+
#### Checking if the recovery worked and the coordinator has an updated state. ####
88+
--connection slave
89+
--source include/start_slave_io.inc
90+
let $wait_condition=SELECT Master_log_pos = $m_before_master_pos AND Master_log_name = "$m_before_master_file" FROM mysql.slave_master_info;
91+
--source include/wait_condition.inc
92+
93+
--source include/start_slave_sql.inc
94+
let $wait_condition=SELECT Master_log_pos = $m_before_master_pos AND Master_log_name = "$m_before_master_file" FROM mysql.slave_relay_log_info;
95+
--source include/wait_condition.inc
96+
97+
--source include/stop_slave.inc
98+
eval SET @@global.slave_parallel_workers= $saved_current_workers;
99+
eval SET @@global.slave_checkpoint_period= $saved_current_checkpoint;
100+
101+
SET @command= '';
102+
}
103+
104+
if (`SELECT HEX(@commands) != HEX('')`)
105+
{
106+
--connection master
107+
--source extra/rpl_tests/rpl_mixing_engines.inc
108+
}

0 commit comments

Comments
 (0)