summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/include/cache_inline.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/include/cache_inline.h')
-rw-r--r--src/third_party/wiredtiger/src/include/cache_inline.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/include/cache_inline.h b/src/third_party/wiredtiger/src/include/cache_inline.h
index 4061d5b52f6..4015196fd6d 100644
--- a/src/third_party/wiredtiger/src/include/cache_inline.h
+++ b/src/third_party/wiredtiger/src/include/cache_inline.h
@@ -446,6 +446,24 @@ __wt_cache_full(WT_SESSION_IMPL *session)
}
/*
+ * __wt_cache_hs_dirty --
+ * Return if a major portion of the cache is dirty due to history store content.
+ */
+static inline bool
+__wt_cache_hs_dirty(WT_SESSION_IMPL *session)
+{
+ WT_CACHE *cache;
+ WT_CONNECTION_IMPL *conn;
+ uint64_t bytes_max;
+ conn = S2C(session);
+ cache = conn->cache;
+ bytes_max = S2C(session)->cache_size;
+
+ return (__wt_cache_bytes_plus_overhead(cache, cache->bytes_hs_dirty) >=
+ ((uint64_t)(cache->eviction_dirty_trigger * bytes_max) / 100));
+}
+
+/*
* __wt_cache_eviction_check --
* Evict pages if the cache crosses its boundaries.
*/