summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/col_srch.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-11-18 04:05:36 +0000
committerevergreen <evergreen@mongodb.com>2019-11-18 04:05:36 +0000
commit17516da6157b2b3f5c62fdc2b050e4859039f59b (patch)
tree80fd722df1bb9aad709fa95bfa3b6fba17bb3aa3 /src/third_party/wiredtiger/src/btree/col_srch.c
parentf031fff64ea75f70e01cadc973290072605c9f25 (diff)
downloadmongo-17516da6157b2b3f5c62fdc2b050e4859039f59b.tar.gz
Import wiredtiger: aad5d17b00b9921f206b5255a4d79f404db79321 from branch mongodb-4.2
ref: 5afee0fe34..aad5d17b00 for: 4.2.2 WT-4987 Migrate Jenkins “wiredtiger-test-checkpoint” job to Evergreen WT-5030 Migrate Jenkins “wiredtiger-linux-no-ftruncate” job to Evergreen WT-5031 Migrate Jenkins “wiredtiger-nightly-package” job to Evergreen WT-5032 Migrate Jenkins “wiredtiger-syscall-linux” job to Evergreen WT-5106 Remove temporary files in clang-format script WT-5120 Checkpoint hangs when reconciliation doesn't release the eviction generation WT-5189 Python2: handle errors that occur under the concurrent test option (-j) WT-5204 Add diagnostic logging code to the generation drain function WT-5207 Minimize WT-5043 diagnostic tests to exclude time other than eviction itself WT-5218 Improve eviction to differentiate between clean and dirty pages with WT_CACHE_EVICT_NOKEEP readgen
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/col_srch.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/col_srch.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/third_party/wiredtiger/src/btree/col_srch.c b/src/third_party/wiredtiger/src/btree/col_srch.c
index 160f19ffc2a..b7515bf6b42 100644
--- a/src/third_party/wiredtiger/src/btree/col_srch.c
+++ b/src/third_party/wiredtiger/src/btree/col_srch.c
@@ -59,7 +59,7 @@ __check_leaf_key_range(WT_SESSION_IMPL *session, uint64_t recno, WT_REF *leaf, W
*/
int
__wt_col_search(
- WT_SESSION_IMPL *session, uint64_t search_recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt, bool restore)
+ WT_CURSOR_BTREE *cbt, uint64_t search_recno, WT_REF *leaf, bool leaf_safe, bool *leaf_foundp)
{
WT_BTREE *btree;
WT_COL *cip;
@@ -69,10 +69,12 @@ __wt_col_search(
WT_PAGE *page;
WT_PAGE_INDEX *pindex, *parent_pindex;
WT_REF *current, *descent;
+ WT_SESSION_IMPL *session;
uint64_t recno;
uint32_t base, indx, limit, read_flags;
int depth;
+ session = (WT_SESSION_IMPL *)cbt->iface.session;
btree = S2BT(session);
current = NULL;
@@ -88,23 +90,18 @@ __wt_col_search(
/*
* We may be searching only a single leaf page, not the full tree. In the normal case where we
* are searching a tree, check the page's parent keys before doing the full search, it's faster
- * when the cursor is being re-positioned. Skip this if the page is being re-instantiated in
- * memory.
+ * when the cursor is being re-positioned. Skip that check if we know the page is the right one
+ * (for example, when re-instantiating a page in memory, in that case we know the target must be
+ * on the current page).
*/
if (leaf != NULL) {
WT_ASSERT(session, search_recno != WT_RECNO_OOB);
- if (!restore) {
+ if (!leaf_safe) {
WT_RET(__check_leaf_key_range(session, recno, leaf, cbt));
- if (cbt->compare != 0) {
- /*
- * !!!
- * WT_CURSOR.search_near uses the slot value to
- * decide if there was an on-page match.
- */
- cbt->slot = 0;
+ *leaf_foundp = cbt->compare == 0;
+ if (!*leaf_foundp)
return (0);
- }
}
current = leaf;