diff --git a/src/block_cache/block_io.c b/src/block_cache/block_io.c index 802beaf5c..6d2384c68 100644 --- a/src/block_cache/block_io.c +++ b/src/block_cache/block_io.c @@ -219,6 +219,8 @@ err: if (blkcache_found) (void)__wt_atomic_subv32(&blkcache_item->ref_count, 1); + if (ret == 0) + WT_ASSERT(session, buf->data != NULL); __wt_scr_free(session, &tmp); __wt_scr_free(session, &etmp); return (ret); diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c index 2f6f4e3eb..c3de6eb84 100644 --- a/src/btree/bt_read.c +++ b/src/btree/bt_read.c @@ -93,7 +93,7 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) { WT_ADDR_COPY addr; WT_DECL_RET; - WT_ITEM tmp; + WT_ITEM tmp, tmp_orig; WT_PAGE *notused; WT_PAGE_DELETED *del; uint32_t page_flags; @@ -105,6 +105,7 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) * memory of the appropriate size. */ WT_CLEAR(tmp); + WT_CLEAR(tmp_orig); /* Lock the WT_REF. */ switch (previous_state = ref->state) { @@ -138,6 +139,9 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) /* There's an address, read the backing disk page and build an in-memory version of the page. */ WT_ERR(__wt_blkcache_read(session, &tmp, addr.addr, addr.size)); + tmp_orig = tmp; + __wt_yield(); + WT_ASSERT(session, tmp_orig.data != NULL); /* * Build the in-memory version of the page. Clear our local reference to the allocated copy of @@ -151,6 +155,8 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) page_flags = WT_DATA_IN_ITEM(&tmp) ? WT_PAGE_DISK_ALLOC : WT_PAGE_DISK_MAPPED; if (LF_ISSET(WT_READ_IGNORE_CACHE_SIZE)) FLD_SET(page_flags, WT_PAGE_EVICT_NO_PROGRESS); + __wt_yield(); + WT_ASSERT(session, tmp.data != NULL); WT_ERR(__wt_page_inmem(session, ref, tmp.data, page_flags, ¬used, &prepare)); tmp.mem = NULL; if (prepare)