diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-04-18 15:56:04 +1000 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-04-18 15:56:04 +1000 |
commit | 0ea8ebafc20bb379955b2168b31099aefa220d7b (patch) | |
tree | 45ae9717fd0db22de6ca56240381c8106a633e7d /src/third_party/wiredtiger/src/btree/bt_read.c | |
parent | f1dce2d1934052cbac4032d0c5833d3857a0cfb2 (diff) | |
download | mongo-0ea8ebafc20bb379955b2168b31099aefa220d7b.tar.gz |
Import wiredtiger: ad25980c88b87d45dbcefdb10cdcf696d02a8ac2 from branch mongodb-3.8
ref: 5fc85c47ca..ad25980c88
for: 3.7.6
WT-3998 Fix a bug where stable timestamp was ignored on shutdown
WT-4012 Fix lookaside entry counters
WT-4019 Change test/format to test transaction prepare less often
WT-4027 Yield cursor operations between restarted search/traverse
WT-4031 on-page zero-length row-store values can be discarded from checkpoints
WT-4035 Truncate information discarded while active
WT-4036 Fix Coverity false positive: out-of-bounds access.
WT-4042 Access data handles safely during cursor reopen
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_read.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_read.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_read.c b/src/third_party/wiredtiger/src/btree/bt_read.c index 345556c4c41..b98e994640d 100644 --- a/src/third_party/wiredtiger/src/btree/bt_read.c +++ b/src/third_party/wiredtiger/src/btree/bt_read.c @@ -113,7 +113,7 @@ __las_page_instantiate_verbose(WT_SESSION_IMPL *session, uint64_t las_pageid) * Instantiate lookaside update records in a recently read page. */ static int -__las_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t btree_id) +__las_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref) { WT_CACHE *cache; WT_CURSOR *cursor; @@ -136,11 +136,12 @@ __las_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t btree_id) locked = false; total_incr = 0; current_recno = recno = WT_RECNO_OOB; + las_pageid = ref->page_las->las_pageid; session_flags = 0; /* [-Werror=maybe-uninitialized] */ WT_CLEAR(las_key); cache = S2C(session)->cache; - __las_page_instantiate_verbose(session, ref->page_las->las_pageid); + __las_page_instantiate_verbose(session, las_pageid); WT_STAT_CONN_INCR(session, cache_read_lookaside); WT_STAT_DATA_INCR(session, cache_read_lookaside); @@ -159,11 +160,11 @@ __las_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t btree_id) * for a key and then insert those updates into the page, then all the * updates for the next key, and so on. */ - ret = __wt_las_cursor_position( - cursor, btree_id, ref->page_las->las_pageid); __wt_readlock(session, &cache->las_sweepwalk_lock); locked = true; - for (; ret == 0; ret = cursor->next(cursor)) { + for (ret = __wt_las_cursor_position(cursor, las_pageid); + ret == 0; + ret = cursor->next(cursor)) { WT_ERR(cursor->get_key(cursor, &las_pageid, &las_id, &las_counter, &las_key)); @@ -171,8 +172,7 @@ __las_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t btree_id) * Confirm the search using the unique prefix; if not a match, * we're done searching for records for this page. */ - if (las_id != btree_id || - las_pageid != ref->page_las->las_pageid) + if (las_pageid != ref->page_las->las_pageid) break; /* Allocate the WT_UPDATE structure. */ @@ -367,7 +367,6 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) static int __page_read(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) { - WT_BTREE *btree; WT_DECL_RET; WT_ITEM tmp; WT_PAGE *notused; @@ -377,7 +376,6 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) const uint8_t *addr; bool timer; - btree = S2BT(session); time_start = time_stop = 0; /* @@ -483,7 +481,7 @@ skip_read: * then apply the delete. */ if (ref->page_las != NULL) { - WT_ERR(__las_page_instantiate(session, ref, btree->id)); + WT_ERR(__las_page_instantiate(session, ref)); ref->page_las->eviction_to_lookaside = false; } @@ -504,7 +502,7 @@ skip_read: if (previous_state == WT_REF_LIMBO) WT_STAT_CONN_INCR(session, cache_read_lookaside_delay); - WT_ERR(__las_page_instantiate(session, ref, btree->id)); + WT_ERR(__las_page_instantiate(session, ref)); ref->page_las->eviction_to_lookaside = false; break; } @@ -518,7 +516,7 @@ skip_read: */ if (final_state == WT_REF_MEM && ref->page_las != NULL) WT_IGNORE_RET(__wt_las_remove_block( - session, btree->id, ref->page_las->las_pageid)); + session, ref->page_las->las_pageid, false)); WT_PUBLISH(ref->state, final_state); return (ret); |