diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-10-31 12:28:22 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-31 12:28:22 +1100 |
commit | 0493aaf9d1b6902b82967e1305b49dbf0fb9aa09 (patch) | |
tree | 4b0e925db2b941f2561f03b9dc19206887c078c1 | |
parent | cad209bdd902df372cc4bc617b080f849fb90261 (diff) | |
download | mongo-0493aaf9d1b6902b82967e1305b49dbf0fb9aa09.tar.gz |
Revert WT-3705 Full build Friday and lint (#3770)
This reverts commit cad209bdd902df372cc4bc617b080f849fb90261.
42 files changed, 337 insertions, 121 deletions
diff --git a/dist/package/debian/README.Debian b/dist/package/debian/README.Debian new file mode 100644 index 00000000000..2028c0740dc --- /dev/null +++ b/dist/package/debian/README.Debian @@ -0,0 +1,8 @@ +wiredtiger for Debian +--------------------- + +This is a package of the WiredTiger database library for Debian based +systems. For more information on WiredTiger please visit: +http://www.wiredtiger.com or contact us at info@wiredtiger.com + + -- Alex <alexg@wiredtiger.com> Tue, 01 Apr 2014 15:50:02 +1100 diff --git a/dist/package/debian/README.source b/dist/package/debian/README.source new file mode 100644 index 00000000000..ddd6dc94c3d --- /dev/null +++ b/dist/package/debian/README.source @@ -0,0 +1,9 @@ +wiredtiger for Debian +--------------------- + +<this file describes information about the source package, see Debian policy +manual section 4.14. You WILL either need to modify or delete this file> + + + + diff --git a/dist/package/debian/changelog b/dist/package/debian/changelog new file mode 100644 index 00000000000..1481a506d6d --- /dev/null +++ b/dist/package/debian/changelog @@ -0,0 +1,5 @@ +wiredtiger (2.1.2-1) UNRELEASED; urgency=low + + * Initial release of WiredTiger + + -- Alex <alexg@wiredtiger.com> Tue, 01 Apr 2014 15:50:02 +1100 diff --git a/dist/package/debian/compat b/dist/package/debian/compat new file mode 100644 index 00000000000..45a4fb75db8 --- /dev/null +++ b/dist/package/debian/compat @@ -0,0 +1 @@ +8 diff --git a/dist/package/debian/control b/dist/package/debian/control new file mode 100644 index 00000000000..5ad2b71b4b9 --- /dev/null +++ b/dist/package/debian/control @@ -0,0 +1,36 @@ +Source: wiredtiger +Priority: extra +Maintainer: Alex Gorrod <alexg@wiredtiger.com> +Build-Depends: debhelper (>= 8.0.0), autotools-dev +Standards-Version: 3.9.4 +Section: libs +Homepage: http://www.wiredtiger.com +#Vcs-Git: git://git.debian.org/collab-maint/wiredtiger.git +#Vcs-Browser: http://git.debian.org/?p=collab-maint/wiredtiger.git;a=summary + +Package: libwiredtiger-dev +Architecture: any +Section: libdevel +Priority: extra +Depends: ${misc:Depends} +Description: WiredTiger Database Libraries [development] + This is the development package which contains headers and static + libraries for the WiredTiger database library. + +Package: libwiredtiger +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: WiredTiger Database Libraries [runtime] + This is the runtime package for programs that use the WiredTiger + database library. + +Package: wiredtiger-util +Architecture: any +Section: database +Priority: extra +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: WiredTiger Database Utilities + This package provides tools for manipulating WiredTiger databases + diff --git a/dist/package/debian/copyright b/dist/package/debian/copyright new file mode 100644 index 00000000000..1394ad8b4bd --- /dev/null +++ b/dist/package/debian/copyright @@ -0,0 +1,26 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: wiredtiger +Source: <http://www.wiredtiger.com> + +Files: * +Copyright: (c) 2008-2014 WiredTiger, Inc. +License: + This program is free software: you can redistribute it and/or modify it under + the terms of either version 2 or version 3 of the GNU General Public License + as published by the Free Software Foundation. + . + On Debian GNU/Linux systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-2' and + `/usr/share/common-licenses/GPL-3'. + . + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + . + For a license to use the WiredTiger software under conditions other than those + described by the GNU General Public License, or for technical support for this + software, contact WiredTiger, Inc. at info@wiredtiger.com. + . + For further information, see the licensing section in the documentation. + diff --git a/dist/package/debian/docs b/dist/package/debian/docs new file mode 100644 index 00000000000..50bd824bb7b --- /dev/null +++ b/dist/package/debian/docs @@ -0,0 +1,2 @@ +NEWS +README diff --git a/dist/package/debian/files b/dist/package/debian/files new file mode 100644 index 00000000000..53662d0c48e --- /dev/null +++ b/dist/package/debian/files @@ -0,0 +1,3 @@ +libwiredtiger-dev_2.1.2-1_amd64.deb libdevel extra +libwiredtiger_2.1.2-1_amd64.deb libs extra +wiredtiger-util_2.1.2-1_amd64.deb database extra diff --git a/dist/package/debian/libwiredtiger-dev.dirs b/dist/package/debian/libwiredtiger-dev.dirs new file mode 100644 index 00000000000..da07fddd09b --- /dev/null +++ b/dist/package/debian/libwiredtiger-dev.dirs @@ -0,0 +1,2 @@ +usr/include +usr/lib diff --git a/dist/package/debian/libwiredtiger-dev.install b/dist/package/debian/libwiredtiger-dev.install new file mode 100644 index 00000000000..deb99408b27 --- /dev/null +++ b/dist/package/debian/libwiredtiger-dev.install @@ -0,0 +1,2 @@ +usr/include/* +usr/lib/pkgconfig/* diff --git a/dist/package/debian/libwiredtiger-dev.substvars b/dist/package/debian/libwiredtiger-dev.substvars new file mode 100644 index 00000000000..abd3ebebc30 --- /dev/null +++ b/dist/package/debian/libwiredtiger-dev.substvars @@ -0,0 +1 @@ +misc:Depends= diff --git a/dist/package/debian/libwiredtiger.dirs b/dist/package/debian/libwiredtiger.dirs new file mode 100644 index 00000000000..68457717bd8 --- /dev/null +++ b/dist/package/debian/libwiredtiger.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/dist/package/debian/libwiredtiger.install b/dist/package/debian/libwiredtiger.install new file mode 100644 index 00000000000..27fae7a0850 --- /dev/null +++ b/dist/package/debian/libwiredtiger.install @@ -0,0 +1,2 @@ +usr/lib/libwiredtiger*.a +usr/lib/libwiredtiger*.so diff --git a/dist/package/debian/libwiredtiger.postinst.debhelper b/dist/package/debian/libwiredtiger.postinst.debhelper new file mode 100644 index 00000000000..3d89d3ef629 --- /dev/null +++ b/dist/package/debian/libwiredtiger.postinst.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_makeshlibs +if [ "$1" = "configure" ]; then + ldconfig +fi +# End automatically added section diff --git a/dist/package/debian/libwiredtiger.postrm.debhelper b/dist/package/debian/libwiredtiger.postrm.debhelper new file mode 100644 index 00000000000..7f44047270f --- /dev/null +++ b/dist/package/debian/libwiredtiger.postrm.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_makeshlibs +if [ "$1" = "remove" ]; then + ldconfig +fi +# End automatically added section diff --git a/dist/package/debian/libwiredtiger.substvars b/dist/package/debian/libwiredtiger.substvars new file mode 100644 index 00000000000..1e00e6fd7a6 --- /dev/null +++ b/dist/package/debian/libwiredtiger.substvars @@ -0,0 +1,2 @@ +shlibs:Depends=libc6 (>= 2.14) +misc:Depends= diff --git a/dist/package/debian/rules b/dist/package/debian/rules new file mode 100755 index 00000000000..312e24d2e6f --- /dev/null +++ b/dist/package/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ --with autotools-dev diff --git a/dist/package/debian/shlibs.local b/dist/package/debian/shlibs.local new file mode 100644 index 00000000000..a3b3face389 --- /dev/null +++ b/dist/package/debian/shlibs.local @@ -0,0 +1 @@ +libwiredtiger 2.1.2 wiredtiger (>> 2.1.2-0), wiredtiger (<< 2.1.2-99) diff --git a/dist/package/debian/source/format b/dist/package/debian/source/format new file mode 100644 index 00000000000..163aaf8d82b --- /dev/null +++ b/dist/package/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/dist/package/debian/watch b/dist/package/debian/watch new file mode 100644 index 00000000000..9287dca3d91 --- /dev/null +++ b/dist/package/debian/watch @@ -0,0 +1,8 @@ +# Watch control file for uscan +# to check for upstream updates and more. +# See uscan(1) for format + +# Compulsory line, this is a version 3 file +version=3 + +http://source.wiredtiger.com/releases/wiredtiger-(.*)\.tar\.bz2 diff --git a/dist/package/debian/wiredtiger-util.dirs b/dist/package/debian/wiredtiger-util.dirs new file mode 100644 index 00000000000..e7724817552 --- /dev/null +++ b/dist/package/debian/wiredtiger-util.dirs @@ -0,0 +1 @@ +usr/bin diff --git a/dist/package/debian/wiredtiger-util.install b/dist/package/debian/wiredtiger-util.install new file mode 100644 index 00000000000..1df36c612fb --- /dev/null +++ b/dist/package/debian/wiredtiger-util.install @@ -0,0 +1 @@ +usr/bin/* diff --git a/dist/package/debian/wiredtiger-util.substvars b/dist/package/debian/wiredtiger-util.substvars new file mode 100644 index 00000000000..4dd9c7cf955 --- /dev/null +++ b/dist/package/debian/wiredtiger-util.substvars @@ -0,0 +1,2 @@ +shlibs:Depends=libc6 (>= 2.14), wiredtiger (>> 2.1.2-0), wiredtiger (<< 2.1.2-99) +misc:Depends= diff --git a/dist/package/debian/wiredtiger.doc-base b/dist/package/debian/wiredtiger.doc-base new file mode 100644 index 00000000000..faa994f156f --- /dev/null +++ b/dist/package/debian/wiredtiger.doc-base @@ -0,0 +1,12 @@ +Document: wiredtiger +Title: Debian wiredtiger Manual +Author: WiredTiger, Inc. +Abstract: WiredTiger is a database storage engine library. +Section: library + +Format: postscript +Files: /usr/share/doc/wiredtiger/wiredtiger.ps.gz + +Format: HTML +Index: /usr/share/doc/wiredtiger/html/index.html +Files: /usr/share/doc/wiredtiger/html/*.html diff --git a/dist/package/wiredtiger.spec b/dist/package/wiredtiger.spec new file mode 100644 index 00000000000..f4cb78183d0 --- /dev/null +++ b/dist/package/wiredtiger.spec @@ -0,0 +1,58 @@ +Name: wiredtiger +Version: 3.0.0 +Release: 1%{?dist} +Summary: WiredTiger data storage engine + +Group: Development/Libraries +License: GPLV2 or GPLV3 +URL: www.wiredtiger.com +Source0: http://source.wiredtiger.com/releases/%{name}-%{version}.tar.bz2 +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +BuildRequires: python-devel java-devel +Requires: jemalloc + +%description + +WiredTiger is a data storage engine that provides APIs for efficiently +storing data in highly concurrent applications. It includes functionality +for automatically maintaining indexes. It implements both row and column +store formats - so that all types of data can be stored space efficiently. + +WiredTiger is a library that can be accessed via C, Python and Java APIs. + + +%prep +%autosetup + + +%build +%configure --enable-java --enable-bzip2 --enable-snappy --enable-zlib +# Stop the build setting up an rpath +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +make %{?_smp_mflags} + + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +# Need to resolve make install with --enable-python before we can +# install the python API. +# python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%doc README LICENSE NEWS +%{_bindir}/* +%{_datadir}/* +%{_includedir}/* +%{_libdir}/* + + +%changelog + diff --git a/dist/s_define.list b/dist/s_define.list index dcaf975434f..b2f6cbec43e 100644 --- a/dist/s_define.list +++ b/dist/s_define.list @@ -58,6 +58,7 @@ WT_STAT_INCRV_BASE WT_STAT_WRITE WT_TIMEDIFF_US WT_TRET_ERROR_OK +WT_TXN_TIMESTAMP_FLAG_CHECK WT_UPDATE_SIZE WT_WITH_LOCK_NOWAIT WT_WITH_LOCK_WAIT 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, ¤t_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); } diff --git a/test/format/config.h b/test/format/config.h index 7ac65147462..1c4af94dc5c 100644 --- a/test/format/config.h +++ b/test/format/config.h @@ -119,7 +119,7 @@ static CONFIG c[] = { { "checksum", "type of checksums (on | off | uncompressed)", - C_IGNORE|C_STRING, 0, 0, 0, NULL, &g.c_checksum }, + C_IGNORE|C_STRING, 1, 3, 3, NULL, &g.c_checksum }, { "chunk_size", "LSM chunk size in MB", @@ -163,7 +163,7 @@ static CONFIG c[] = { { "file_type", "type of store to create (fix | var | row)", - C_IGNORE|C_STRING, 0, 0, 0, NULL, &g.c_file_type }, + C_IGNORE|C_STRING, 1, 3, 3, NULL, &g.c_file_type }, { "firstfit", "if allocation is firstfit", /* 10% */ @@ -200,7 +200,7 @@ static CONFIG c[] = { { "isolation", "isolation level " "(random | read-uncommitted | read-committed | snapshot)", - C_IGNORE|C_STRING, 0, 0, 0, NULL, &g.c_isolation }, + C_IGNORE|C_STRING, 1, 4, 4, NULL, &g.c_isolation }, { "key_gap", "gap between instantiated keys on a Btree page", @@ -276,7 +276,7 @@ static CONFIG c[] = { { "quiet", "quiet run (same as -q)", - C_IGNORE|C_BOOL, 0, 0, 1, &g.c_quiet, NULL }, + C_IGNORE|C_BOOL, 0, 0, 0, &g.c_quiet, NULL }, { "read_pct", "percent operations that are reads", @@ -300,7 +300,7 @@ static CONFIG c[] = { { "runs", "the number of runs", - C_IGNORE, 0, 0, UINT_MAX, &g.c_runs, NULL }, + C_IGNORE, 0, UINT_MAX, UINT_MAX, &g.c_runs, NULL }, { "salvage", "salvage testing", /* 100% */ @@ -323,8 +323,8 @@ static CONFIG c[] = { 0x0, 1, 32, 128, &g.c_threads, NULL }, { "timer", - "maximum time to run in minutes", - C_IGNORE, 0, 0, UINT_MAX, &g.c_timer, NULL }, + "maximum time to run in minutes (default 20 minutes)", + C_IGNORE, 0, UINT_MAX, UINT_MAX, &g.c_timer, NULL }, { "transaction_timestamps", /* 10% */ "enable transaction timestamp support", |