summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2015-05-14 11:04:01 -0400
committersueloverso <sue@mongodb.com>2015-05-14 11:04:01 -0400
commit0a8e9ab5df4e3c483f79f8bec65dc680425caad4 (patch)
treef8e2e14ee5daac63e275eec7e03a8cdd4a84de13
parent77163ad484394a444ebe7642e72f15bc9c78fbec (diff)
parentcb15de9122e0ea7baa0d2c302688a889e3d3f27f (diff)
downloadmongo-0a8e9ab5df4e3c483f79f8bec65dc680425caad4.tar.gz
Merge pull request #1971 from wiredtiger/lsm-no-bloom-oldest
Don't create bloom filters on the oldest chunk unless configured.
-rw-r--r--src/lsm/lsm_tree.c12
-rw-r--r--src/lsm/lsm_work_unit.c4
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index 97360089d48..b8aecfc89b6 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -1222,6 +1222,18 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, int *skip)
WT_ERR_MSG(session, EINVAL,
"LSM compaction requires active merge threads");
+ /*
+ * We are done if there is a single chunk in the tree and we have
+ * already created a bloom filter for it or we are configured not to.
+ */
+ if (lsm_tree->nchunks == 1 &&
+ ((FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OLDEST) &&
+ F_ISSET(lsm_tree->chunk[0], WT_LSM_CHUNK_BLOOM)) ||
+ !FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OLDEST))) {
+ __wt_lsm_tree_release(session, lsm_tree);
+ return (0);
+ }
+
WT_ERR(__wt_seconds(session, &begin));
/*
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c
index 33174c2d40d..7a2c0ebb190 100644
--- a/src/lsm/lsm_work_unit.c
+++ b/src/lsm/lsm_work_unit.c
@@ -215,6 +215,10 @@ __wt_lsm_work_bloom(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
chunk->count == 0)
continue;
+ /* Never create a bloom filter on the oldest chunk */
+ if (chunk == lsm_tree->chunk[0] &&
+ !FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OLDEST))
+ continue;
/*
* See if we win the race to switch on the "busy" flag and
* recheck that the chunk still needs a Bloom filter.