diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2012-11-30 09:48:21 +1100 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2012-11-30 09:48:21 +1100 |
commit | 909705ed06e54a31288d8cf606f316c00efe3b7f (patch) | |
tree | 2111cd8fd33bb5fe6db45535ef9a1bb631186f16 | |
parent | 9326ad4ee2bda232cc10e5addb098801dd0f4f1f (diff) | |
download | mongo-909705ed06e54a31288d8cf606f316c00efe3b7f.tar.gz |
Update dirty count checking to be a verbose message rather than an
assert.
-rw-r--r-- | src/btree/bt_evict.c | 18 | ||||
-rw-r--r-- | src/btree/bt_walk.c | 3 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/btree/bt_evict.c b/src/btree/bt_evict.c index 2bc37a7bd1f..3416e213a15 100644 --- a/src/btree/bt_evict.c +++ b/src/btree/bt_evict.c @@ -876,7 +876,7 @@ __evict_dirty_validate(WT_CONNECTION_IMPL *conn) WT_DECL_RET; WT_PAGE *page; WT_SESSION_IMPL *session; - uint64_t bytes; + uint64_t bytes, bytes_baseline; cache = conn->cache; session = conn->default_session; @@ -884,6 +884,11 @@ __evict_dirty_validate(WT_CONNECTION_IMPL *conn) btree = NULL; bytes = 0; + if (!WT_VERBOSE_ISSET(session, evictserver)) + return; + + bytes_baseline = cache->bytes_dirty; + TAILQ_FOREACH(btree, &conn->btqh, q) { /* Reference the correct WT_BTREE handle. */ WT_SET_BTREE_IN_SESSION(session, btree); @@ -895,8 +900,15 @@ __evict_dirty_validate(WT_CONNECTION_IMPL *conn) } WT_CLEAR_BTREE_IN_SESSION(session); } - if (ret == 0 || ret == WT_NOTFOUND) - WT_ASSERT(session, bytes == cache->bytes_dirty); + if ((ret == 0 || ret == WT_NOTFOUND) && bytes != 0) { + if (bytes < WT_MIN(bytes_baseline, cache->bytes_dirty) || + bytes > WT_MAX(bytes_baseline, cache->bytes_dirty)) + WT_VERBOSE_VOID(session, evictserver, + "Cache dirty count mismatch. Expected a value " + "between: %" PRIu64 " and %" PRIu64 + " got: %" PRIu64, + bytes_baseline, cache->bytes_dirty, bytes); + } #else WT_UNUSED(conn); #endif diff --git a/src/btree/bt_walk.c b/src/btree/bt_walk.c index 5c0213ed001..d0ffad3f507 100644 --- a/src/btree/bt_walk.c +++ b/src/btree/bt_walk.c @@ -248,7 +248,8 @@ descend: for (;;) { * There is a race here, but worse case is * that the page will be read back in to cache. */ - if (ref->state != WT_REF_MEM) + if (ref->state != WT_REF_MEM && + ref->state != WT_REF_EVICT_WALK) break; /* Grab a hazard reference. */ WT_RET(__wt_page_in(session, page, ref)); |