3946 Nuno Carvalho 2012-06-04
WL#5223: Binary Log Group Commit
MYSQL_BIN_LOG::flush_and_sync(bool force) was ignoring "force" argument
and always flushing binlog to disk.
Fix flush_and_sync(bool force) implementation by taking "force" into
3945 prabakaran thirumalai 2012-06-04
Bug#11765785 58785: TWO THREADS MAY END UP WITH THE SAME QUERY_ID
Global Query ID (global_query_id ) is not incremented for PING and
statistics command. These two query types are filtered before
incrementing the global query id. This causes race condition and
results in duplicate query id for different queries originating from
sqlparse.cc::dispath_command() is the only place in code which sets
thd->query_ id to global_query_id and then increments it based on the
query type. In all other places it is incremented first and then
assigned to thd->query_id.
This is done such that global_query_id is not incremented for PING
and statistics commands in dispatch_command() function.
As per suggestion from Serg, "There is no reason to skip query_id for
the PING and STATISTICS command.", removing the check which filters
PING and statistics commands.
Instead of using get_query_id() and next_query_id() which can still
cause race condition if context switch happens soon after executing
get_query_id(), changing the code to use next_query_id() instead of
get_query_id() as it is done in other parts of code which deals with
Removed get_query_id() function and forced next_query_id() caller
to use the return value by specifying warn_unused_result attribute.
=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc 2012-05-30 11:38:39 +0000
+++ b/sql/binlog.cc 2012-06-04 11:41:25 +0000
@@ -4467,7 +4467,7 @@ bool MYSQL_BIN_LOG::flush_and_sync(const
- std::pair<bool, bool> result= sync_binlog_file(true);
+ std::pair<bool, bool> result= sync_binlog_file(force);
No bundle (reason: useless for push emails).
|• bzr push into mysql-trunk branch (nuno.carvalho:3945 to 3946) WL#5223||Nuno Carvalho||4 Jun|