diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-02-11 17:30:20 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-02-11 17:30:20 -0500 |
commit | 249f1828923415659f0790022995249fab5270fa (patch) | |
tree | b9120f8aaecf572cd704549bd71fbd35e71f9db1 /src/lsm | |
parent | c2dc59472c63011b9ac4bf402ad16581a748c370 (diff) | |
download | mongo-249f1828923415659f0790022995249fab5270fa.tar.gz |
Revert half of 108c7e5, leave the simplification where we don't have to
fix refcnt on error.
Diffstat (limited to 'src/lsm')
-rw-r--r-- | src/lsm/lsm_work_unit.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c index 5b1e0ced69c..f4ddd4f7e2f 100644 --- a/src/lsm/lsm_work_unit.c +++ b/src/lsm/lsm_work_unit.c @@ -75,12 +75,11 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, u_int i; *chunkp = NULL; - evict_chunk = flush_chunk = NULL; + chunk = evict_chunk = flush_chunk = NULL; WT_ASSERT(session, lsm_tree->queue_ref > 0); WT_RET(__wt_lsm_tree_readlock(session, lsm_tree)); - if (!F_ISSET(lsm_tree, WT_LSM_TREE_ACTIVE) || - lsm_tree->nchunks == 0) + if (!F_ISSET(lsm_tree, WT_LSM_TREE_ACTIVE) || lsm_tree->nchunks == 0) return (__wt_lsm_tree_readunlock(session, lsm_tree)); /* Search for a chunk to evict and/or a chunk to flush. */ @@ -117,11 +116,14 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, } else chunk = (evict_chunk != NULL) ? evict_chunk : flush_chunk; - WT_ERR(__wt_verbose(session, WT_VERB_LSM, - "Flush%s: return chunk %u of %u: %s", - force ? " w/ force" : "", i, lsm_tree->nchunks, chunk->uri)); + if (chunk != NULL) { + WT_ERR(__wt_verbose(session, WT_VERB_LSM, + "Flush%s: return chunk %u of %u: %s", + force ? " w/ force" : "", + i, lsm_tree->nchunks, chunk->uri)); - (void)WT_ATOMIC_ADD4(chunk->refcnt, 1); + (void)WT_ATOMIC_ADD4(chunk->refcnt, 1); + } err: WT_RET(__wt_lsm_tree_readunlock(session, lsm_tree)); |