summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/conn
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2017-11-03 15:14:01 +1100
committerLuke Chen <luke.chen@mongodb.com>2017-11-03 15:37:51 +1100
commit48acb7cfa8503440e1b0ab2771371f4790245015 (patch)
treea8b8efbd78f6aa3b04f53bc1b226ec1e0cf4a422 /src/third_party/wiredtiger/src/conn
parent73b4a7c888d90b8e875104b1a0f20627d29e0124 (diff)
downloadmongo-48acb7cfa8503440e1b0ab2771371f4790245015.tar.gz
Import wiredtiger: 0a2f8f6ad756189263d050b29f69bc57b45b9816 from branch mongodb-3.6
ref: a31e9d415a..0a2f8f6ad7 for: 3.6.0-rc3 WT-3223 Output progress messages during long checkpoint operations WT-3630 Intermittent failure loading libwiredtiger in Evergreen OSX job WT-3652 Skip lookaside reads for checkpoints without a timestamp WT-3666 Fix lost updates with lookaside eviction WT-3675 timestamp abort test failure WT-3677 test/format compaction doesn't handle timeout error return WT-3679 Python test suite: when 'wt' fails, display its output and error files WT-3680 metadata unroll should discard in-process checkpoints WT-3681 Don't truncate the last log file in recovery WT-3683 WT tests failing with cache full of clean pages WT-3699 support minimum cache sizes in format WT-3705 Full build Friday and lint WT-3707 timestamp_abort updating timestamp out of order and parent process not handling failure WT-3708 PRIu64 format incorrectly specified for size_t WT-3711 random_abort test needs signal handler change WT-3713 Make timestamp abort test output more concise WT-3714 Make timestamp_abort and random_abort ranges readable
Diffstat (limited to 'src/third_party/wiredtiger/src/conn')
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_api.c1
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_cache.c13
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_cache_pool.c2
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_dhandle.c152
4 files changed, 91 insertions, 77 deletions
diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c
index f7525f22787..5f77f27ee3f 100644
--- a/src/third_party/wiredtiger/src/conn/conn_api.c
+++ b/src/third_party/wiredtiger/src/conn/conn_api.c
@@ -1808,6 +1808,7 @@ __wt_verbose_config(WT_SESSION_IMPL *session, const char *cfg[])
{ "api", WT_VERB_API },
{ "block", WT_VERB_BLOCK },
{ "checkpoint", WT_VERB_CHECKPOINT },
+ { "checkpoint_progress",WT_VERB_CHECKPOINT_PROGRESS },
{ "compact", WT_VERB_COMPACT },
{ "evict", WT_VERB_EVICT },
{ "evict_stuck", WT_VERB_EVICT_STUCK },
diff --git a/src/third_party/wiredtiger/src/conn/conn_cache.c b/src/third_party/wiredtiger/src/conn/conn_cache.c
index c83fb544982..007aa8757da 100644
--- a/src/third_party/wiredtiger/src/conn/conn_cache.c
+++ b/src/third_party/wiredtiger/src/conn/conn_cache.c
@@ -266,6 +266,19 @@ __wt_cache_stats_update(WT_SESSION_IMPL *session)
WT_STAT_SET(session, stats, cache_pages_dirty,
cache->pages_dirty_intl + cache->pages_dirty_leaf);
+ WT_STAT_CONN_SET(session, cache_eviction_state, cache->flags);
+ WT_STAT_CONN_SET(session,
+ cache_eviction_aggressive_set, cache->evict_aggressive_score);
+ WT_STAT_CONN_SET(session,
+ cache_eviction_empty_score, cache->evict_empty_score);
+ WT_STAT_CONN_SET(session,
+ cache_lookaside_score, __wt_cache_lookaside_score(cache));
+
+ WT_STAT_CONN_SET(session,
+ cache_eviction_active_workers, conn->evict_threads.current_threads);
+ WT_STAT_CONN_SET(session, cache_eviction_stable_state_workers,
+ cache->evict_tune_workers_best);
+
/*
* The number of files with active walks ~= number of hazard pointers
* in the walk session. Note: reading without locking.
diff --git a/src/third_party/wiredtiger/src/conn/conn_cache_pool.c b/src/third_party/wiredtiger/src/conn/conn_cache_pool.c
index 4475b27a7b8..afe29284d06 100644
--- a/src/third_party/wiredtiger/src/conn/conn_cache_pool.c
+++ b/src/third_party/wiredtiger/src/conn/conn_cache_pool.c
@@ -135,7 +135,7 @@ __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg)
if (__wt_config_gets(session, &cfg[1],
"shared_cache.size", &cval) == 0 && cval.val != 0)
size = (uint64_t)cval.val;
- else
+ else
size = cp->size;
if (__wt_config_gets(session, &cfg[1],
"shared_cache.chunk", &cval) == 0 && cval.val != 0)
diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
index 2606c9d083b..7f55b1cc4fd 100644
--- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c
+++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
@@ -9,6 +9,81 @@
#include "wt_internal.h"
/*
+ * __conn_dhandle_config_clear --
+ * Clear the underlying object's configuration information.
+ */
+static void
+__conn_dhandle_config_clear(WT_SESSION_IMPL *session)
+{
+ WT_DATA_HANDLE *dhandle;
+ const char **a;
+
+ dhandle = session->dhandle;
+
+ if (dhandle->cfg == NULL)
+ return;
+ for (a = dhandle->cfg; *a != NULL; ++a)
+ __wt_free(session, *a);
+ __wt_free(session, dhandle->cfg);
+}
+
+/*
+ * __conn_dhandle_config_set --
+ * Set up a btree handle's configuration information.
+ */
+static int
+__conn_dhandle_config_set(WT_SESSION_IMPL *session)
+{
+ WT_DATA_HANDLE *dhandle;
+ WT_DECL_RET;
+ char *metaconf;
+
+ dhandle = session->dhandle;
+
+ /*
+ * Read the object's entry from the metadata file, we're done if we
+ * don't find one.
+ */
+ if ((ret =
+ __wt_metadata_search(session, dhandle->name, &metaconf)) != 0) {
+ if (ret == WT_NOTFOUND)
+ ret = ENOENT;
+ WT_RET(ret);
+ }
+
+ /*
+ * The defaults are included because persistent configuration
+ * information is stored in the metadata file and it may be from an
+ * earlier version of WiredTiger. If defaults are included in the
+ * configuration, we can add new configuration strings without
+ * upgrading the metadata file or writing special code in case a
+ * configuration string isn't initialized, as long as the new
+ * configuration string has an appropriate default value.
+ *
+ * The error handling is a little odd, but be careful: we're holding a
+ * chunk of allocated memory in metaconf. If we fail before we copy a
+ * reference to it into the object's configuration array, we must free
+ * it, after the copy, we don't want to free it.
+ */
+ WT_ERR(__wt_calloc_def(session, 3, &dhandle->cfg));
+ switch (dhandle->type) {
+ case WT_DHANDLE_TYPE_BTREE:
+ WT_ERR(__wt_strdup(session,
+ WT_CONFIG_BASE(session, file_meta), &dhandle->cfg[0]));
+ break;
+ case WT_DHANDLE_TYPE_TABLE:
+ WT_ERR(__wt_strdup(session,
+ WT_CONFIG_BASE(session, table_meta), &dhandle->cfg[0]));
+ break;
+ }
+ dhandle->cfg[1] = metaconf;
+ return (0);
+
+err: __wt_free(session, metaconf);
+ return (ret);
+}
+
+/*
* __conn_dhandle_destroy --
* Destroy a data handle.
*/
@@ -30,6 +105,7 @@ __conn_dhandle_destroy(WT_SESSION_IMPL *session, WT_DATA_HANDLE *dhandle)
__wt_rwlock_destroy(session, &dhandle->rwlock);
__wt_free(session, dhandle->name);
__wt_free(session, dhandle->checkpoint);
+ __conn_dhandle_config_clear(session);
__wt_spin_destroy(session, &dhandle->close_lock);
__wt_stat_dsrc_discard(session, dhandle);
__wt_overwrite_and_free(session, dhandle);
@@ -316,81 +392,6 @@ err: __wt_spin_unlock(session, &dhandle->close_lock);
}
/*
- * __conn_dhandle_config_clear --
- * Clear the underlying object's configuration information.
- */
-static void
-__conn_dhandle_config_clear(WT_SESSION_IMPL *session)
-{
- WT_DATA_HANDLE *dhandle;
- const char **a;
-
- dhandle = session->dhandle;
-
- if (dhandle->cfg == NULL)
- return;
- for (a = dhandle->cfg; *a != NULL; ++a)
- __wt_free(session, *a);
- __wt_free(session, dhandle->cfg);
-}
-
-/*
- * __conn_dhandle_config_set --
- * Set up a btree handle's configuration information.
- */
-static int
-__conn_dhandle_config_set(WT_SESSION_IMPL *session)
-{
- WT_DATA_HANDLE *dhandle;
- WT_DECL_RET;
- char *metaconf;
-
- dhandle = session->dhandle;
-
- /*
- * Read the object's entry from the metadata file, we're done if we
- * don't find one.
- */
- if ((ret =
- __wt_metadata_search(session, dhandle->name, &metaconf)) != 0) {
- if (ret == WT_NOTFOUND)
- ret = ENOENT;
- WT_RET(ret);
- }
-
- /*
- * The defaults are included because persistent configuration
- * information is stored in the metadata file and it may be from an
- * earlier version of WiredTiger. If defaults are included in the
- * configuration, we can add new configuration strings without
- * upgrading the metadata file or writing special code in case a
- * configuration string isn't initialized, as long as the new
- * configuration string has an appropriate default value.
- *
- * The error handling is a little odd, but be careful: we're holding a
- * chunk of allocated memory in metaconf. If we fail before we copy a
- * reference to it into the object's configuration array, we must free
- * it, after the copy, we don't want to free it.
- */
- WT_ERR(__wt_calloc_def(session, 3, &dhandle->cfg));
- switch (dhandle->type) {
- case WT_DHANDLE_TYPE_BTREE:
- WT_ERR(__wt_strdup(session,
- WT_CONFIG_BASE(session, file_meta), &dhandle->cfg[0]));
- break;
- case WT_DHANDLE_TYPE_TABLE:
- WT_ERR(__wt_strdup(session,
- WT_CONFIG_BASE(session, table_meta), &dhandle->cfg[0]));
- break;
- }
- dhandle->cfg[1] = metaconf;
- return (0);
-
-err: __wt_free(session, metaconf);
- return (ret);
-}
-
-/*
* __wt_conn_dhandle_open --
* Open the current data handle.
*/
@@ -746,7 +747,6 @@ __wt_conn_dhandle_discard_single(
* After successfully removing the handle, clean it up.
*/
if (ret == 0 || final) {
- __conn_dhandle_config_clear(session);
WT_TRET(__conn_dhandle_destroy(session, dhandle));
session->dhandle = NULL;
}