diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-09-11 12:08:12 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-09-28 16:35:18 +1000 |
commit | 8e212cf8907a5d2462dead47aebcce074dd3c066 (patch) | |
tree | f25d5eba63c16a964a73f5e4168d54466f816125 /src/evict/evict_page.c | |
parent | 3489b0bec18adcf574b274dad4b390182deb7c13 (diff) | |
download | mongo-8e212cf8907a5d2462dead47aebcce074dd3c066.tar.gz |
WT-2093 Use the C99 bool type to clarify when functions return true/false
Merge pull request #2178 from wiredtiger/use-bool
(cherry picked from commit d9391c0df4dc38c8ea571bde4808ced194d7cff0)
Diffstat (limited to 'src/evict/evict_page.c')
-rw-r--r-- | src/evict/evict_page.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c index fe08916b24c..9fb6c5e396a 100644 --- a/src/evict/evict_page.c +++ b/src/evict/evict_page.c @@ -314,23 +314,32 @@ __evict_review( } /* Check if the page can be evicted. */ - if (!exclusive && !__wt_page_can_evict(session, page, 0)) - return (EBUSY); - - /* - * Check for an append-only workload needing an in-memory split. - * - * We can't do this earlier because in-memory splits require exclusive - * access, and we can't split if a checkpoint is in progress because - * the checkpoint could be walking the parent page. - * - * If an in-memory split completes, the page stays in memory and the - * tree is left in the desired state: avoid the usual cleanup. - */ if (!exclusive) { - WT_RET(__wt_split_insert(session, ref, inmem_splitp)); + /* + * Update the oldest ID to avoid wasted effort should it have + * fallen behind current. + */ + if (__wt_page_is_modified(page)) + __wt_txn_update_oldest(session, true); + + if (!__wt_page_can_evict(session, page, 0, inmem_splitp)) + return (EBUSY); + + /* + * Check for an append-only workload needing an in-memory + * split. + * + * We can't do this earlier because in-memory splits require + * exclusive access, and we can't split if a checkpoint is in + * progress because the checkpoint could be walking the parent + * page. + * + * If an in-memory split completes, the page stays in memory + * and the tree is left in the desired state: avoid the usual + * cleanup. + */ if (*inmem_splitp) - return (0); + return (__wt_split_insert(session, ref, inmem_splitp)); } /* |