summaryrefslogtreecommitdiff
path: root/src/session/session_dhandle.c
diff options
context:
space:
mode:
authorDon Anderson <dda@ddanderson.com>2015-06-11 09:48:33 -0400
committerDon Anderson <dda@ddanderson.com>2015-06-11 09:48:33 -0400
commit3b61a14eba5733a25a750ffce0066470b813f208 (patch)
tree0ceac3d51f0fe28f7f91dbe31cefc82722363048 /src/session/session_dhandle.c
parent668b82032e04e642e811806b66b2c8a9ee65585f (diff)
downloadmongo-3b61a14eba5733a25a750ffce0066470b813f208.tar.gz
WT-147. An alternate approach to re-locking a btree that is already locked,
using session flags. This does not yet work (fails some tests).
Diffstat (limited to 'src/session/session_dhandle.c')
-rw-r--r--src/session/session_dhandle.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
index 720f40e8d11..7814bffbd9e 100644
--- a/src/session/session_dhandle.c
+++ b/src/session/session_dhandle.c
@@ -8,6 +8,8 @@
#include "wt_internal.h"
+static int __session_dhandle_find(
+ WT_SESSION_IMPL *, const char *, const char *);
static int __session_dhandle_sweep(WT_SESSION_IMPL *);
/*
@@ -195,6 +197,10 @@ __wt_session_release_btree(WT_SESSION_IMPL *session)
ret = __wt_conn_btree_sync_and_close(session, 0, 0);
F_CLR(dhandle, WT_DHANDLE_DISCARD);
}
+ if (F_ISSET(session, WT_SESSION_LOCKED_BTREE)) {
+ session->dhandle = NULL;
+ return (0);
+ }
if (write_locked)
F_CLR(dhandle, WT_DHANDLE_EXCLUSIVE);
@@ -202,7 +208,6 @@ __wt_session_release_btree(WT_SESSION_IMPL *session)
WT_TRET(write_locked ?
__wt_writeunlock(session, dhandle->rwlock):
__wt_readunlock(session, dhandle->rwlock));
-
session->dhandle = NULL;
return (ret);
}
@@ -244,7 +249,11 @@ retry: WT_RET(__wt_meta_checkpoint_last_name(
session, cval.str, cval.len, &checkpoint));
}
- ret = __wt_session_get_btree(session, uri, checkpoint, cfg, flags);
+ if (F_ISSET(session, WT_SESSION_LOCKED_BTREE))
+ ret = __session_dhandle_find(session, uri, checkpoint);
+ else
+ ret = __wt_session_get_btree(session, uri, checkpoint, cfg,
+ flags);
__wt_free(session, checkpoint);
/*