summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-10-31 12:28:22 +1100
committerGitHub <noreply@github.com>2017-10-31 12:28:22 +1100
commit0493aaf9d1b6902b82967e1305b49dbf0fb9aa09 (patch)
tree4b0e925db2b941f2561f03b9dc19206887c078c1 /src
parentcad209bdd902df372cc4bc617b080f849fb90261 (diff)
downloadmongo-0493aaf9d1b6902b82967e1305b49dbf0fb9aa09.tar.gz
Revert WT-3705 Full build Friday and lint (#3770)
This reverts commit cad209bdd902df372cc4bc617b080f849fb90261.
Diffstat (limited to 'src')
-rw-r--r--src/btree/bt_debug.c5
-rw-r--r--src/btree/bt_split.c2
-rw-r--r--src/conn/conn_cache_pool.c2
-rw-r--r--src/conn/conn_dhandle.c152
-rw-r--r--src/evict/evict_lru.c19
-rw-r--r--src/evict/evict_page.c2
-rw-r--r--src/include/api.h9
-rw-r--r--src/include/lint.h10
-rw-r--r--src/include/misc.h2
-rw-r--r--src/include/txn.i14
-rw-r--r--src/reconcile/rec_write.c6
-rw-r--r--src/txn/txn.c2
-rw-r--r--src/txn/txn_ckpt.c3
-rw-r--r--src/txn/txn_timestamp.c6
-rw-r--r--src/utilities/util_dump.c2
15 files changed, 122 insertions, 114 deletions
diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c
index 3df5920830c..caa960d78ae 100644
--- a/src/btree/bt_debug.c
+++ b/src/btree/bt_debug.c
@@ -733,8 +733,6 @@ __debug_page_metadata(WT_DBG *ds, WT_REF *ref)
WT_RET(ds->f(ds, ", entries %" PRIu32, entries));
WT_RET(ds->f(ds,
", %s", __wt_page_is_modified(page) ? "dirty" : "clean"));
- WT_RET(ds->f(ds,
- ", memory_size %" WT_SIZET_FMT, page->memory_footprint));
if (F_ISSET_ATOMIC(page, WT_PAGE_BUILD_KEYS))
WT_RET(ds->f(ds, ", keys-built"));
@@ -1034,7 +1032,8 @@ __debug_modified(WT_DBG *ds, WT_UPDATE *upd)
p = (size_t *)upd->data;
memcpy(&nentries, p++, sizeof(size_t));
- data = upd->data + sizeof(size_t) + (nentries * 3 * sizeof(size_t));
+ data = upd->data +
+ sizeof(size_t) + ((size_t)nentries * 3 * sizeof(size_t));
WT_RET(ds->f(ds, "%" WT_SIZET_FMT ": ", nentries));
for (; nentries-- > 0; data += data_size) {
diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c
index fce35bc28a4..66f0478c542 100644
--- a/src/btree/bt_split.c
+++ b/src/btree/bt_split.c
@@ -1673,8 +1673,10 @@ __wt_multi_to_ref(WT_SESSION_IMPL *session,
WT_RET(__wt_calloc_one(session, &ref->page_las));
ref->page_las->las_pageid = multi->las_pageid;
+#ifdef HAVE_TIMESTAMPS
__wt_timestamp_set(
&ref->page_las->min_timestamp, &multi->las_min_timestamp);
+#endif
ref->state = WT_REF_LOOKASIDE;
}
diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c
index afe29284d06..4475b27a7b8 100644
--- a/src/conn/conn_cache_pool.c
+++ b/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/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index 7f55b1cc4fd..2606c9d083b 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -9,81 +9,6 @@
#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.
*/
@@ -105,7 +30,6 @@ __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);
@@ -392,6 +316,81 @@ 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.
*/
@@ -747,6 +746,7 @@ __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;
}
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 2f9c83fef57..daee1b3d29a 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -760,15 +760,16 @@ __evict_pass(WT_SESSION_IMPL *session)
__wt_verbose(session, WT_VERB_EVICTSERVER,
"%s", "unable to reach eviction goal");
break;
+ } else {
+ if (cache->evict_aggressive_score > 0) {
+ --cache->evict_aggressive_score;
+ WT_STAT_CONN_SET(session,
+ cache_eviction_aggressive_set,
+ cache->evict_aggressive_score);
+ }
+ loop = 0;
+ eviction_progress = cache->eviction_progress;
}
- if (cache->evict_aggressive_score > 0) {
- --cache->evict_aggressive_score;
- WT_STAT_CONN_SET(session,
- cache_eviction_aggressive_set,
- cache->evict_aggressive_score);
- }
- loop = 0;
- eviction_progress = cache->eviction_progress;
}
return (0);
}
@@ -982,6 +983,8 @@ __evict_tune_workers(WT_SESSION_IMPL *session)
if (conn->evict_threads_max == conn->evict_threads_min)
return;
+ eviction_progress_rate = 0;
+
__wt_epoch(session, &current_time);
time_diff = WT_TIMEDIFF_MS(current_time, cache->evict_tune_last_time);
diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c
index 71a10a3a191..edf80ec4460 100644
--- a/src/evict/evict_page.c
+++ b/src/evict/evict_page.c
@@ -369,9 +369,11 @@ __evict_page_dirty_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
__wt_calloc_one(session, &ref->page_las));
ref->page_las->las_pageid =
mod->mod_replace_las_pageid;
+#ifdef HAVE_TIMESTAMPS
__wt_timestamp_set(
&ref->page_las->min_timestamp,
&mod->mod_replace_las_min_timestamp);
+#endif
__wt_ref_out(session, ref);
WT_PUBLISH(ref->state, WT_REF_LOOKASIDE);
} else {
diff --git a/src/include/api.h b/src/include/api.h
index aa080d2bcca..e1c3ba9ff3c 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -39,10 +39,15 @@
} while (0)
/* An API call wrapped in a transaction if necessary. */
+#ifdef HAVE_TIMESTAMPS
+#define WT_TXN_TIMESTAMP_FLAG_CHECK(s) __wt_txn_timestamp_flags((s))
+#else
+#define WT_TXN_TIMESTAMP_FLAG_CHECK(s)
+#endif
#define TXN_API_CALL(s, h, n, bt, config, cfg) do { \
bool __autotxn = false; \
API_CALL(s, h, n, bt, config, cfg); \
- __wt_txn_timestamp_flags(s); \
+ WT_TXN_TIMESTAMP_FLAG_CHECK(s); \
__autotxn = !F_ISSET(&(s)->txn, WT_TXN_AUTOCOMMIT | WT_TXN_RUNNING);\
if (__autotxn) \
F_SET(&(s)->txn, WT_TXN_AUTOCOMMIT)
@@ -51,7 +56,7 @@
#define TXN_API_CALL_NOCONF(s, h, n, dh) do { \
bool __autotxn = false; \
API_CALL_NOCONF(s, h, n, dh); \
- __wt_txn_timestamp_flags(s); \
+ WT_TXN_TIMESTAMP_FLAG_CHECK(s); \
__autotxn = !F_ISSET(&(s)->txn, WT_TXN_AUTOCOMMIT | WT_TXN_RUNNING);\
if (__autotxn) \
F_SET(&(s)->txn, WT_TXN_AUTOCOMMIT)
diff --git a/src/include/lint.h b/src/include/lint.h
index c02e25592c0..97b91c4c061 100644
--- a/src/include/lint.h
+++ b/src/include/lint.h
@@ -84,8 +84,8 @@ __wt_atomic_cas_ptr(void *vp, void *orig, void *new) {
return (false);
}
-static inline void WT_BARRIER(void) { }
-static inline void WT_FULL_BARRIER(void) { }
-static inline void WT_PAUSE(void) { }
-static inline void WT_READ_BARRIER(void) { }
-static inline void WT_WRITE_BARRIER(void) { }
+static inline void WT_BARRIER(void) { return; }
+static inline void WT_FULL_BARRIER(void) { return; }
+static inline void WT_PAUSE(void) { return; }
+static inline void WT_READ_BARRIER(void) { return; }
+static inline void WT_WRITE_BARRIER(void) { return; }
diff --git a/src/include/misc.h b/src/include/misc.h
index 2435d37ee20..e7b3e1931ac 100644
--- a/src/include/misc.h
+++ b/src/include/misc.h
@@ -275,8 +275,8 @@ typedef struct __wt_timestamp_t wt_timestamp_t;
#define WT_TIMESTAMP_NULL(x) (x)
#else
typedef void wt_timestamp_t;
-#define WT_DECL_TIMESTAMP(x)
#define WT_TIMESTAMP_NULL(x) (NULL)
+#define WT_DECL_TIMESTAMP(x)
#endif
/*
diff --git a/src/include/txn.i b/src/include/txn.i
index 9e70632d890..b0b71dbb3d0 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -82,9 +82,7 @@ __wt_timestamp_set_zero(wt_timestamp_t *ts)
{
ts->val = 0;
}
-
-#else /* WT_TIMESTAMP_SIZE != 8 */
-
+#else
#define WT_WITH_TIMESTAMP_READLOCK(s, l, e) do { \
__wt_readlock((s), (l)); \
e; \
@@ -143,16 +141,6 @@ __wt_timestamp_set_zero(wt_timestamp_t *ts)
memset(ts->ts, 0x00, WT_TIMESTAMP_SIZE);
}
#endif /* WT_TIMESTAMP_SIZE == 8 */
-
-#else /* !HAVE_TIMESTAMPS */
-
-#define __wt_timestamp_set(dest, src)
-#define __wt_timestamp_set_inf(ts)
-#define __wt_timestamp_set_zero(ts)
-#define __wt_txn_clear_commit_timestamp(session)
-#define __wt_txn_clear_read_timestamp(session)
-#define __wt_txn_timestamp_flags(session)
-
#endif /* HAVE_TIMESTAMPS */
/*
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 199baaf2bf2..ae856649ede 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -689,7 +689,9 @@ __rec_write_page_status(WT_SESSION_IMPL *session, WT_RECONCILE *r)
* we're likely to be able to evict this page in the future).
*/
mod->rec_max_txn = r->max_txn;
+#ifdef HAVE_TIMESTAMPS
__wt_timestamp_set(&mod->rec_max_timestamp, &r->max_timestamp);
+#endif
/*
* Track the tree's maximum transaction ID (used to decide if
@@ -962,8 +964,10 @@ __rec_init(WT_SESSION_IMPL *session,
/* Track the page's min/maximum transaction */
r->max_txn = WT_TXN_NONE;
+#ifdef HAVE_TIMESTAMPS
__wt_timestamp_set_zero(&r->max_timestamp);
__wt_timestamp_set_inf(&r->min_saved_timestamp);
+#endif
/* Track if updates were used and/or uncommitted. */
r->update_uncommitted = r->update_used = false;
@@ -5866,8 +5870,10 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
mod->mod_disk_image = r->multi->disk_image;
r->multi->disk_image = NULL;
mod->mod_replace_las_pageid = r->multi->las_pageid;
+#ifdef HAVE_TIMESTAMPS
__wt_timestamp_set(&mod->mod_replace_las_min_timestamp,
&r->min_saved_timestamp);
+#endif
} else
WT_RET(__wt_bt_write(session, r->wrapup_checkpoint,
NULL, NULL, true, F_ISSET(r, WT_REC_CHECKPOINT),
diff --git a/src/txn/txn.c b/src/txn/txn.c
index 3d45ff8a88c..91771403e13 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -578,8 +578,10 @@ __wt_txn_release(WT_SESSION_IMPL *session)
txn->id = WT_TXN_NONE;
}
+#ifdef HAVE_TIMESTAMPS
__wt_txn_clear_commit_timestamp(session);
__wt_txn_clear_read_timestamp(session);
+#endif
/* Free the scratch buffer allocated for logging. */
__wt_logrec_free(session, &txn->logrec);
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index eb32ef2d06a..f3f3331cff3 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -437,7 +437,8 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session)
for (;;) {
current_dirty =
(100.0 * __wt_cache_dirty_leaf_inuse(cache)) / cache_size;
- if (current_dirty <= (double)cache->eviction_checkpoint_target)
+ if (current_dirty <=
+ (double)cache->eviction_checkpoint_target)
break;
__wt_sleep(0, stepdown_us / 10);
diff --git a/src/txn/txn_timestamp.c b/src/txn/txn_timestamp.c
index 2d844dac5da..0201036684d 100644
--- a/src/txn/txn_timestamp.c
+++ b/src/txn/txn_timestamp.c
@@ -467,11 +467,11 @@ __wt_txn_global_set_timestamp(WT_SESSION_IMPL *session, const char *cfg[])
if (has_oldest || has_stable)
WT_RET(__wt_txn_update_pinned_timestamp(session));
}
- return (0);
#else
- WT_RET_MSG(session, ENOTSUP, "set_timestamp requires a "
- "version of WiredTiger built with timestamp support");
+ WT_RET_MSG(session, ENOTSUP, "set_timestamp requires a "
+ "version of WiredTiger built with timestamp support");
#endif
+ return (0);
}
#ifdef HAVE_TIMESTAMPS
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c
index f768d323afb..2f572f3f370 100644
--- a/src/utilities/util_dump.c
+++ b/src/utilities/util_dump.c
@@ -269,7 +269,7 @@ dump_add_config(WT_SESSION *session, char **bufp, size_t *leftp,
if (ret != 0)
return (util_err(session, ret, NULL));
*bufp += n;
- *leftp -= n;
+ *leftp -= (size_t)n;
return (0);
}