diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_read.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_read.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_read.c b/src/third_party/wiredtiger/src/btree/bt_read.c index dd560b39c0b..931919e2320 100644 --- a/src/third_party/wiredtiger/src/btree/bt_read.c +++ b/src/third_party/wiredtiger/src/btree/bt_read.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2018 MongoDB, Inc. + * Copyright (c) 2014-2019 MongoDB, Inc. * Copyright (c) 2008-2014 WiredTiger, Inc. * All rights reserved. * @@ -190,6 +190,13 @@ __las_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref) upd->txnid = las_txnid; upd->timestamp = las_timestamp; upd->prepare_state = prepare_state; + /* + * Use the commit timestamp as the durable timestamp, since + * non durable committed updates don't currently get written to + * lookaside, so the two timestamps should always be identical. + */ + if (prepare_state != WT_PREPARE_INPROGRESS) + upd->durable_timestamp = upd->timestamp; switch (page->type) { case WT_PAGE_COL_FIX: @@ -316,6 +323,7 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) { WT_BTREE *btree; WT_PAGE *page; + size_t footprint; btree = S2BT(session); page = ref->page; @@ -331,8 +339,20 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) if (__wt_page_evict_clean(page)) return (false); + /* + * Exclude the disk image size from the footprint checks. Usually the + * disk image size is small compared with the in-memory limit (e.g. + * 16KB vs 5MB), so this doesn't make a big difference. Where it is + * important is for pages with a small number of large values, where + * the disk image size takes into account large values that have + * already been written and should not trigger forced eviction. + */ + footprint = page->memory_footprint; + if (page->dsk != NULL) + footprint -= page->dsk->mem_size; + /* Pages are usually small enough, check that first. */ - if (page->memory_footprint < btree->splitmempage) + if (footprint < btree->splitmempage) return (false); /* @@ -345,7 +365,7 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) /* If we can do an in-memory split, do it. */ if (__wt_leaf_page_can_split(session, page)) return (true); - if (page->memory_footprint < btree->maxmempage) + if (footprint < btree->maxmempage) return (false); /* Bump the oldest ID, we're about to do some visibility checks. */ |