diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-03-05 10:43:23 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-03-05 10:43:23 -0500 |
commit | 14acc07a4772e0c2833c264c395e1ed25a23dd93 (patch) | |
tree | 42647275df83062bf9df152b49121c01d9dc6dd3 /src/btree/col_srch.c | |
parent | fa5b1558707a0957a4a98936c644323dd4b47ec0 (diff) | |
download | mongo-14acc07a4772e0c2833c264c395e1ed25a23dd93.tar.gz |
Change WT_RESTART into an "expected" failure, similar to WT_NOTFOUND
when walking the cache, requires the caller to release the held page.
Diffstat (limited to 'src/btree/col_srch.c')
-rw-r--r-- | src/btree/col_srch.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/btree/col_srch.c b/src/btree/col_srch.c index c8c842961e9..69850b0edd2 100644 --- a/src/btree/col_srch.c +++ b/src/btree/col_srch.c @@ -92,16 +92,17 @@ descend: WT_ASSERT(session, ref != NULL); * while we're waiting for it, restart the search, otherwise * return on error. */ - if ((ret = - __wt_page_swap(session, page, page, ref, 1, 0)) == 0) { + if ((ret = __wt_page_swap(session, page, page, ref, 0)) == 0) { page = ref->page; continue; } /* - * Restart is returned if we find a page that's been split; - * restart the search from the top of the tree. + * Restart is returned if we find a page that's been split; the + * held page isn't discarded when restart is returned, discard + * it and restart the search from the top of the tree. */ - if (ret == WT_RESTART) + if (ret == WT_RESTART && + (ret = __wt_page_release(session, page)) == 0) goto restart; return (ret); } |