summaryrefslogtreecommitdiff
path: root/sql/log.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.3' into 10.4Sujatha2020-11-121-1/+1
|\
| * Merge branch '10.2' into 10.3Sujatha2020-11-121-1/+3
| |\
| | * MDEV-4633: multi_source.simple test fails sporadicallySujatha2020-11-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: ======== Writes to 'rli->log_space_total' needs to be synchronized, otherwise both SQL_THREAD and IO_THREAD can try to modify the variable simultaneously resulting in incorrect rli->log_space_total. In the current test scenario SQL_THREAD is trying to decrement 'rli->log_space_total' in 'purge_first_log' and IO_THREAD is trying to increment the 'rli->log_space_total' in 'queue_event' simultaneously. Hence test occasionally fails with result mismatch. Fix: === Convert 'rli->log_space_total' variable to atomic type.
* | | MDEV-21675: Data inconsistency after multirow insert rollback (#1474)Daniele Sciascia2020-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove dead code * MDEV-21675 Data inconsistency after multirow insert rollback This patch fixes data inconsistencies that happen after rollback of multirow inserts, with binlog disabled. For example, statements such as `INSERT INTO t1 VALUES (1,'a'),(1,'b')` that fail with duplicate key error. In such cases the whole statement is rolled back. However, with wsrep_emulate_binlog in effect, the IO_CACHE would not be truncated, and the pending rows events would be replicated to the rest of the cluster. In the above example, it would result in row (1,'a') being replicated, whereas locally the statement is rolled back entirely. Making the cluster inconsistent. The patch changes the code so that prior to statement rollback, pending rows event are removed and the stmt cache reset. That patch also introduces MTR tests that excercise multirow insert statements for regular, and streaming replication.
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-02-111-2/+13
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2020-01-311-2/+13
| |\ \ | | |/
| | * Merge 10.1 into 10.2Marko Mäkelä2020-01-311-2/+13
| | |\
| | | * MDEV-20923:UBSAN: member access within address … which does not point to ↵Sujatha2020-01-291-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an object of type 'xid_count_per_binlog' Problem: ------- Accessing a member within 'xid_count_per_binlog' structure results in following error when 'UBSAN' is enabled. member access within address 0xXXX which does not point to an object of type 'xid_count_per_binlog' Analysis: --------- The problem appears to be that no constructor for 'xid_count_per_binlog' is being called, and thus the vtable will not be initialized. Fix: --- Defined a parameterized constructor for 'xid_count_per_binlog' class.
* | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\ \ | | | |/
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |\
| | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
| * | | | MDEV-17710 "unknown error" with FLUSH LOGS if log directory is not writeableSergei Golubchik2019-05-071-0/+1
| | | | |
* | | | | MDEV-19116 Speed up rotation of binary logsMonty2019-04-011-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed by caching last binary log number used in last_used_log_number Other things: - Moved locking of LOCK_log form new_file_impl() to new_file(). This fixed a bug where LOCK_log could have been unlocked even if 'need_lock' was not set. Removed not anymore used argument need_lock. - Made generate_new_name() virtual to simplify the code between other logs and binary log. Reviewed by Andrei Elkin
* | | | | Simplified THD::current_linfo lockingSergey Vojtovich2019-01-281-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOG_INFO::lock was useless. It could've only protect against concurrent iterators execution, which was already protected by LOCK_thread_count. Use LOCK_thd_data instead of LOCK_thread_count as a protection against THD::current_linfo reset. Aim is to reduce usage of LOCK_thread_count and COND_thread_count. Part of MDEV-15135.
* | | | | Galera4Brave Galera Crew2019-01-231-1/+4
|/ / / /
* | | | Merge 10.2 into 10.3Marko Mäkelä2018-04-231-0/+1
|\ \ \ \ | |/ / /
| * | | MyRocks: MDEV-15911: Reduce debug logging on default levels in error logSergei Petrunia2018-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | MyRocks internally will print non-critical messages to sql_print_verbose_info() which will do what InnoDB does in similar cases: check if (global_system_variables.log_warnings > 2).
| * | | MDEV-11415 Remove excessive undo logging during ALTER TABLE…ALGORITHM=COPYMarko Mäkelä2018-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a crash occurs during ALTER TABLE…ALGORITHM=COPY, InnoDB would spend a lot of time rolling back writes to the intermediate copy of the table. To reduce the amount of busy work done, a work-around was introduced in commit fd069e2bb36a3c1c1f26d65dd298b07e6d83ac8b in MySQL 4.1.8 and 5.0.2, to commit the transaction after every 10,000 inserted rows. A proper fix would have been to disable the undo logging altogether and to simply drop the intermediate copy of the table on subsequent server startup. This is what happens in MariaDB 10.3 with MDEV-14717,MDEV-14585. In MariaDB 10.2, the intermediate copy of the table would be left behind with a name starting with the string #sql. This is a backport of a bug fix from MySQL 8.0.0 to MariaDB, contributed by jixianliang <271365745@qq.com>. Unlike recent MySQL, MariaDB supports ALTER IGNORE. For that operation InnoDB must for now keep the undo logging enabled, so that the latest row can be rolled back in case of an error. In Galera cluster, the LOAD DATA statement will retain the existing behaviour and commit the transaction after every 10,000 rows if the parameter wsrep_load_data_splitting=ON is set. The logic to do so (the wsrep_load_data_split() function and the call handler::extra(HA_EXTRA_FAKE_START_STMT)) are joint work by Ji Xianliang and Marko Mäkelä. The original fix: Author: Thirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com> Date: Wed Dec 2 16:09:15 2015 +0530 Bug#17479594 AVOID INTERMEDIATE COMMIT WHILE DOING ALTER TABLE ALGORITHM=COPY Problem: During ALTER TABLE, we commit and restart the transaction for every 10,000 rows, so that the rollback after recovery would not take so long. Fix: Suppress the undo logging during copy alter operation. If fts_index is present then insert directly into fts auxiliary table rather than doing at commit time. ha_innobase::num_write_row: Remove the variable. ha_innobase::write_row(): Remove the hack for committing every 10000 rows. row_lock_table_for_mysql(): Remove the extra 2 parameters. lock_get_src_table(), lock_is_table_exclusive(): Remove. Reviewed-by: Marko Mäkelä <marko.makela@oracle.com> Reviewed-by: Shaohua Wang <shaohua.wang@oracle.com> Reviewed-by: Jon Olav Hauglid <jon.hauglid@oracle.com>
* | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-30/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-041-1/+8
|\ \ \ \
| * \ \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-1/+8
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/make_dist.cmake.in mysql-test/r/func_json.result mysql-test/r/ps.result mysql-test/t/func_json.test mysql-test/t/ps.test sql/item_cmpfunc.h
| | * | | Merge remote-tracking branch 'origin/10.1' into bb-10.2-vicentiuVicențiu Ciorbaru2017-12-281-1/+7
| | |\ \ \ | | | |/ /
| | | * | MDEV-10715 Galera: Replicate MariaDB GTID to other nodes in the clusterSachin Setiya2017-12-251-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:- Gtid are not transferred in Galera Cluster. Solution:- We need to transfer gtid in the case on either when cluster is slave/master in async replication. In normal Gtid replication gtid are generated on recieving node itself and it is always on sync with other nodes. Because galera keeps node in sync , So all nodes get same no of event groups. So the issue arises when say galera is slave in async replication. A | (Async replication) D <-> E <-> F {Galera replication} So what should happen is that all node should apply the master gtid but this does node happen, becuase node E, F does not recieve gtid from D in write set , So what E(or F) does is that it applies wsrep_gtid_domain_id, D server-id , E gtid next seq no. This generated gtid does not always work when say A has different domain id. So In this commit, on galera node when we see that this event is recieved from master we simply write Gtid_Log_Event in write_set and send it to other nodes.
| | * | | MDEV-14290 Binlog rotate crashes when two commit_checkpoint_notify capable ↵Andrei Elkin2017-12-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | engines. The crash (sometimes assert) in MYSQL_BIN_LOG::mark_xid_done was caused by a fact that log.cc:binlog_background_thread_queue could become a cyclic list. This possibility becomes real with two checkpoint capable engines that may execute TC_LOG_BINLOG::commit_checkpoint_notify() in succession before binlog_background thread gets control and eventually finds a freed memory while otherwise endlessly looping in while(queue). It is fixed with counting the notificaion kind instead of en-listing the same notificaion kind in commit_checkpoint_notify as formerly. The while(queue) of binlog background thread is refined to pay attention to the new counter. In effectno more access to free memory is possible.
* | | | | MDEV-13073 This part merges the Ali semisync related changesAndrei Elkin2017-12-181-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and specifically the ack receiving functionality. Semisync is turned to be static instead of plugin so its functions are invoked at the same points as RUN_HOOKS. The RUN_HOOKS and the observer interface remain to be removed by later patch. Todo: React on killed status by repl_semisync_master.wait_after_sync(). Currently Repl_semi_sync_master::commit_trx does not check the killed status. There were few bugfixes found that are present in mysql and its unclear whether/how they are covered. Those include: Bug#15985893: GTID SKIPPED EVENTS ON MASTER CAUSE SEMI SYNC TIME-OUTS Bug#17932935 CALLING IS_SEMI_SYNC_SLAVE() IN EACH FUNCTION CALL HAS BAD PERFORMANCE Bug#20574628: SEMI-SYNC REPLICATION PERFORMANCE DEGRADES WITH A HIGH NUMBER OF THREADS
* | | | | Changed from using LOCK_log to LOCK_binlog_end_pos for binary logMonty2017-12-181-26/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-13073 AliSQL Optimize performance of semisync The idea it to use a dedicated lock detecting if there is new data in the master's binary log instead of the overused LOCK_log. Changes: - Use dedicated COND variables for the relay and binary log signaling. This was needed as we where the old 'update_cond' variable was used with different mutex's, which could cause deadlocks. - Relay log uses now COND_relay_log_updated and LOCK_log - Binary log uses now COND_bin_log_updated and LOCK_binlog_end_pos - Renamed signal_cnt to relay_signal_cnt (as we now have two signals) - Added some missing error handling in MYSQL_BIN_LOG::new_file_impl() - Reformatted some comments with old style - Renamed m_key_LOCK_binlog_end_pos to key_LOCK_binlog_end_pos - Changed 'signal_update()' to update_binlog_end_pos() which works for both relay and binary log
* | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-1/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-11-291-1/+6
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-11-211-1/+6
| | |\ \ \ | | | |/ /
| | | * | MDEV-12012/MDEV-11969 Can't remove GTIDs for a stale GTID Domain IDAndrei Elkin2017-11-151-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in MDEV-11969 "there's no way to ditch knowledge" about some domain that is no longer updated on a server. Besides being of annoyance to clutter output in DBA console stale domains can prevent the slave to connect the master as MDEV-12012 witnesses. What domain is obsolete must be evaluated by the user (DBA) according to whether the domain info is still relevant and will the domain ever receive any update. This patch introduces a method to discard obsolete gtid domains from the server binlog state. The removal requires no event group from such domain present in existing binlog files though. If there are any the containing logs must be first PURGEd in order for FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains) succeed. Otherwise the command returns an error. The list of obsolete domains can be computed through intersecting two sets - the earliest (first) binlog's Gtid_list and the current value of @@global.gtid_binlog_state - and extracting the domain id components from the intersection list items. The new DELETE_DOMAIN_ID featured FLUSH continues to rotate binlog omitting the deleted domains from the active binlog file's Gtid_list. Notice though when the command is ineffective - that none of requested to delete domain exists in the binlog state - rotation does not occur. Obsolete domain deletion is not harmful for connected slaves as long as master side binlog files *purge* is synchronized with FLUSH-DELETE_DOMAIN_ID. The slaves must have the last event from purged files processed as usual, in order not to bump later into requesting a gtid from a file which was already gone. While the command is not replicated (as ordinary FLUSH BINLOG LOGS is) slaves, even though having extra domains, won't suffer from reconnection errors thanks to master-slave gtid connection protocol allowing the master to be ignorant about a gtid domain. Should at failover such slave to be promoted into master role it may run the ex-master's FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains) to clean its own binlog state. NOTES. suite/perfschema/r/start_server_low_digest.result is re-recorded as consequence of internal parser codes changes.
* | | | | Lots of small cleanupsMichael Widenius2017-08-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Simplified use_trans_cache() to return at once if is_transactional is set - Indentation and spelling errors fixed - Don't call signal_update() if update_binlog_end_pos() is called as the function already calls signal_update() - Removed not used function wait_for_update_bin_log(), which would cause errors if ever used. - Simplified handler::clone() by always allocating 'ref' in ha_open(). To do this I added an optional MEM_ROOT argument to ha_open() to be used when allocating 'ref' - Changed arguments to get_system_var() from LEX_CSTRING to LEX_CSTRING* - Added THD as argument to create_select_for_variable(). Changed also char* argument to LEX_CSTRING to avoid strlen() call. - Change calls to append() to use LEX_CSTRING
* | | | | MDEV-12179: Per-engine mysql.gtid_slave_pos tableKristian Nielsen2017-07-031-0/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | Merge into MariaDB 10.3.
| * | | | MDEV-12179: Per-engine mysql.gtid_slave_pos tableKristian Nielsen2017-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intermediate commit. Implement status variables to aid the DBA in determining the need and/or effectiveness of the per-engine mylsq.gtid_slave_pos feature: transactions_multi_engine Number of transactions that changed data in multiple (transactional) storage engines. rpl_transactions_multi_engine Number of replicated transactions that involved changes in multiple (transactional) storage engines, before considering the update of the mysql.gtid_slave_posXXX table. transactions_gtid_foreign_engine Number of replicated transactions where the update of the mysql.gtid_slave_posXXX table had to choose a storage engine that did not otherwise participate in the transaction.
* | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-04-131-1/+0
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | cleanup: unused method LOGGER::flush_logsSergei Golubchik2017-04-071-1/+0
| |/ / /
* | | | MDEV-8203 Assert in Query_log_event::do_apply_event()Monty2017-04-071-2/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This happens because the master writes a table_map event to the binary log, but no row event. The slave has a check that there should always be a row event if there was a table_map event, which causes a crash. Fixed by remembering in the cache what kind of events are logged and ignore cached statements which is just a table map event.
* | | Fix many -Wconversion warnings.Marko Mäkelä2017-03-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
* | | Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-0/+1
|\ \ \ | |/ /
| * | MDEV-9423: cannot add new node to the cluser: Binlog..mariadb-10.1.15Nirbhay Choubey2016-06-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .. file '/var/log/mysql/mariadb-bin.000001' not found in binlog index, needed for recovery. Aborting. In Galera cluster, while preparing for rsync/xtrabackup based SST, the donor node takes an FTWRL followed by (REFRESH_ENGINE_LOG in rsync based state transfer and) REFRESH_BINARY_LOG. The latter rotates the binary log and logs Binlog_checkpoint_log_event corresponding to the penultimate binary log file into the new file. The checkpoint event for the current file is later logged synchronously by binlog_background_thread. Now, since in rsync/xtrabackup based snapshot state transfer methods, only the last binary log file is transferred to the joiner node; the file could get transferred even before the checkpoint event for the same file gets written to it. As a result, the joiner node would fail to start complaining about the missing binlog file needed for recovery. In order to fix this, a mechanism has been put in place to make REFRESH_BINARY_LOG operation wait for Binlog_checkpoint_log_event to be logged for the current binary log file if the node is part of a Galera cluster. As further safety, during rsync based state transfer the donor node now acquires and owns LOCK_log for the duration of file transfer during SST.
* | | Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-2/+2
|\ \ \ | |/ /
| * | Merge branch '10.0' into 10.1Sergei Golubchik2016-06-281-2/+2
| |\ \
| | * \ Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-211-2/+2
| | |\ \ | | | |/
| | | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-06-141-2/+2
| | | |\
| | | | * Bug#23251517: SEMISYNC REPLICATION HANGINGmysql-5.5.50Sujatha Sivakumar2016-05-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert following bug fix: Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE This fix results in a deadlock between slave IO thread and SQL thread. (cherry picked from commit e3fea6c6dbb36c6ab21c4ab777224560e9608b53)
| | | | * Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK ISSujatha Sivakumar2016-03-011-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE Problem: ======== Currently SHOW SLAVE STATUS blocks if IO thread waits for disk space. This makes automation tools verifying server health block on taking relevant action. Finally this will create SHOW SLAVE STATUS piles. Analysis: ========= SHOW SLAVE STATUS hangs on mi->data_lock if relay log write is waiting for free disk space while holding mi->data_lock. mi->data_lock is needed to protect the format description event (mi->format_description_event) which is accessed by the clients running FLUSH LOGS and slave IO thread. Note relay log writes don't need to be protected by mi->data_lock, LOCK_log is used to protect relay log between IO and SQL thread (see MYSQL_BIN_LOG::append_event). The code takes mi->data_lock to protect mi->format_description_event during relay log rotate which might get triggered right after relay log write. Fix: ==== Release the data_lock just for the duration of writing into relay log. Made change to ensure the following lock order is maintained to avoid deadlocks. data_lock, LOCK_log data_lock is held during relay log rotations to protect the description event.
| | | | * Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)Jon Olav Hauglid2012-06-291-3/+3
| | | | |\ | | | | | | | | | | | | Manual merge from mysql-5.1 to mysql-5.5
| | | | | * Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)Jon Olav Hauglid2012-06-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes various compilation warnings of the type "error: narrowing conversion of 'x' from 'datatype1' to 'datatype2'
| | | | * | BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVERNuno Carvalho2012-04-201-0/+5
| | | | |\ \ | | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge from 5.1 into 5.5. Conflicts: * sql/log.h * sql/sql_repl.cc