summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
diff options
context:
space:
mode:
authorRamon Fernandez <ramon@mongodb.com>2016-08-26 18:28:48 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-08-26 18:28:48 -0400
commitf2a613a41d6ad7b5a1b66087e386380d38e50599 (patch)
tree4843fb7b6a835e72046142046e9364f7d7dda992 /src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
parent7614c0eb2449eb4ec22d21b677177124d61f1888 (diff)
downloadmongo-f2a613a41d6ad7b5a1b66087e386380d38e50599.tar.gz
Import wiredtiger: 2566118fc68b0124187e806bed52eb7cdbcb1be0 from branch mongodb-3.4
ref: 34182ad..2566118fc6 for: 3.3.12 WT-2631 nullptr is passed for parameters marked with attribute non-null WT-2638 ftruncate may not be supported WT-2645 wt dump: push the complexity of collecting metadata into a dump cursor WT-2678 The metadata should not imply that an empty value is true WT-2695 Integrate s390x accelerated crc32c support WT-2719 add fuzz testing for WiredTiger options and reconfiguration. WT-2734 Improve documentation of eviction behavior WT-2766 Don't count eviction of lookaside file pages for the purpose of checking stuck cache WT-2783 wtperf multi-btree.wtperf dumps core on Mac WT-2787 Include src/include/wiredtiger_ext.h is problematic WT-2795 Update documentation around read-only configuration WT-2807 Switch Jenkins performance tests to tcmalloc WT-2813 small cache usage stuck even with large cache WT-2814 Enhance wtperf to support single-op truncate mode WT-2816 Improve WiredTiger eviction performance WT-2817 Investigate performance regression in develop, add workload to wtperf/runners WT-2818 The page visibility check when queuing pages for eviction is overly restrictive WT-2820 add gcc warn_unused_result attribute WT-2822 panic mutex and other functions that cannot fail WT-2823 support file handles without a truncate method WT-2826 clang38 false positive on uninitialized variable. WT-2827 checkpoint log_size configuration improvements WT-2828 Make long wtperf tests reflect mongoDB usage WT-2829 Switch automated testing to use enable-strict configure option WT-2832 Python test uses hard-coded temporary directory WT-2834 Join cursor: discrepancy with bloom filters WT-2835 WT_CONNECTION.leak-memory can skip memory map and cache cleanup WT-2838 Don't free session handles on close if leak memory is configured WT-2839 lint: Ignoring return value of function WT-2840 clang analysis: garbage values WT-2841 Jenkins Valgrind runner is reporting errors in test wt2719_reconfig WT-2843 Fix a bug in recovery if there is no filesystem truncate support WT-2846 Several bugs related to reconfiguring eviction server at runtime WT-2847 Merge fair locks into read/write locks. WT-2850 clang 4.1 attribute warnings when building WT-2853 Multi threaded reader writer example shows temporary slowdown or lockup WT-2857 POSIX ftruncate calls should be #ifdef'd HAVE_FTRUNCATE WT-2862 Fix lint error in test case for forced eviction with multiple cursors WT-2863 Support UTF-8 paths on Windows
Diffstat (limited to 'src/third_party/wiredtiger/src/lsm/lsm_work_unit.c')
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_work_unit.c70
1 files changed, 37 insertions, 33 deletions
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
index 0f2a407c70d..bfca09b3807 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
@@ -28,9 +28,11 @@ __lsm_copy_chunks(WT_SESSION_IMPL *session,
/* Always return zero chunks on error. */
cookie->nchunks = 0;
- WT_RET(__wt_lsm_tree_readlock(session, lsm_tree));
- if (!lsm_tree->active)
- return (__wt_lsm_tree_readunlock(session, lsm_tree));
+ __wt_lsm_tree_readlock(session, lsm_tree);
+ if (!lsm_tree->active) {
+ __wt_lsm_tree_readunlock(session, lsm_tree);
+ return (0);
+ }
/* Take a copy of the current state of the LSM tree. */
nchunks = old_chunks ? lsm_tree->nold_chunks : lsm_tree->nchunks;
@@ -55,7 +57,7 @@ __lsm_copy_chunks(WT_SESSION_IMPL *session,
for (i = 0; i < nchunks; i++)
(void)__wt_atomic_add32(&cookie->chunk_array[i]->refcnt, 1);
-err: WT_TRET(__wt_lsm_tree_readunlock(session, lsm_tree));
+err: __wt_lsm_tree_readunlock(session, lsm_tree);
if (ret == 0)
cookie->nchunks = nchunks;
@@ -78,9 +80,11 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session,
chunk = evict_chunk = flush_chunk = NULL;
WT_ASSERT(session, lsm_tree->queue_ref > 0);
- WT_RET(__wt_lsm_tree_readlock(session, lsm_tree));
- if (!lsm_tree->active || lsm_tree->nchunks == 0)
- return (__wt_lsm_tree_readunlock(session, lsm_tree));
+ __wt_lsm_tree_readlock(session, lsm_tree);
+ if (!lsm_tree->active || lsm_tree->nchunks == 0) {
+ __wt_lsm_tree_readunlock(session, lsm_tree);
+ return (0);
+ }
/* Search for a chunk to evict and/or a chunk to flush. */
for (i = 0; i < lsm_tree->nchunks; i++) {
@@ -117,15 +121,15 @@ __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session,
chunk = (evict_chunk != NULL) ? evict_chunk : flush_chunk;
if (chunk != NULL) {
- WT_ERR(__wt_verbose(session, WT_VERB_LSM,
+ __wt_verbose(session, WT_VERB_LSM,
"Flush%s: return chunk %" PRIu32 " of %" PRIu32 ": %s",
force ? " w/ force" : "",
- i, lsm_tree->nchunks, chunk->uri));
+ i, lsm_tree->nchunks, chunk->uri);
(void)__wt_atomic_add32(&chunk->refcnt, 1);
}
-err: WT_RET(__wt_lsm_tree_readunlock(session, lsm_tree));
+err: __wt_lsm_tree_readunlock(session, lsm_tree);
*chunkp = chunk;
return (ret);
@@ -282,9 +286,9 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
WT_RET_MSG(session, ret, "discard handle");
}
if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) {
- WT_RET(__wt_verbose(session, WT_VERB_LSM,
+ __wt_verbose(session, WT_VERB_LSM,
"LSM worker %s already on disk",
- chunk->uri));
+ chunk->uri);
return (0);
}
@@ -293,9 +297,9 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
session, WT_TXN_OLDEST_STRICT | WT_TXN_OLDEST_WAIT));
if (chunk->switch_txn == WT_TXN_NONE ||
!__wt_txn_visible_all(session, chunk->switch_txn)) {
- WT_RET(__wt_verbose(session, WT_VERB_LSM,
+ __wt_verbose(session, WT_VERB_LSM,
"LSM worker %s: running transaction, return",
- chunk->uri));
+ chunk->uri);
return (0);
}
@@ -303,8 +307,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
return (0);
flush_set = true;
- WT_ERR(__wt_verbose(session, WT_VERB_LSM, "LSM worker flushing %s",
- chunk->uri));
+ __wt_verbose(session, WT_VERB_LSM, "LSM worker flushing %s",
+ chunk->uri);
/*
* Flush the file before checkpointing: this is the expensive part in
@@ -329,8 +333,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
}
WT_ERR(ret);
- WT_ERR(__wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointing %s",
- chunk->uri));
+ __wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointing %s",
+ chunk->uri);
/*
* Turn on metadata tracking to ensure the checkpoint gets the
@@ -358,14 +362,14 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
++lsm_tree->chunks_flushed;
/* Lock the tree, mark the chunk as on disk and update the metadata. */
- WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree));
+ __wt_lsm_tree_writelock(session, lsm_tree);
F_SET(chunk, WT_LSM_CHUNK_ONDISK);
ret = __wt_lsm_meta_write(session, lsm_tree);
++lsm_tree->dsk_gen;
/* Update the throttle time. */
__wt_lsm_tree_throttle(session, lsm_tree, true);
- WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree));
+ __wt_lsm_tree_writeunlock(session, lsm_tree);
if (ret != 0)
WT_ERR_MSG(session, ret, "LSM metadata write");
@@ -385,8 +389,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
/* Make sure we aren't pinning a transaction ID. */
__wt_txn_release_snapshot(session);
- WT_ERR(__wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointed %s",
- chunk->uri));
+ __wt_verbose(session, WT_VERB_LSM, "LSM worker checkpointed %s",
+ chunk->uri);
/* Schedule a bloom filter create for our newly flushed chunk. */
if (!FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OFF))
@@ -457,17 +461,17 @@ __lsm_bloom_create(WT_SESSION_IMPL *session,
WT_CLEAR(key);
WT_ERR_NOTFOUND_OK(__wt_bloom_get(bloom, &key));
- WT_ERR(__wt_verbose(session, WT_VERB_LSM,
+ __wt_verbose(session, WT_VERB_LSM,
"LSM worker created bloom filter %s. "
"Expected %" PRIu64 " items, got %" PRIu64,
- chunk->bloom_uri, chunk->count, insert_count));
+ chunk->bloom_uri, chunk->count, insert_count);
/* Ensure the bloom filter is in the metadata. */
- WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree));
+ __wt_lsm_tree_writelock(session, lsm_tree);
F_SET(chunk, WT_LSM_CHUNK_BLOOM);
ret = __wt_lsm_meta_write(session, lsm_tree);
++lsm_tree->dsk_gen;
- WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree));
+ __wt_lsm_tree_writeunlock(session, lsm_tree);
if (ret != 0)
WT_ERR_MSG(session, ret, "LSM bloom worker metadata write");
@@ -527,11 +531,11 @@ __lsm_drop_file(WT_SESSION_IMPL *session, const char *uri)
if (ret == 0)
ret = __wt_fs_remove(session, uri + strlen("file:"), false);
- WT_RET(__wt_verbose(session, WT_VERB_LSM, "Dropped %s", uri));
+ __wt_verbose(session, WT_VERB_LSM, "Dropped %s", uri);
if (ret == EBUSY || ret == ENOENT)
- WT_RET(__wt_verbose(session, WT_VERB_LSM,
- "LSM worker drop of %s failed with %d", uri, ret));
+ __wt_verbose(session, WT_VERB_LSM,
+ "LSM worker drop of %s failed with %d", uri, ret);
return (ret);
}
@@ -623,7 +627,7 @@ __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
}
/* Lock the tree to clear out the old chunk information. */
- WT_ERR(__wt_lsm_tree_writelock(session, lsm_tree));
+ __wt_lsm_tree_writelock(session, lsm_tree);
/*
* The chunk we are looking at should be the first one in the
@@ -643,7 +647,7 @@ __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
lsm_tree->old_chunks[lsm_tree->nold_chunks] = NULL;
}
- WT_ERR(__wt_lsm_tree_writeunlock(session, lsm_tree));
+ __wt_lsm_tree_writeunlock(session, lsm_tree);
/*
* Clear the chunk in the cookie so we don't attempt to
@@ -654,9 +658,9 @@ __wt_lsm_free_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
err: /* Flush the metadata unless the system is in panic */
if (flush_metadata && ret != WT_PANIC) {
- WT_TRET(__wt_lsm_tree_writelock(session, lsm_tree));
+ __wt_lsm_tree_writelock(session, lsm_tree);
WT_TRET(__wt_lsm_meta_write(session, lsm_tree));
- WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree));
+ __wt_lsm_tree_writeunlock(session, lsm_tree);
}
__lsm_unpin_chunks(session, &cookie);
__wt_free(session, cookie.chunk_array);