From 14acc07a4772e0c2833c264c395e1ed25a23dd93 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Wed, 5 Mar 2014 10:43:23 -0500 Subject: Change WT_RESTART into an "expected" failure, similar to WT_NOTFOUND when walking the cache, requires the caller to release the held page. --- src/btree/col_srch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/btree/col_srch.c') 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); } -- cgit v1.2.1