summaryrefslogtreecommitdiff
path: root/mysql-test/suite/multi_source
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-5804: If same GTID is received on multiple master connections in ↵unknown2014-03-122-17/+204
| | | | | | | | | multi-source replication, the event is double-executed causing corruption or replication failure Some fixes, mainly to make it work in non-parallel replication mode also (--slave-parallel-threads=0). Patch should be fairly complete now.
* MDEV-5804: If same GTID is received on multiple master connections in ↵unknown2014-03-093-0/+420
| | | | | | | | | | | | | | | | | | | | | | | | | multi-source replication, the event is double-executed causing corruption or replication failure Before, the arrival of same GTID twice in multi-source replication would cause double-apply or in gtid strict mode an error. Keep the behaviour, but add an option --gtid-ignore-duplicates which allows to correctly handle duplicates, ignoring all but the first. This relies on the user ensuring correct configuration so that sequence numbers are strictly increasing within each replication domain; then duplicates can be detected simply by comparing the sequence numbers against what is already applied. Only one master connection (but possibly multiple parallel worker threads within that connection) is allowed to apply events within one replication domain at a time; any other connection that receives a GTID in the same domain either discards it (if it is already applied) or waits for the other connection to not have any events to apply. Intermediate patch, as proof-of-concept for testing. The main limitation is that currently it is only implemented for parallel replication, @@slave_parallel_threads > 0.
* Automatic mergeMichael Widenius2014-02-112-11/+21
|\
| * Fixed test case as gtid events are not counted anymoreMichael Widenius2014-02-112-11/+22
| |
| * Fixed wrong result fileMichael Widenius2014-02-111-1/+0
| |
* | 10.0-base mergeSergei Golubchik2013-12-166-35/+37
|\ \ | |/
| * MDEV-4946: IO thread should expose its current GTID positionunknown2013-11-256-35/+37
| | | | | | | | | | Add another column to SHOW SLAVE STATUS, and adjust test suite to cope.
* | MDEV-5277 - Ensure that all MySQL 5.6 options are supported by theSergey Vojtovich2013-11-251-1/+1
| | | | | | | | MariaDB 10.0 server
* | MDEV-4865 Change related to --log option/variable was merged partiallySergei Golubchik2013-08-132-8/+0
| | | | | | | | | | Complete the merge of magne.mahre@oracle.com-20101102115354-vxcaxminmzglzalk (WL#5185 Remove deprecated 5.1 features)
* | Merge 10.0-base -> 10.0unknown2013-05-289-77/+77
|\ \ | |/
| * MDEV-4475: Replication from MariaDB 10.0 to 5.5 does not workunknown2013-05-246-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem was the Gtid_list event which is logged to the binlog in 10.0 and is not understood by the 5.5 server. This event is supposed to be replaced with a dummy event for 5.5 servers. But the very first event logged in the very first binlog has an empty list of GTID, which makes the event too short to be replacable with an empty event. The fix is to pad the empty Gtid_list event to be big enough to be replacable by a dummy event.
| * MDEV-26: Global transaction ID.unknown2013-05-228-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change of user interface to be more logical and more in line with expectations to work similar to old-style replication. User can now explicitly choose in CHANGE MASTER whether binlog position is taken into account (master_gtid_pos=current_pos) or not (master_gtid_pos= slave_pos) when slave connects to master. @@gtid_pos is replaced by three separate variables @@gtid_slave_pos (can be set by user, replicated GTIDs only), @@gtid_binlog_pos (read only), and @@gtid_current_pos (a combination of the two, most recent GTID within each domain). mysql.rpl_slave_state is renamed to mysql.gtid_slave_pos to match. This fixes MDEV-4474.
* | Merge 10.0-base -> 10.0unknown2013-05-032-0/+100
|\ \ | |/
| * Fixed: MDEV-4352; LOAD DATA was not multi-source safeMichael Widenius2013-05-032-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Calls to cleanup_load_tmpdir() could delete temporary files for another master connection - Concurrent LOAD DATA commands from two master connections could use the same file name Other bug fixes: - Enlarge buffer for connection names with 'special characters' one can't store in filenames Optimization: - Don't do 'lower case' of connection names. We can use cmp_connection_name, where we already have the connection name in lower case. mysql-test/suite/multi_source/load_data.result: Test case for MDEV-4352 mysql-test/suite/multi_source/load_data.test: Test case for MDEV-4352 sql/log_event.cc: Fixed: MDEV-4352 - Calls to cleanup_load_tmpdir() could delete temporary files for another master connection - Concurrent LOAD DATA commands from two master connections could use the same file name The fix was to add the connection name (if one exists) to all slave temporary files used by LOAD DATA sql/rpl_mi.cc: Enlarge buffer for connection names with 'special characters' one can't store in filenames Use mi->cmp_connection_name for connection file names. sql/rpl_rli.cc: Use mi->cmp_connection_name for connection file names. sql/slave.cc: Removed not needed empty line sql/sql_const.h: Added MAX_FILENAME_MBWIDTH to be able to calculate buffer length for connection_names stored in file names sql/sql_repl.cc: Use mi->cmp_connection_name for connection file names.
* | 10.0-base mergeSergei Golubchik2013-04-182-2/+8
|\ \ | |/
| * Fix race in test case.unknown2013-04-182-2/+8
| |
| * Fix that multi_source tests did not reset @@global.gtid_pos between tests.unknown2013-04-172-6/+7
| |
* | Merge 10.0-base -> 10.0 (GTID).unknown2013-04-1718-81/+460
|\ \ | |/
| * MDEV-26: Global transaction ID. First alpha release.unknown2013-04-1511-80/+418
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge of 10.0-mdev26 feature tree into 10.0-base. Global transaction ID is prepended to each event group in the binlog. Slave connect can request to start from GTID position instead of specifying file name/offset of master binlog. This facilitates easy switch to a new master. Slave GTID state is stored in a table mysql.rpl_slave_state, which can be InnoDB to get crash-safe slave state. GTID includes a replication domain ID, allowing to keep track of distinct positions for each of multiple masters.
| | * MDEV-26: Global transaction ID.unknown2013-04-052-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace CHANGE MASTER TO ... master_gtid_pos='xxx' with a new system variable @@global.gtid_pos. This is more logical; @@gtid_pos is global, not per-master, and it is not affected by RESET SLAVE. Also rename master_gtid_pos=AUTO to master_use_gtid=1, which again is more logical.
| | * MDEV-26: Global transaction IDunknown2013-04-022-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More fixes for test failures in Buildbot: - Do not run crashing test in Valgrind. - FLUSH TABLES did not work to avoid errors about not closed tables when crashing server. Suppress the messages instead. - Rewrite multi-source test case to only start one pair of slave threads at a time, to work-around the bug MDEV-4352.
| | * MDEV-26: Global transaction IDunknown2013-03-269-80/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust full test suite to work with GTID. Huge patch, mainly due to having to update .result file for all SHOW BINLOG EVENTS and mysqlbinlog outputs, where the new GTID events pop up. Everything was painstakingly checked to be still correct and valid .result file updates.
| | * MDEV-26: Global transaction ID.unknown2013-03-141-7/+7
| | | | | | | | | | | | | | | After-rebase fixes. Rebase was done to be able to build on top of the binlog background thread of MDEV-532.
| | * MDEV-26: Global Transaction ID.unknown2013-02-273-0/+327
| | | | | | | | | | | | | | | | | | | | | | | | Add test case demonstrating multi-source replication with GTID. Test that we can move from being slave of two masters to be a slave deeper down in the hierarchy (of a higher-up multi-source slave), and vice versa.
| * | MDEV-4394 Part IIa (missing wait condition for IO thread status in info_logs)Elena Stepanova2013-04-151-0/+14
| | |
| * | MDEV-4394 Part II (missing wait condition for IO thread status)Elena Stepanova2013-04-151-0/+18
| | |
| * | Fixed MDEV-4394 Sporadic failures in multi_source testsMichael Widenius2013-04-147-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed MDEV-4033 Unable to use slave's temporary directory /tmp - Can't create/write to file '/tmp/SQL_LOAD-' (Errcode: 17 "File exists") - Cache value of check_temp_dir() to avoid race condition - Set $rpl_server_count to avoid error in show_rpl_debug_info.inc mysql-test/suite/multi_source/info_logs.test: Set $rpl_server_count mysql-test/suite/multi_source/multisource.test: Set $rpl_server_count mysql-test/suite/multi_source/relaylog_events.test: Set $rpl_server_count mysql-test/suite/multi_source/reset_slave.test: Set $rpl_server_count mysql-test/suite/multi_source/simple.test: Set $rpl_server_count mysql-test/suite/multi_source/skip_counter.test: Set $rpl_server_count mysql-test/suite/multi_source/status_vars.test: Set $rpl_server_count sql/slave.cc: Cache value of check_temp_dir() to avoid race condition
* | 10.0-base mergeSergei Golubchik2013-01-312-0/+13
|\ \ | |/
| * MDEV-3984: Double free of Master_info * when CHANGE MASTER fails.unknown2013-01-302-0/+13
| | | | | | | | | | | | When CHANGE MASTER fails, it may or may not have already added the Master_info * to the index. Implement logic that properly handles removal and freeing in both cases.
* | Merge MariaDB 10.0-base to MariaDB 10.0unknown2012-12-181-0/+1
|\ \ | |/
| * MDEV-532: Fix some race conditions in test cases.unknown2012-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | With MDEV-532, the binlog_checkpoint event is logged asynchronously from a binlog background thread. This causes some sporadic failures in some test cases whose output depends on order of events in binlog. Fix using an include file that waits until the binlog checkpoint event has been logged before proceeding with the test case.
* | 10.0-base -> 10.0-montySergei Golubchik2012-10-195-35/+37
|/
* Update test results after SHOW EXPLAIN merge-in.Sergey Petrunya2012-10-111-2/+2
|
* Extra check for synchronization in the multi-source replication testElena Stepanova2012-10-052-0/+14
|
* Fix multi-source replication tests for ps-protocol (different xid values), ↵Elena Stepanova2012-10-049-8/+37
| | | | and disable for embedded
* Test fix: Mask server version in relaylog events outputElena Stepanova2012-10-042-3/+5
|
* More tests and test cleanup for MDEV-253 (Multi-source replication)Elena Stepanova2012-10-0415-59/+669
|
* Implementation of Multi-source replication (MDEV:253)Michael Widenius2012-10-043-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux Other things: - Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS - Almost all usage of 'active_mi' is deleted. - Added parameter to reset_logs() so that one can specify if new logs should be created. - Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex - Made max_relay_log_size depending on master connection. - Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings - Added commands to mysqladmin: start-all-slaves & stop-all-slaves - Removed logging of "next log '%s' is currently active | not active" - Fixed bug in my_vsnprintf() when using positional parameters with length - Added fn_ext2(), which returns pointer to last '.' in file name - max_relay_log_size now acts as a normal slave specific variable - Don't store replication position if innobase_overwrite_relay_log_info is not set - max_relay_log_size copies it's values from max_binlog_size at startup BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqladmin.cc: Added commands start-all-slaves & stop-all-slaves client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated signature file include/mysql/plugin_auth.h.pp: Updated signature file include/mysql/plugin_ftparser.h.pp: Updated signature file mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/r/flush.result: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/r/mysqld--help.result: Updated result mysql-test/r/mysqltest.result: Updated result mysql-test/r/parser.result: Updated result mysql-test/r/signal_code.result: Updated result after introducing new commands mysql-test/r/sp-code.result: Updated result after introducing new commands mysql-test/suite/multi_source: Tests for multi-source mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Test of logs mysql-test/suite/multi_source/info_logs.test: Test of logs mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Test relay log handling mysql-test/suite/multi_source/relaylog_events.test: Test relay log handling mysql-test/suite/multi_source/reset_slave.result: Test RESET SLAVE mysql-test/suite/multi_source/reset_slave.test: Test RESET SLAVE mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/skip_counter.result: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/skip_counter.test: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: New warnings mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_flush_logs.result: Update results mysql-test/suite/rpl/r/rpl_heartbeat.result: Warning was removed mysql-test/suite/rpl/r/rpl_heartbeat_basic.result: Warning was removed mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_skip_replication.result: New error message mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/t/rpl_flush_logs.test: Updated tests as relay log files is created a bit differently than before mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/sys_vars/r/default_master_connection_basic.result: New test to test usage of default_master_connection mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Updated usage of sql_slave_skip_counter mysql-test/suite/sys_vars/t/default_master_connection_basic.test: New test to test usage of default_master_connection mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Updated test for multi-source mysql-test/t/flush.test: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name plugin/semisync/semisync_master_plugin.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/lex.h: Added SLAVES keyword sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. Added parameter to reset_logs() so that one can specify if new logs should be created. Removed some wrong casts Changed some constants to defines sql/log.h: Added parameter to reset_logs() Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe max_relay_log_size copies it's values from max_binlog_size at startup SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/mysqld.h: Added mysqld_server_initialized Removed max_relay_log_size sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails Added start|stop all slaves sql/rpl_mi.h: Added connection_name and Master_info_index Updated prototypes sql/rpl_rli.cc: Added connection_name to relay log files. If we do a full reset, don't create any new relay log files. Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong Made executed_entries and max_relay_log_size depending on master connection. sql/set_var.cc: Fixed that one can get variable name also when one uses DEFAULT sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO Improved error message if connection exists sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) Removed logging of "next log '%s' is currently active | not active" Added Slave_received_heartbeats and Slave_heartbeat_period sql/slave.h: Added new defines and prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe. sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_insert.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info()- sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. Fixed issues with FLUSH RELAY LOGS sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index ****** Added multi-source support to show relaylog events ****** check_duplicate_master_info() now generates an error Added parameter to reset_logs() ****** Updated calls to create_signed_file_name() sql/sql_show.cc: Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands Added multi-source support to show relaylog events Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter). Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable storage/example/ha_example.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/sphinx/ha_sphinx.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/xtradb/handler/ha_innodb.cc: Don't store replication position if innobase_overwrite_relay_log_info is not set strings/my_vsnprintf.c: Fixed bug when using positional parameters with length
* Changed SHOW_FUNC variabels that don't return SHOW_ARRAY to SHOW_SIMPLE_FUNC.Michael Widenius2012-10-036-38/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to avoid calculating variables (including those involving mutex) that doesn't match the given wildcard in SHOW STATUS LIKE '...' Removed all references to active_mi that could cause problems for multi-source replication. Added START|STOP ALL SLAVES Added SHOW ALL SLAVES STATUS include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated .pp file include/mysql/plugin_auth.h.pp: Updated .pp file include/mysql/plugin_ftparser.h.pp: Updated .pp file mysql-test/suite/multi_source/info_logs.result: New columns in SHOW ALL SLAVES STATUS mysql-test/suite/multi_source/info_logs.test: Test new syntax mysql-test/suite/multi_source/simple.result: New columns in SHOW ALL SLAVES STATUS mysql-test/suite/multi_source/simple.test: test new syntax mysql-test/suite/multi_source/syntax.result: Updated result mysql-test/suite/multi_source/syntax.test: Test new syntax mysql-test/suite/rpl/r/rpl_skip_replication.result: Updated result plugin/semisync/semisync_master_plugin.cc: SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/item_create.cc: Simplify code sql/lex.h: Added SLAVES keyword sql/log.cc: Constant -> define sql/log_event.cc: Added comment sql/mysqld.cc: SHOW_FUNC -> SHOW_SIMPLE_FUNC Made slave_retried_trans, slave_received_heartbeats and heartbeat_period multi-source safe Clear variable denied_connections and slave_retried_transactions on startup sql/mysqld.h: Added slave_retried_transactions sql/rpl_mi.cc: create_signed_file_name -> create_logfile_name_with_suffix Added start_all_slaves() and stop_all_slaves() sql/rpl_mi.h: Added prototypes sql/rpl_rli.cc: create_signed_file_name -> create_logfile_name_with_suffix added executed_entries sql/rpl_rli.h: Added executed_entries sql/share/errmsg-utf8.txt: More and better error messages sql/slave.cc: Added more fields to SHOW ALL SLAVES STATUS Added slave_retried_transactions Changed constants -> defines sql/sql_class.h: Added comment sql/sql_insert.cc: active_mi.rli -> thd->rli_slave sql/sql_lex.h: Added SQLCOM_SLAVE_ALL_START & SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: active_mi.rli -> thd->rli_slave sql/sql_parse.cc: Added START|STOP ALL SLAVES sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START & SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made REFRESH RELAY LOG multi-source safe sql/sql_repl.cc: create_signed_file_name -> create_logfile_name_with_suffix Don't send my_ok() from start_slave() or stop_slave() so that we can call it for all master connections sql/sql_show.cc: Compare wild cards early for all variables sql/sql_yacc.yy: Added START|STOP ALL SLAVES Added SHOW ALL SLAVES STATUS sql/sys_vars.cc: Made replicate_events_marked_for_skip,slave_net_timeout and rpl_filter multi-source safe. sql/sys_vars.h: Simplify Sys_var_rpl_filter
* Made max_relay_log_size depending on master connection.Michael Widenius2012-10-017-41/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed names of multi-source log files so that original suffixes are kept. include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Updated results mysql-test/suite/multi_source/info_logs.test: Changed to test with complex names to be able to verify the filename generator code mysql-test/suite/multi_source/relaylog_events.result: Updated results mysql-test/suite/multi_source/reset_slave.result: Updated results mysql-test/suite/multi_source/skip_counter.result: Updated results mysql-test/suite/multi_source/skip_counter.test: Added testing of max_relay_log_size mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name sql/log.cc: Removed some wrong casts sql/log.h: Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added that max_relay_log_size copies it's values from max_binlog_size sql/mysqld.h: Removed max_relay_log_size sql/rpl_mi.cc: Changed names of multi-source log files so that original suffixes are kept. sql/rpl_mi.h: Updated prototype sql/rpl_rli.cc: Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Made max_relay_log_size depending on master connection. sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/sql_class.h: Made max_relay_log_size depending on master connection. sql/sql_repl.cc: Updated calls to create_signed_file_name() sql/sys_vars.cc: Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable
* Fixed issues found by QA (Elena)Michael Widenius2012-09-288-6/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added parameter to reset_logs() so that one can specify if new logs should be created. mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/suite/multi_source/info_logs.result: New test mysql-test/suite/multi_source/info_logs.test: New test mysql-test/suite/multi_source/my.cnf: Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Added cleanup mysql-test/suite/multi_source/relaylog_events.test: Added cleanup mysql-test/suite/multi_source/reset_slave.result: Updated results after improved RESET SLAVE mysql-test/suite/multi_source/simple.result: Updated results after improved RESET SLAVE mysql-test/suite/multi_source/simple.test: Syncronize positions before show full slave status mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) sql/log.cc: Added parameter to reset_logs() so that one can specify if new logs should be created. sql/log.h: Added parameter to reset_logs() sql/rpl_mi.cc: Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails sql/rpl_rli.cc: If we do a full reset, don't create any new relay log files. sql/share/errmsg-utf8.txt: Improved error message if connection exists sql/sql_parse.cc: Fixed memory leak sql/sql_repl.cc: check_duplicate_master_info() now generates an error Added parameter to reset_logs()
* Tests for Multi-source replication (MDEV-253)Elena Stepanova2012-09-286-1/+180
|
* Implementation of Multi-source replication (MDEV:253)Michael Widenius2012-09-287-0/+497
Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) mysql-test/r/mysqltest.result: Updated results mysql-test/r/parser.result: Updated results mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe sql/mysqld.h: Added mysqld_server_initialized sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. sql/rpl_mi.h: Added connection_name and Master_info_index sql/rpl_rli.cc: Added connection_name to relay log files. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be uint sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) sql/slave.h: Added new prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Added slave_skip_count to variables to make changing the @@sql_slave_skip_count variable thread safe sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info() sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter).