summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2015-05-15 10:27:17 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2015-05-15 10:27:17 +1000
commit1b92608873f95d03c4ecdc3b606cde3631092cd4 (patch)
tree3a982fa1fc0ef0e5142fc7cbffcda1a2933775aa
parent40a38e41f4fc711e9e14a919758df12129ab2fb3 (diff)
parent5022f376660be05aba5efeaaae017418b750714c (diff)
downloadmongo-1b92608873f95d03c4ecdc3b606cde3631092cd4.tar.gz
Merge branch 'develop' into 2.6.0-release
-rw-r--r--examples/c/ex_extractor.c4
-rw-r--r--src/lsm/lsm_tree.c12
-rw-r--r--src/lsm/lsm_work_unit.c4
3 files changed, 18 insertions, 2 deletions
diff --git a/examples/c/ex_extractor.c b/examples/c/ex_extractor.c
index 1bfe21cb452..2d985fddd44 100644
--- a/examples/c/ex_extractor.c
+++ b/examples/c/ex_extractor.c
@@ -146,14 +146,14 @@ read_index(WT_SESSION *session)
char *first_name, *last_name;
uint16_t term_end, term_start, year;
- srandom((unsigned int)getpid());
+ srand((unsigned int)getpid());
ret = session->open_cursor(
session, "index:presidents:term", NULL, NULL, &cursor);
/*
* Pick 10 random years and read the data.
*/
for (i = 0; i < 10; i++) {
- year = (uint16_t)((random() % YEAR_SPAN) + YEAR_BASE);
+ year = (uint16_t)((rand() % YEAR_SPAN) + YEAR_BASE);
cursor->set_key(cursor, year);
if ((ret = cursor->search(cursor)) == 0) {
if ((ret = cursor->get_value(cursor, &last_name,
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.