summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2013-06-06 12:08:28 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2013-06-06 12:08:28 +1000
commit87610713a6d171f83f4ec70a735fe835443e2822 (patch)
tree1db90fde9ed765d8f1c5ed783879ba907c0222c7
parentb4e20f1e193142d131c24c1417658dc16f6a5f33 (diff)
downloadmongo-87610713a6d171f83f4ec70a735fe835443e2822.tar.gz
Improve error handling when creating bloom filters in LSM.
-rw-r--r--src/lsm/lsm_merge.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c
index 3d434ad33a9..434606d71bb 100644
--- a/src/lsm/lsm_merge.c
+++ b/src/lsm/lsm_merge.c
@@ -256,13 +256,19 @@ __wt_lsm_merge(
"Bloom size for %" PRIu64 " has %" PRIu64 " items inserted.",
record_count, insert_count);
- /* We've successfully created the new chunk. Now install it. */
+ /*
+ * We've successfully created the new chunk. Now install it. We need
+ * to ensure that the NO_CACHE flag is cleared and the bloom filter
+ * is closed (even if a step fails), so track errors but don't return
+ * until we've cleaned up.
+ */
WT_TRET(src->close(src));
WT_TRET(dest->close(dest));
src = dest = NULL;
if (create_bloom) {
- WT_TRET(__wt_bloom_finalize(bloom));
+ if (ret == 0)
+ WT_TRET(__wt_bloom_finalize(bloom));
/*
* Read in a key to make sure the Bloom filters btree handle is
@@ -270,8 +276,10 @@ __wt_lsm_merge(
* Otherwise application threads will stall while it is opened
* and internal pages are read into cache.
*/
- WT_CLEAR(key);
- WT_TRET_NOTFOUND_OK(__wt_bloom_get(bloom, &key));
+ if (ret == 0) {
+ WT_CLEAR(key);
+ WT_TRET_NOTFOUND_OK(__wt_bloom_get(bloom, &key));
+ }
WT_TRET(__wt_bloom_close(bloom));
bloom = NULL;