summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_read.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_read.c22
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);