summaryrefslogtreecommitdiff
path: root/sql/mdl.h
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-06-18 20:14:10 +0400
committerKonstantin Osipov <kostja@sun.com>2010-06-18 20:14:10 +0400
commit429454f76ecfbc107fafeb25a33ef4d90f221fc0 (patch)
tree9a1f962e174210ed2a3074e059869d3cc7bd8a6a /sql/mdl.h
parentdc00b5dbb221cbe743169d8a952183e2d36c2cea (diff)
downloadmariadb-git-429454f76ecfbc107fafeb25a33ef4d90f221fc0.tar.gz
A new implementation for the TABLE_SHARE cache in MDL
subsystem. Fix a number of caveates that the previous implementation suffered from, including unprotected access to shared data and lax resource accounting (share->ref_count) that could lead to deadlocks. The new implementation still suffers from a number of potential deadlocks in some edge cases, and this is still not enabled by default. Especially since performance testing has shown that it gives only marginable (not even exceeding measuring accuracy) improvements. @todo: - Remove calls to close_cached_tables() with REFRESH_FAST, and have_lock, because they break the MDL cache. - rework FLUSH TABLES <list> to not use close_cached_tables() - make sure that whenever we set TABLE_SHARE::version to 0 we free MDL cache references to it. sql/mdl.cc: We may cache references to TABLE_SHARE objects in MDL_lock objects for tables. Create a separate MDL_lock class to represent a table. sql/mdl.h: Adjust the MDL caching API to avoid races. sql/sql_base.cc: Move all caching functionality close together. Implement a solution for deadlocks caused by close_cached_tables() when MDL cache is enabled (incomplete). sql/sql_yacc.yy: Adjust FLUSH rule to do the necessary initialization of TABLE_LIST elements used in for FLUSH TABLES <list>, and thus work OK with flush_mdl_cache() function.
Diffstat (limited to 'sql/mdl.h')
-rw-r--r--sql/mdl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/mdl.h b/sql/mdl.h
index 43d88c143c0..ad3945f524c 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -397,8 +397,8 @@ public:
bool has_pending_conflicting_lock() const;
void *get_cached_object();
- void set_cached_object(void *cached_object,
- mdl_cached_object_release_hook release_hook);
+ void set_cached_object(void *cached_object);
+ void clear_cached_object();
MDL_context *get_ctx() const { return m_ctx; }
bool is_upgradable_or_exclusive() const
{
@@ -724,6 +724,7 @@ extern "C" const char *set_thd_proc_info(void *thd_arg, const char *info,
const char *calling_function,
const char *calling_file,
const unsigned int calling_line);
+extern void tdc_release_cached_share(void *ptr);
#ifndef DBUG_OFF
extern mysql_mutex_t LOCK_open;
#endif