summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-08-22 10:16:00 +0300
committerMonty <monty@mariadb.org>2016-08-22 10:16:00 +0300
commitb51109693e6abb0e58256192a648cdd158d47615 (patch)
treebf6e2bb8e171c21f7f78adc056a009c6164e3fe4 /sql/mdl.cc
parent5932fa789043fad1602a5ebb335adf4e7c860cdf (diff)
downloadmariadb-git-b51109693e6abb0e58256192a648cdd158d47615.tar.gz
MDEV-10630 rpl.rpl_mdev6020 fails in buildbot with timeout
The issue was that when running with valgrind the wait for master_pos_Wait() was not long enough. This patch also fixes two other failures that could affect rpl_mdev6020: - check_if_conflicting_replication_locks() didn't properly check domains - 'did_mark_start_commit' was after signals to other threads was sent which could get the variable read too early.
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 37699f1847b..57d5d8e7283 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -443,7 +443,9 @@ public:
virtual void notify_conflicting_locks(MDL_context *ctx) = 0;
virtual bitmap_t hog_lock_types_bitmap() const = 0;
+#ifndef DBUG_OFF
bool check_if_conflicting_replication_locks(MDL_context *ctx);
+#endif
/** List of granted tickets for this lock. */
Ticket_list m_granted;
@@ -2303,16 +2305,23 @@ void MDL_scoped_lock::notify_conflicting_locks(MDL_context *ctx)
and trying to get an exclusive lock for the table.
*/
+#ifndef DBUG_OFF
bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx)
{
Ticket_iterator it(m_granted);
MDL_ticket *conflicting_ticket;
+ rpl_group_info *rgi_slave= ctx->get_thd()->rgi_slave;
+
+ if (!rgi_slave->gtid_sub_id)
+ return 0;
while ((conflicting_ticket= it++))
{
if (conflicting_ticket->get_ctx() != ctx)
{
MDL_context *conflicting_ctx= conflicting_ticket->get_ctx();
+ rpl_group_info *conflicting_rgi_slave;
+ conflicting_rgi_slave= conflicting_ctx->get_thd()->rgi_slave;
/*
If the conflicting thread is another parallel replication
@@ -2320,15 +2329,18 @@ bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx)
the current transaction has started too early and something is
seriously wrong.
*/
- if (conflicting_ctx->get_thd()->rgi_slave &&
- conflicting_ctx->get_thd()->rgi_slave->rli ==
- ctx->get_thd()->rgi_slave->rli &&
- !conflicting_ctx->get_thd()->rgi_slave->did_mark_start_commit)
+ if (conflicting_rgi_slave &&
+ conflicting_rgi_slave->gtid_sub_id &&
+ conflicting_rgi_slave->rli == rgi_slave->rli &&
+ conflicting_rgi_slave->current_gtid.domain_id ==
+ rgi_slave->current_gtid.domain_id &&
+ !conflicting_rgi_slave->did_mark_start_commit)
return 1; // Fatal error
}
}
return 0;
}
+#endif
/**