summaryrefslogtreecommitdiff
path: root/src/meta/meta_table.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-04-28 16:12:19 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2015-04-28 16:12:19 +1000
commit4ca25b3678b98822dddde86ffd6b693a78c20dd2 (patch)
tree1822aca281522f235ba2ea0a5ebe00486a97d8f7 /src/meta/meta_table.c
parenta440874554ff21977dcc410b318133e5caa6cd1f (diff)
downloadmongo-4ca25b3678b98822dddde86ffd6b693a78c20dd2.tar.gz
Restructure handle locking so it all happens at the session level, avoid entanglements between handle locks, the schema lock and the handle list lock.
refs WT-1598
Diffstat (limited to 'src/meta/meta_table.c')
-rw-r--r--src/meta/meta_table.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/meta/meta_table.c b/src/meta/meta_table.c
index a2e4a2f8e9f..227d0fa9a6c 100644
--- a/src/meta/meta_table.c
+++ b/src/meta/meta_table.c
@@ -61,6 +61,7 @@ __wt_metadata_cursor(
WT_DECL_RET;
const char *cfg[] =
{ WT_CONFIG_BASE(session, WT_SESSION_open_cursor), config, NULL };
+ int is_dead;
saved_dhandle = session->dhandle;
WT_ERR(__wt_metadata_open(session));
@@ -71,7 +72,11 @@ __wt_metadata_cursor(
* We use the metadata a lot, so we have a handle cached; lock it and
* increment the in-use counter once the cursor is open.
*/
- WT_ERR(__wt_session_lock_dhandle(session, 0, NULL));
+ WT_ERR(__wt_session_lock_dhandle(session, 0, &is_dead));
+
+ /* The metadata should never be closed. */
+ WT_ASSERT(session, !is_dead);
+
WT_ERR(__wt_curfile_create(session, NULL, cfg, 0, 0, cursorp));
__wt_cursor_dhandle_incr_use(session);