diff options
author | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-09-30 23:14:31 +0300 |
---|---|---|
committer | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-09-30 23:14:31 +0300 |
commit | 4e00dd68612806e03494921bb573de470fa3e64b (patch) | |
tree | 0bdc646064c25847133ec8f52222538b6bcc47ab | |
parent | 239dcdaa909cba065b9e6c83e59baef25a35eb58 (diff) | |
download | mariadb-git-4e00dd68612806e03494921bb573de470fa3e64b.tar.gz |
References: lp:1233353 - releasing explicit MDL locks for BF aborted transactions
-rw-r--r-- | sql/mdl.cc | 7 | ||||
-rw-r--r-- | sql/mdl.h | 3 | ||||
-rw-r--r-- | sql/sql_base.cc | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 3 |
4 files changed, 16 insertions, 3 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc index 32a4d8cbbf5..fe8efd3e6cd 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -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. diff --git a/sql/mdl.h b/sql/mdl.h index a951ef40d83..50a2c2d815a 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -678,6 +678,9 @@ public: 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; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8d25e100bd1..9fc92f20556 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -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, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 30c496561ac..fdb042f3737 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -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); |