diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-12-10 09:47:42 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-12-10 09:47:42 +1100 |
commit | c87ed7ff897ced543b05cad2aaa2761d9541112b (patch) | |
tree | cdbf7f1bdcf36f7add0ca093786716ddebfd0015 /src/lsm | |
parent | cf3f3f6bc743a2dc557b330b993acd8d9d142266 (diff) | |
download | mongo-c87ed7ff897ced543b05cad2aaa2761d9541112b.tar.gz |
Deal with the case where there is no chunk in an LSM tree to flush.
Diffstat (limited to 'src/lsm')
-rw-r--r-- | src/lsm/lsm_work_unit.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c index 66610e1b078..cec39f69a0f 100644 --- a/src/lsm/lsm_work_unit.c +++ b/src/lsm/lsm_work_unit.c @@ -115,10 +115,13 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, } else chunk = (evict_chunk != NULL) ? evict_chunk : flush_chunk; - (void)WT_ATOMIC_ADD4(chunk->refcnt, 1); - 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) { + (void)WT_ATOMIC_ADD4(chunk->refcnt, 1); + 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)); + } err: if (ret != 0 && chunk != NULL) (void)WT_ATOMIC_SUB4(chunk->refcnt, 1); |