diff options
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r-- | sql/mdl.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc index 8fd1fa7580a..6cb27efba12 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -2241,8 +2241,8 @@ bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx) /* If the conflicting thread is another parallel replication - thread for the same master and it's not in commit stage, then - the current transaction has started too early and something is + thread for the same master and it's not in commit or post-commit stages, + then the current transaction has started too early and something is seriously wrong. */ if (conflicting_rgi_slave && @@ -2250,7 +2250,9 @@ bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx) 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) + !((conflicting_rgi_slave->did_mark_start_commit || + conflicting_rgi_slave->worker_error) || + conflicting_rgi_slave->finish_event_group_called)) return 1; // Fatal error } } @@ -2325,6 +2327,20 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout) DBUG_RETURN(TRUE); } +#ifdef WITH_WSREP + if (WSREP(get_thd())) + { + THD* requester= get_thd(); + bool requester_toi= wsrep_thd_is_toi(requester) || wsrep_thd_is_applying(requester); + WSREP_DEBUG("::acquire_lock is TOI %d for %s", requester_toi, + wsrep_thd_query(requester)); + if (requester_toi) + THD_STAGE_INFO(requester, stage_waiting_ddl); + else + THD_STAGE_INFO(requester, stage_waiting_isolation); + } +#endif /* WITH_WSREP */ + lock->m_waiting.add_ticket(ticket); /* |