diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-02-21 12:43:49 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-02-21 12:43:49 -0500 |
commit | d31e3cea6c486f7101895038bebd988c95bf92ed (patch) | |
tree | a84efb34945a98752778808f6f295bb3b84b36e9 | |
parent | ce38bc5b40f1aa3ffc07cdd2cf993e32143135b5 (diff) | |
download | mongo-d31e3cea6c486f7101895038bebd988c95bf92ed.tar.gz |
Two small changes in page-acquisition handling of forced-eviction: only
increment the "page-acquisitions blocked by forcible eviction" statistic
the first attempt we make to evict the page, if we have a successful
page eviction, immediately check the page's new state, don't sleep or
yield.
-rw-r--r-- | src/btree/bt_page.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c index 2f2ce4cf4f7..532d6c38c02 100644 --- a/src/btree/bt_page.c +++ b/src/btree/bt_page.c @@ -127,17 +127,27 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags */ if (force_attempts < 10 && __evict_force_check(session, page, flags)) { - ++force_attempts; + if (force_attempts++ == 0) + WT_STAT_FAST_CONN_INCR(session, + page_forcible_evict_blocked); + ret = __wt_page_release_evict(session, ref); + WT_RET_BUSY_OK(ret); + + /* If forced eviction fails, stall. */ if (ret == EBUSY) { - /* If forced eviction fails, stall. */ - ret = 0; wait_cnt += 1000; - } else - WT_RET(ret); - WT_STAT_FAST_CONN_INCR( - session, page_forcible_evict_blocked); - break; + break; + } + + /* + * The result of a successful forced eviction + * is a page-state transition (potentially to + * an in-memory page we can use, or a restart + * return for our caller), continue the outer + * page-acquisition loop. + */ + continue; } /* Check if we need an autocommit transaction. */ |