An error occurred fetching the project authors.
- 05 Nov, 2013 1 commit
-
-
unknown authored
MDEV-5217: Last_sql_error lost in parallel replication. For some reason, the query execution code in log_event.cc call rli->clear_error for each event (part of clear_all_errors()). This causes a problem in parallel replication, where the execution in one worker thread could clear the error set by another thread, causing the SQL thread to stop but leaving no error visible in SHOW SLAVE STATUS. There seems to be no reason to clear the global error code in Relay_log_info for each event execution, from code review and from running the test suite. So remove this clearing of the error code to make things work also in the parallel case.
-
- 31 Oct, 2013 1 commit
-
-
unknown authored
In parallel replication, there are two kinds of events which are executed in different ways. Normal events that are part of event groups/transactions are executed asynchroneously by being queued for a worker thread. Other events like format description and rotate and such are executed directly in the driver SQL thread. If the direct execution of the other events were to update the old-style position, then the position gets updated too far ahead, before the normal events that have been queued for a worker thread have been executed. So this patch adds some special cases to prevent such position updates ahead of time, and instead queues dummy events for the worker threads, so that they will at an appropriate time do the position updates instead. (Also fix a race in a test case that happened to trigger while running tests for this patch).
-
- 27 Oct, 2013 1 commit
-
-
Sergei Golubchik authored
-
- 23 Oct, 2013 1 commit
-
-
unknown authored
Fix some more parts of old-style position updates. Now we save in rgi some coordinates for master log and relay log, so that in do_update_pos() we can use the right set of coordinates with the right events. The Rotate_log_event::do_update_pos() is fixed in the parallel case to not directly update relay-log.info (as Rotate event runs directly in the driver SQL thread, ahead of actual event execution). Instead, group_master_log_file is updated as part of do_update_pos() in each event execution. In the parallel case, position updates happen in parallel without any ordering, but taking care that position is not updated backwards. Since position update happens only after event execution this leads to the right result. Also fix an access-after-free introduced in an earlier commit.
-
- 18 Oct, 2013 1 commit
-
-
Sergei Golubchik authored
-
- 17 Oct, 2013 1 commit
-
-
unknown authored
Fix some part of update of old-style coordinates in parallel replication: - Ignore XtraDB request for old-style coordinates, not meaningful for parallel replication (must use GTID to get crash-safe parallel slave). - Only update relay log coordinates forward, not backwards, to ensure that parallel threads do not conflict with each other. - Move future_event_relay_log_pos to rgi.
-
- 14 Oct, 2013 1 commit
-
-
Michael Widenius authored
Moved the remaining variables, that depends on sql execution, from Relay_log_info to rpl_group_info: -row_stmt_start_timestamp -last_event_start_time -long_find_row_note -trans_retries Added slave_executed_entries_lock to protect rli->executed_entries Added primitives for thread safe 64 bit increment Update rli->executed_entries when event has executed, not when event has been sent to sql execution thread sql/log_event.cc: row_stmt_start and long_find_row_note is now in rpl_group_info sql/mysqld.cc: Added slave_executed_entries_lock to protect rli->executed_entries sql/mysqld.h: Added slave_executed_entries_lock to protect rli->executed_entries Added primitives for thread safe 64 bit increment sql/rpl_parallel.cc: Update rli->executed_entries when event has executed, not when event has been sent to sql execution thread sql/rpl_rli.cc: Moved row_stmt_start_timestamp, last_event_start_time and long_find_row_note from Relay_log_info to rpl_group_info sql/rpl_rli.h: Moved trans_retries, row_stmt_start_timestamp, last_event_start_time and long_find_row_note from Relay_log_info to rpl_group_info sql/slave.cc: Use rgi for trans_retries and last_event_start_time Update rli->executed_entries when event has executed, not when event has been sent to sql execution thread Reset trans_retries when object is created
-
- 13 Oct, 2013 1 commit
-
-
Michael Widenius authored
- Made slaves temporary table multi-thread slave safe by adding mutex around save_temporary_table usage. - rli->save_temporary_tables is the active list of all used temporary tables - This is copied to THD->temporary_tables when temporary tables are opened and updated when temporary tables are closed - Added THD->lock_temporary_tables() and THD->unlock_temporary_tables() to simplify this. - Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code. - Added is_part_of_group() to mark functions that are part of the next function. This replaces setting IN_STMT when events are executed. - Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code. - If slave_skip_counter is set run things in single threaded mode. This simplifies code for skipping events. - Updating state of relay log (IN_STMT and IN_TRANSACTION) is moved to one single function: update_state_of_relay_log() We can't use OPTION_BEGIN to check for the state anymore as the sql_driver and sql execution threads may be different. Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts is_in_group() is now independent of state of executed transaction. - Reset thd->transaction.all.modified_non_trans_table() if we did set it for single table row events. This was mainly for keeping the flag as documented. - Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it. - Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock - Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond - Changed some functions to take rpl_group_info instead of Relay_log_info to make them multi-slave safe and to simplify usage - do_shall_skip() - continue_group() - sql_slave_killed() - next_event() - Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure. - set_thd_in_use_temporary_tables() removed as in_use is set on usage - Added information to thd_proc_info() which thread is waiting for slave mutex to exit. - In open_table() reuse code from find_temporary_table() Other things: - More DBUG statements - Fixed the rpl_incident.test can be run with --debug - More comments - Disabled not used function rpl_connect_master() mysql-test/suite/perfschema/r/all_instances.result: Moved sleep_lock and sleep_cond to rpl_group_info mysql-test/suite/rpl/r/rpl_incident.result: Updated result mysql-test/suite/rpl/t/rpl_incident-master.opt: Not needed anymore mysql-test/suite/rpl/t/rpl_incident.test: Fixed that test can be run with --debug sql/handler.cc: More DBUG_PRINT sql/log.cc: More comments sql/log_event.cc: Added DBUG statements do_shall_skip(), continue_group() now takes rpl_group_info param Use is_begin(), is_commit() and is_rollback() functions instead of inspecting query string We don't have set slaves temporary tables 'in_use' as this is now done when tables are opened. Removed IN_STMT flag setting. This is now done in update_state_of_relay_log() Use IN_TRANSACTION flag to test state of relay log. In rows_event_stmt_cleanup() reset thd->transaction.all.modified_non_trans_table if we had set this before. sql/log_event.h: do_shall_skip(), continue_group() now takes rpl_group_info param Added is_part_of_group() to mark events that are part of the next event. This replaces setting IN_STMT when events are executed. Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code. sql/log_event_old.cc: Removed IN_STMT flag setting. This is now done in update_state_of_relay_log() do_shall_skip(), continue_group() now takes rpl_group_info param sql/log_event_old.h: Added is_part_of_group() to mark events that are part of the next event. do_shall_skip(), continue_group() now takes rpl_group_info param sql/mysqld.cc: Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it. Relay_log_info::sleep_lock -> Rpl_group_info::sleep_lock Relay_log_info::sleep_cond -> Rpl_group_info::sleep_cond sql/mysqld.h: Updated types and names sql/rpl_gtid.cc: More DBUG sql/rpl_parallel.cc: Updated TODO section Set thd for event that is execution Use new is_begin(), is_commit() and is_rollback() functions. More comments sql/rpl_rli.cc: sql_thd -> sql_driver_thd Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts. Reset table->in_use for temporary tables as the table may have been used by another THD. Use IN_TRANSACTION instead of OPTION_BEGIN to check state of relay log. Removed IN_STMT flag setting. This is now done in update_state_of_relay_log() sql/rpl_rli.h: Changed relay log state flags to bit masks instead of bit positions (most other code we have uses bit masks) Added IN_TRANSACTION to mark if we are in a BEGIN ... COMMIT section. save_temporary_tables is now thread safe Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code is_in_group() is now independent of state of executed transaction. sql/slave.cc: Simplifed arguments to io_salve_killed(), sql_slave_killed() and check_io_slave_killed(); No reason to supply THD as this is part of the given structure. set_thd_in_use_temporary_tables() removed as in_use is set on usage in sql_base.cc sql_thd -> sql_driver_thd More DBUG Added update_state_of_relay_log() which will calculate the IN_STMT and IN_TRANSACTION state of the relay log after the current element is executed. If slave_skip_counter is set run things in single threaded mode. Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure. Added information to thd_proc_info() which thread is waiting for slave mutex to exit. Disabled not used function rpl_connect_master() Updated argument to next_event() sql/sql_base.cc: Added mutex around usage of slave's temporary tables. The active list is always kept up to date in sql->rgi_slave->save_temporary_tables. Clear thd->temporary_tables after query (safety) More DBUG When using temporary table, set table->in_use to current thd as the THD may be different for slave threads. Some code is ifdef:ed with REMOVE_AFTER_MERGE_WITH_10 as the given code in 10.0 is not yet in this tree. In open_table() reuse code from find_temporary_table() sql/sql_binlog.cc: rli->sql_thd -> rli->sql_driver_thd Remove duplicate setting of rgi->rli sql/sql_class.cc: Added helper functions rgi_lock_temporary_tables() and rgi_unlock_temporary_tables() Would have been nicer to have these inline, but there was no easy way to do that sql/sql_class.h: Added functions to protect slaves temporary tables sql/sql_parse.cc: Added DBUG_PRINT sql/transaction.cc: Added comment
-
- 05 Oct, 2013 1 commit
-
-
Sergey Petrunya authored
- Address review feedback: rename nearly any name used by the new EXPLAIN code.
-
- 16 Sep, 2013 1 commit
-
-
unknown authored
Add a simple test case. Fix bugs found.
-
- 13 Sep, 2013 1 commit
-
-
unknown authored
Some after-review fixes.
-
- 12 Sep, 2013 1 commit
-
-
unknown authored
Currently several places use description_event->common_header_len instead of LOG_EVENT_MINIMAL_HEADER_LEN when parsing events with "frozen" headers (such as Start_event_v3 and its subclasses such as Format_description_log_event, as well as Rotate_event). This causes events with extra headers (which would otherwise be valid and those headers ignored) to be corrupted due to over-reading or skipping into the data portion of the log events. It is rewritten in some details patch of Jeremy Cole (See MDEV): - The virtual function returns length to avoid IFs (and only one call of the virtual function made) - Printing function avoids printing strings
-
- 04 Sep, 2013 1 commit
-
-
unknown authored
Fix various places where code would work incorrectly if the common_header_len of events is different on master and slave Patch developed with the help of Pavel Ivanov. Also fix an uninitialised variable in queue_event().
-
- 27 Aug, 2013 1 commit
-
-
Michael Widenius authored
mysql-test/suite/rpl/r/last_insert_id.result: Test case for last_insert_id mysql-test/suite/rpl/t/last_insert_id.cnf: Test case for last_insert_id mysql-test/suite/rpl/t/last_insert_id.test: Test case for last_insert_id sql/log_event.cc: Added DBUG_PRINT Set thd->first_successful_insert_id_in_prev_stmt_for_binlog when setting thd->first_successful_insert_id_in_prev_stmt. This is required to get last_insert_id() replicated. This is analog to how read_first_successful_insert_id_in_prev_stmt() works. sql/rpl_utility.cc: Added DBUG_PRINT
-
- 23 Aug, 2013 1 commit
-
-
unknown authored
-
- 22 Aug, 2013 1 commit
-
-
unknown authored
The ignored events are not written to the relay log, but instead a fake Rotate event is generated to handle update of position. Extend this for Gtid so we similarly generate a fake Gtid_list event to update the GTID position. Also fix an unrelated test issue that got triggered by the added test cases.
-
- 21 Jul, 2013 1 commit
-
-
Sergei Golubchik authored
-
- 12 Jul, 2013 2 commits
-
-
Sergei Golubchik authored
-
unknown authored
Move the deferred event stuff from Relay_log_info to rpl_group_info to make it thread safe for parallel replication.
-
- 10 Jul, 2013 1 commit
-
-
Alexander Barkov authored
TIME, DATETIME, TIMESTAMP added: mysql-test/r/type_temporal_mysql56.result mysql-test/std_data/mysql56datetime.MYD mysql-test/std_data/mysql56datetime.MYI mysql-test/std_data/mysql56datetime.frm mysql-test/std_data/mysql56time.MYD mysql-test/std_data/mysql56time.MYI mysql-test/std_data/mysql56time.frm mysql-test/std_data/mysql56timestamp.MYD mysql-test/std_data/mysql56timestamp.MYI mysql-test/std_data/mysql56timestamp.frm mysql-test/suite/rpl/r/rpl_temporal_mysql56.result mysql-test/suite/rpl/t/rpl_temporal_mysql56.test mysql-test/t/type_temporal_mysql56.test sql/compat56.cc sql/compat56.h modified: client/mysqlbinlog.cc include/my_time.h include/mysql.h.pp include/mysql_com.h mysql-test/r/statistics.result mysql-test/r/strict.result mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result sql-common/my_time.c sql/CMakeLists.txt sql/field.cc sql/field.h sql/item.cc sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/log_event.cc sql/opt_range.cc sql/opt_table_elimination.cc sql/protocol.cc sql/rpl_utility.cc sql/rpl_utility.h sql/sql_partition.cc sql/sql_prepare.cc sql/sql_select.cc sql/sql_table.cc sql/table.cc storage/perfschema/pfs_engine_table.cc
-
- 08 Jul, 2013 1 commit
-
-
unknown authored
Fix a bunch of issues found with locking, ordering, and non-thread-safe stuff in Relay_log_info. Now able to do a simple benchmark, showing 4.5 times speedup for applying a binlog with 10000 REPLACE statements.
-
- 03 Jul, 2013 1 commit
-
-
unknown authored
Pass down rpl_group_info * to remove one instance of non-threadsafe use of rli->group_info.
-
- 28 Jun, 2013 1 commit
-
-
unknown authored
First step of splitting out part of Relay_log_info, so that different event groups being applied in parallel can each use their own copy.
-
- 27 Jun, 2013 2 commits
-
-
Michael Widenius authored
Fixed OPTIMIZE with innodb include/my_sys.h: Removed ATTRIBUTE_FORMAT() as it gave warnings for %'s sql/log_event.cc: Optimization: use my_b_write() and my_b_write_byte() instead of my_b_printf() use strmake() instead of my_snprintf() sql/sql_admin.cc: Fixed bug in admin_recreate_table() Fixed OPTIMIZE with innodb sql/sql_table.cc: Indentation fixes strings/my_vsnprintf.c: Changed fprintf() to fputs()
-
Sergey Petrunya authored
- Make query plan be re-saved after the first join execution (saving it after JOIN::cleanup is too late because EXPLAIN output is currently produced before that) - Handle QPF allocation/deallocation for edge cases, like unsuccessful BINLOG command. - Work around the problem with UNION's direct subselects not being visible. - Update test results ("Using temporary; Using filesort" are now always printed last in the Extra column) - This cset gets rid of memory leaks/crashes. Some result mismatches still remain.
-
- 24 Jun, 2013 1 commit
-
-
unknown authored
First very rough sketch. We spawn and retire a pool of slave threads. Test main.alias works, most likely not much else does.
-
- 21 Jun, 2013 1 commit
-
-
unknown authored
In record_gtid(), too many rows were deleted from the slave position hash - we need to always keep on to the most recent committed row, so we have a valid slave position at all times.
-
- 17 Jun, 2013 1 commit
-
-
Michael Widenius authored
- temporary tables now works - mysql-system_tables updated to not use temporary tables - PASSWORD() function fixed - Support for STATS_AUTO_RECALC, STATS_PERSISTENT and STATS_SAMPLE_PAGES table options
-
- 16 Jun, 2013 1 commit
-
-
Vladislav Vaintroub authored
See also MySQL Bug #39750 and similar ones. Fix my_delete() on Windows, to safely remvoe files on Windows, including files that are opened by another threads in the same process, antiviruses and backup applications. If file to be deleted is also opened by another thread, the file is renamed to unique name prior to deletion - this makes it possible to create file with the same name right after deletion. With this patch my_delete_allow_opened() becomes obsolete and is replaced with my_delete(). This patch is rework of the patch http://lists.mysql.com/commits/59327 for MySQL bug#39750.
-
- 15 Jun, 2013 1 commit
-
-
Michael Widenius authored
-
- 28 May, 2013 1 commit
-
-
unknown authored
When @@GLOBAL.gtid_strict_mode=1, then certain operations result in error that would otherwise result in out-of-order binlog files between servers. GTID sequence numbers are now allocated independently per domain; this results in less/no holes in GTID sequences, increasing the likelyhood that diverging binlogs will be caught by the slave when GTID strict mode is enabled.
-
- 25 May, 2013 1 commit
-
-
unknown authored
-
- 24 May, 2013 1 commit
-
-
unknown authored
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.
-
- 22 May, 2013 1 commit
-
-
unknown authored
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.
-
- 21 May, 2013 1 commit
-
-
Michael Widenius authored
-
- 15 May, 2013 1 commit
-
-
unknown authored
Implement START SLAVE UNTIL master_gtid_pos = "<GTID position>". Add test cases, including a test showing how to use this to promote a new master among a set of slaves.
-
- 08 May, 2013 1 commit
-
-
Alexander Barkov authored
MDEV-4489 "Replication of big5, cp932, gbk, sjis strings makes wrong values on slave" has been fixed. Problem: String constants of some Asian charsets (big5,cp932,gbk,sjis) can have backslash '\' (0x5C) in the second byte of multi-byte characters. Replicating of such constants using the standard '\'-escaping is dangerous. Therefore, constants of these charsets are replicated using hex notation: INSERT INTO t1 (a) VALUES (0x815C); However, 0xHHHH constants do not work well in some cases, because they can behave as strings and as numbers, depending on context (for example, depending on the data type of the column in an INSERT statement). This SQL script was not replicated correctly with statement-based replication: SET NAMES gbk; PREPARE STMT FROM 'INSERT INTO t1 (a) VALUES (?)'; SET @A = '1'; EXECUTE STMT USING @A; The INSERT statement was replicated as: INSERT INTO t1 (a) VALUES (0x31); '1' was correctly converted to the number 1 on master. But the 0x31 constant was treated as number 49 on slave. Fix: 1. Binary log now uses X'HHHH' instead of 0xHHHH constants. 2. The X'HHHH' constants now work always as strings, in all contexts. This is the SQL standard compliant behaviour. After the fix, the above statement is replicated as: INSERT INTO t1 (a) VALUES (X'31'); X'31' is treated as string '1' on slave, and is correctly converted to 1. modified: @ mysql-test/r/ctype_cp932_binlog_stm.result @ mysql-test/r/select.result @ mysql-test/r/select_jcl6.result @ mysql-test/r/select_pkeycache.result @ mysql-test/r/user_var-binlog.result @ mysql-test/r/varbinary.result @ mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @ mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @ mysql-test/suite/rpl/r/rpl_charset_sjis.result @ mysql-test/suite/rpl/r/rpl_mdev382.result @ mysql-test/suite/rpl/t/rpl_charset_sjis.test @ mysql-test/t/ctype_cp932_binlog_stm.test @ mysql-test/t/select.test @ mysql-test/t/varbinary.test Adding and updating tests @ sql/item.cc @ sql/item.h @ sql/sql_yacc.yy @ sql/sql_lex.cc Splitting the implementations of X'HH' and 0xHH constants into two separate classes. Fixing the parser to distinguish the two syntaxes. @ sql/log_event.cc Using X'HH' instead of 0xHH for binary logging for string constants of the "dangerous" charsets. @ sql/sql_string.h Adding a helped method String::append_hex().
-
- 02 May, 2013 1 commit
-
-
Michael Widenius authored
- 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.
-
- 29 Apr, 2013 1 commit
-
-
unknown authored
When the slave connects, the master skips binlog event groups until it reaches the position requested by the slave. To identify event groups, it needs to detect COMMIT events. But this detection did not correctly handle binlog checksums, so could incorrectly skip extra groups due to not detecting the end of an event group.
-
- 25 Apr, 2013 1 commit
-
-
unknown authored
Server shutdown timeout of 10 seconds in test cases is too little for heavily loaded test servers. Fix innodb_bug12902967 to not fail with wrong error log output if we have warnings about too few AIO handles for InnoDB. Fix typo which could lead to unnecessarily replacing GTID event with dummy event.
-