diff options
Diffstat (limited to 'src/evict/evict_file.c')
-rw-r--r-- | src/evict/evict_file.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/evict/evict_file.c b/src/evict/evict_file.c index 9e39fcc7a2c..1030c0aa818 100644 --- a/src/evict/evict_file.c +++ b/src/evict/evict_file.c @@ -72,6 +72,17 @@ __wt_evict_file(WT_SESSION_IMPL *session, int syncop) WT_READ_CACHE | WT_READ_NO_EVICT)); switch (syncop) { + case WT_SYNC_DISCARD: + /* + * Check that the page is clean: if we see a dirty page + * (including a dirty parent page after evicting a + * child), give up. The higher level can try to + * checkpoint, but during discard we aren't set up to + * manage checkpoints. + */ + if (__wt_page_is_modified(page)) + WT_ERR(EBUSY); + /* FALLTHROUGH */ case WT_SYNC_CLOSE: /* * Evict the page. @@ -84,29 +95,6 @@ __wt_evict_file(WT_SESSION_IMPL *session, int syncop) !F_ISSET(page->modify, WT_PM_REC_EMPTY)) WT_ERR(__wt_evict(session, ref, 1)); break; - case WT_SYNC_DISCARD: - /* - * Ordinary discard of the page, whether clean or dirty. - * If we see a dirty page in an ordinary discard (e.g., - * from sweep), give up: an update must have happened - * since the file was selected for sweeping. - */ - if (__wt_page_is_modified(page)) - WT_ERR(EBUSY); - - /* - * If the page contains an update that is too recent to - * evict, stop. This should never happen during - * connection close, but in other paths our caller - * should be prepared to deal with this case. - */ - if (page->modify != NULL && - !__wt_txn_visible_all(session, - page->modify->rec_max_txn)) - WT_ERR(EBUSY); - - __wt_evict_page_clean_update(session, ref); - break; case WT_SYNC_DISCARD_FORCE: /* * Forced discard of the page, whether clean or dirty. |