summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-11-01 15:52:30 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-11-01 15:52:30 +1100
commit64c54763f0f02184e6e4a3dbfa32652a4a47ed22 (patch)
tree10d4b79f0875858444df96af6abdb3e8abbbd6e0
parenta5aba41271efa77fcbbc79101dc20768792c25b8 (diff)
downloadmongo-64c54763f0f02184e6e4a3dbfa32652a4a47ed22.tar.gz
Minor cleanup in the loop to drop old chunks from an LSM tree.
-rw-r--r--src/lsm/lsm_worker.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index 2eed68fae13..dd16432e635 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -240,17 +240,15 @@ __lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
* An EBUSY return is acceptable - a cursor may still
* be positioned on this old chunk.
*/
- if (ret == 0) {
- progress = 1;
- F_CLR(chunk, WT_LSM_CHUNK_BLOOM);
- __wt_free(session, chunk->bloom_uri);
- chunk->bloom_uri = NULL;
- } else if (ret != EBUSY)
- goto err;
- if (ret == EBUSY)
+ if (ret == EBUSY) {
WT_VERBOSE_ERR(session, lsm,
"LSM worker bloom drop busy: %s.",
chunk->bloom_uri);
+ continue;
+ } else
+ WT_ERR(ret);
+
+ F_CLR(chunk, WT_LSM_CHUNK_BLOOM);
}
if (chunk->uri != NULL) {
WT_WITH_SCHEMA_LOCK(session, ret =
@@ -259,19 +257,20 @@ __lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
* An EBUSY return is acceptable - a cursor may still
* be positioned on this old chunk.
*/
- if (ret == 0) {
- progress = 1;
- __wt_free(session, chunk->uri);
- chunk->uri = NULL;
- } else if (ret != EBUSY)
- goto err;
+ if (ret == EBUSY) {
+ WT_VERBOSE_ERR(session, lsm,
+ "LSM worker drop busy: %s.",
+ chunk->uri);
+ continue;
+ } else
+ WT_ERR(ret);
}
- if (chunk->uri == NULL &&
- !F_ISSET(chunk, WT_LSM_CHUNK_BLOOM)) {
- __wt_free(session, lsm_tree->old_chunks[i]);
- ++lsm_tree->old_avail;
- }
+ progress = 1;
+ __wt_free(session, chunk->bloom_uri);
+ __wt_free(session, chunk->uri);
+ __wt_free(session, lsm_tree->old_chunks[i]);
+ ++lsm_tree->old_avail;
}
if (locked) {
err: WT_TRET(__wt_lsm_meta_write(session, lsm_tree));