From 0fb9a3a627251bff476f6283e9b2596771427d47 Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Tue, 6 Aug 2019 14:28:44 +1000 Subject: Import wiredtiger: 1a1197ef3c891458cd73290ad9b01c1e969f7e86 from branch mongodb-4.2 ref: 1652e0a804..1a1197ef3c for: 4.2.0-rc6 WT-4957 Revert part of a change about when pages are queued for urgent eviction --- src/third_party/wiredtiger/import.data | 2 +- src/third_party/wiredtiger/src/include/btree.i | 40 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 8ed74f89dd6..b50a7f09165 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -1,5 +1,5 @@ { - "commit": "1652e0a80435b0b7bc876a1e0688e8b00dde38ce", + "commit": "1a1197ef3c891458cd73290ad9b01c1e969f7e86", "github": "wiredtiger/wiredtiger.git", "vendor": "wiredtiger", "branch": "mongodb-4.2" diff --git a/src/third_party/wiredtiger/src/include/btree.i b/src/third_party/wiredtiger/src/include/btree.i index 5cf67d8600f..d0679a9fb38 100644 --- a/src/third_party/wiredtiger/src/include/btree.i +++ b/src/third_party/wiredtiger/src/include/btree.i @@ -1508,30 +1508,30 @@ __wt_page_release(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) * memory_page_max setting, when we see many deleted items, and when we * are attempting to scan without trashing the cache. * - * Fast checks if flag indicates no evict, session can't perform slow - * operation, eviction is disabled for this handle, operation or - * tree, then perform a general check if eviction will be possible. + * Checkpoint should not queue pages for urgent eviction if they require + * dirty eviction: there is a special exemption that allows checkpoint + * to evict dirty pages in a tree that is being checkpointed, and no + * other thread can help with that. Checkpoints don't rely on this code + * for dirty eviction: that is handled explicitly in __wt_sync_file. * - * Checkpoint should not queue pages for urgent eviction if it cannot - * evict them immediately: there is a special exemption that allows - * checkpoint to evict dirty pages in a tree that is being - * checkpointed, and no other thread can help with that. + * If the operation has disabled eviction or splitting, or the session + * is preventing from reconciling, then just queue the page for urgent + * eviction. Otherwise, attempt to release and evict it. */ page = ref->page; - if (!LF_ISSET(WT_READ_NO_EVICT) && - __wt_session_can_wait(session) && - WT_READGEN_EVICT_SOON(page->read_gen) && + if (WT_READGEN_EVICT_SOON(page->read_gen) && btree->evict_disabled == 0 && - __wt_page_can_evict(session, ref, &inmem_split)) { - if (!__wt_page_evict_clean(page) && - (LF_ISSET(WT_READ_NO_SPLIT) || (!inmem_split && - F_ISSET(session, WT_SESSION_NO_RECONCILE)))) { - if (!WT_SESSION_BTREE_SYNC(session)) - WT_IGNORE_RET_BOOL( - __wt_page_evict_urgent(session, ref)); - } else { - WT_RET_BUSY_OK(__wt_page_release_evict(session, ref, - flags)); + __wt_page_can_evict(session, ref, &inmem_split) && + (!WT_SESSION_IS_CHECKPOINT(session) || + __wt_page_evict_clean(page))) { + if (LF_ISSET(WT_READ_NO_EVICT) || + (inmem_split ? LF_ISSET(WT_READ_NO_SPLIT) : + F_ISSET(session, WT_SESSION_NO_RECONCILE))) + WT_IGNORE_RET_BOOL( + __wt_page_evict_urgent(session, ref)); + else { + WT_RET_BUSY_OK( + __wt_page_release_evict(session, ref, flags)); return (0); } } -- cgit v1.2.1