summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-05-25 17:31:40 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2015-05-25 17:31:40 +1000
commitec204685d603cc25f52a38f940c968465a1cdcc2 (patch)
tree43aec7565c09fbb6d7acc0b603daaeb66f661200
parent46b8a931f881f26a0505ed4ec0d904684217c944 (diff)
downloadmongo-ec204685d603cc25f52a38f940c968465a1cdcc2.tar.gz
Fix the "is dead" check for handles to not use WT_NOTFOUND: that is a valid return when attempting to open a checkpoint that doesn't exist.
-rw-r--r--src/session/session_dhandle.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
index 57ab7246314..427cff3f351 100644
--- a/src/session/session_dhandle.c
+++ b/src/session/session_dhandle.c
@@ -406,13 +406,14 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
* Recheck whether the handle is dead after grabbing the locks. If so,
* discard the handle and retry.
*/
-retry: WT_WITH_SCHEMA_LOCK(session,
+retry: is_dead = 0;
+ WT_WITH_SCHEMA_LOCK(session,
WT_WITH_DHANDLE_LOCK(session, ret =
- (dhandle != NULL && F_ISSET(dhandle, WT_DHANDLE_DEAD)) ?
- WT_NOTFOUND :
- __wt_conn_btree_get(session, uri, checkpoint, cfg, flags)));
+ (is_dead = (dhandle != NULL &&
+ F_ISSET(dhandle, WT_DHANDLE_DEAD))) ?
+ 0 : __wt_conn_btree_get(session, uri, checkpoint, cfg, flags)));
- if (ret == WT_NOTFOUND) {
+ if (is_dead) {
if (dhandle_cache != NULL)
__session_discard_btree(session, dhandle_cache);
dhandle_cache = NULL;