diff options
Diffstat (limited to 'src/evict/evict_file.c')
-rw-r--r-- | src/evict/evict_file.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/evict/evict_file.c b/src/evict/evict_file.c index 38cfc07ac5b..66fabe48fb2 100644 --- a/src/evict/evict_file.c +++ b/src/evict/evict_file.c @@ -79,26 +79,19 @@ __wt_evict_file(WT_SESSION_IMPL *session, int syncop) WT_ERR(__wt_evict(session, ref, 1)); break; case WT_SYNC_DISCARD: - WT_ASSERT(session, - __wt_page_can_evict(session, page, 0, NULL)); - __wt_evict_page_clean_update(session, ref, 1); - break; - case WT_SYNC_DISCARD_FORCE: /* - * Forced discard of the page, whether clean or dirty. - * If we see a dirty page in a forced discard, clean - * the page, both to keep statistics correct, and to - * let the page-discard function assert no dirty page - * is ever discarded. + * Dead handles may reference dirty pages; clean the + * page, both to keep statistics correct, and to let + * the page-discard function assert no dirty page is + * ever discarded. */ - if (__wt_page_is_modified(page)) { - page->modify->write_gen = 0; - __wt_cache_dirty_decr(session, page); - } + if (F_ISSET(session->dhandle, WT_DHANDLE_DEAD)) + __wt_page_modify_clear(session, page); - F_SET(session, WT_SESSION_DISCARD_FORCE); + WT_ASSERT(session, + F_ISSET(session->dhandle, WT_DHANDLE_DEAD) || + __wt_page_can_evict(session, page, 0, NULL)); __wt_evict_page_clean_update(session, ref, 1); - F_CLR(session, WT_SESSION_DISCARD_FORCE); break; WT_ILLEGAL_VALUE_ERR(session); } |