From 170e9e593df52643653269a61efbdc35076a1190 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Nov 2013 15:22:50 +0100 Subject: MDEV-5306: Missing locking around rpl_global_gtid_binlog_state There were some places where insufficient locking between parallel threads could cause invalid memory accesses and possibly other grief. This patch adds the missing locking, and moves the locking into the struct rpl_binlog_state methods to make it easier to see that proper locking is in place everywhere. --- sql/sql_repl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_repl.cc') diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 546a3dca98c..363b53e05a6 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1575,7 +1575,7 @@ send_event_to_slave(THD *thd, NET *net, String* const packet, ushort flags, DBUG_EXECUTE_IF("gtid_force_reconnect_at_10_1_100", { rpl_gtid *dbug_gtid; - if ((dbug_gtid= until_binlog_state->find(10,1)) && + if ((dbug_gtid= until_binlog_state->find_nolock(10,1)) && dbug_gtid->seq_no == 100) { DBUG_SET("-d,gtid_force_reconnect_at_10_1_100"); @@ -1585,7 +1585,7 @@ send_event_to_slave(THD *thd, NET *net, String* const packet, ushort flags, } }); - if (until_binlog_state->update(&event_gtid, false)) + if (until_binlog_state->update_nolock(&event_gtid, false)) { my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; return "Failed in internal GTID book-keeping: Out of memory"; -- cgit v1.2.1