Commit 4e00dd68 authored by Seppo Jaakola's avatar Seppo Jaakola

References: lp:1233353 - releasing explicit MDL locks for BF aborted transactions

parent 239dcdaa
......@@ -2737,7 +2737,12 @@ void MDL_context::release_locks_stored_before(enum_mdl_duration duration,
DBUG_VOID_RETURN;
}
#ifdef WITH_WSREP
void MDL_context::release_explicit_locks()
{
release_locks_stored_before(MDL_EXPLICIT, NULL);
}
#endif
/**
Release all explicit locks in the context which correspond to the
same name/object as this lock request.
......
......@@ -678,6 +678,9 @@ class MDL_context
void release_statement_locks();
void release_transactional_locks();
#ifdef WITH_WSREP
void release_explicit_locks();
#endif
void rollback_to_savepoint(const MDL_savepoint &mdl_savepoint);
inline THD *get_thd() const { return m_thd; }
......
......@@ -9433,11 +9433,13 @@ void tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
{
mysql_mutex_assert_owner(&LOCK_open);
}
#ifdef WITH_WSREP
/* if thd was BF aborted, exclusive locks were canceled */
#else
DBUG_ASSERT(remove_type == TDC_RT_REMOVE_UNUSED ||
thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name,
MDL_EXCLUSIVE));
#endif /* WITH_WSREP */
key_length= create_table_def_key(key, db, table_name);
if ((share= (TABLE_SHARE*) my_hash_search(&table_def_cache,(uchar*) key,
......
......@@ -8049,6 +8049,9 @@ static void wsrep_client_rollback(THD *thd)
/* Release transactional metadata locks. */
thd->mdl_context.release_transactional_locks();
/* release explicit MDL locks */
thd->mdl_context.release_explicit_locks();
if (thd->get_binlog_table_maps())
{
WSREP_DEBUG("clearing binlog table map for BF abort (%ld)", thd->thread_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment