summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-02-15 16:32:36 +1100
committerLuke Chen <luke.chen@mongodb.com>2019-02-15 16:32:36 +1100
commit78126b28f01414f9606da7845baff5f73be4378d (patch)
tree9ab9a11ff64a0e8cd9d8c4adc14370e44616874a
parentbbb83fa252895f36db69d69f249af2a98ba20890 (diff)
downloadmongo-78126b28f01414f9606da7845baff5f73be4378d.tar.gz
Import wiredtiger: f441a501ba71c5c34ecbfc534e9c476155b151d1 from branch mongodb-3.6
ref: 6d142e23f7..f441a501ba for: 3.6.11 WT-4483 Improve caching of small updates to large values
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_cursor.c7
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_read.c17
3 files changed, 20 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 5462f65ceae..b243bf2de39 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -1,5 +1,5 @@
{
- "commit": "6d142e23f7f8ada7d84487bbcb20bf5f54c737f9",
+ "commit": "f441a501ba71c5c34ecbfc534e9c476155b151d1",
"github": "wiredtiger/wiredtiger.git",
"vendor": "wiredtiger",
"branch": "mongodb-3.6"
diff --git a/src/third_party/wiredtiger/src/btree/bt_cursor.c b/src/third_party/wiredtiger/src/btree/bt_cursor.c
index 886ea0b68f9..199c57972d7 100644
--- a/src/third_party/wiredtiger/src/btree/bt_cursor.c
+++ b/src/third_party/wiredtiger/src/btree/bt_cursor.c
@@ -1395,10 +1395,11 @@ __cursor_chain_exceeded(WT_CURSOR_BTREE *cbt)
upd_size += WT_UPDATE_MEMSIZE(upd);
if (upd_size >= WT_MODIFY_MEM_FACTOR * cursor->value.size)
return (true);
- if (__wt_txn_upd_visible_all(session, upd) &&
- i >= WT_MAX_MODIFY_UPDATE)
- return (true);
}
+ if (upd != NULL && upd->type == WT_UPDATE_STANDARD &&
+ __wt_txn_upd_visible_all(session, upd) &&
+ i >= WT_MAX_MODIFY_UPDATE)
+ return (true);
return (false);
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_read.c b/src/third_party/wiredtiger/src/btree/bt_read.c
index 0d0cf17762c..1254b86c6ea 100644
--- a/src/third_party/wiredtiger/src/btree/bt_read.c
+++ b/src/third_party/wiredtiger/src/btree/bt_read.c
@@ -317,6 +317,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;
@@ -332,8 +333,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);
/*
@@ -346,7 +359,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. */