summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-11-02 13:27:27 +1100
committerGitHub <noreply@github.com>2017-11-02 13:27:27 +1100
commitd4e28e6ca1430a7655621c47cc9d77092a813425 (patch)
tree98250d6b6447c379ad6b2f2847b38da9df698c33
parent4907cf82a81b2eae27f086c44f8ce13d24e2038a (diff)
downloadmongo-d4e28e6ca1430a7655621c47cc9d77092a813425.tar.gz
WT-3705 Code style fixes, and remove debian packaging (#3771)
* Cleanup pass over test/format options. Configuration options that don't involve random assignment (C_IGNORE), should only set the min/max range to which they can be assigned, and if they're strings (C_STRING), they shouldn't even set those. * Remove debian packaging support (it was out of date, and there is other up-to-date Debian packaging), remove the RPM specification, we no longer build any RPM packages. * Don't call __conn_dhandle_config_clear() separately from __conn_dhandle_destroy(), WT_DATA_HANDLE.cfg is memory in the dhandle, the destroy function should take care of it. * When debugging a page, dump the page's memory footprint. * Fix code indentation, remove unreachable return. * WiredTiger policy is to call a function in higher level code that is a stub when timestamps are disabled. Remove some unnecessary HAVE_TIMESTAMP * whitespace * WT_TXN_TIMESTAMP_FLAG_CHECK no longer used. * Make declaration order match.
-rw-r--r--dist/package/debian/README.Debian8
-rw-r--r--dist/package/debian/README.source9
-rw-r--r--dist/package/debian/changelog5
-rw-r--r--dist/package/debian/compat1
-rw-r--r--dist/package/debian/control36
-rw-r--r--dist/package/debian/copyright26
-rw-r--r--dist/package/debian/docs2
-rw-r--r--dist/package/debian/files3
-rw-r--r--dist/package/debian/libwiredtiger-dev.dirs2
-rw-r--r--dist/package/debian/libwiredtiger-dev.install2
-rw-r--r--dist/package/debian/libwiredtiger-dev.substvars1
-rw-r--r--dist/package/debian/libwiredtiger.dirs1
-rw-r--r--dist/package/debian/libwiredtiger.install2
-rw-r--r--dist/package/debian/libwiredtiger.postinst.debhelper5
-rw-r--r--dist/package/debian/libwiredtiger.postrm.debhelper5
-rw-r--r--dist/package/debian/libwiredtiger.substvars2
-rwxr-xr-xdist/package/debian/rules13
-rw-r--r--dist/package/debian/shlibs.local1
-rw-r--r--dist/package/debian/source/format1
-rw-r--r--dist/package/debian/watch8
-rw-r--r--dist/package/debian/wiredtiger-util.dirs1
-rw-r--r--dist/package/debian/wiredtiger-util.install1
-rw-r--r--dist/package/debian/wiredtiger-util.substvars2
-rw-r--r--dist/package/debian/wiredtiger.doc-base12
-rw-r--r--dist/package/wiredtiger.spec58
-rw-r--r--dist/s_define.list1
-rw-r--r--src/btree/bt_debug.c5
-rw-r--r--src/conn/conn_cache_pool.c2
-rw-r--r--src/conn/conn_dhandle.c152
-rw-r--r--src/evict/evict_lru.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.c4
-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
-rw-r--r--test/format/config.h14
40 files changed, 113 insertions, 322 deletions
diff --git a/dist/package/debian/README.Debian b/dist/package/debian/README.Debian
deleted file mode 100644
index 2028c0740dc..00000000000
--- a/dist/package/debian/README.Debian
+++ /dev/null
@@ -1,8 +0,0 @@
-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
deleted file mode 100644
index ddd6dc94c3d..00000000000
--- a/dist/package/debian/README.source
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index 1481a506d6d..00000000000
--- a/dist/package/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-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
deleted file mode 100644
index 45a4fb75db8..00000000000
--- a/dist/package/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/dist/package/debian/control b/dist/package/debian/control
deleted file mode 100644
index 5ad2b71b4b9..00000000000
--- a/dist/package/debian/control
+++ /dev/null
@@ -1,36 +0,0 @@
-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
deleted file mode 100644
index 1394ad8b4bd..00000000000
--- a/dist/package/debian/copyright
+++ /dev/null
@@ -1,26 +0,0 @@
-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
deleted file mode 100644
index 50bd824bb7b..00000000000
--- a/dist/package/debian/docs
+++ /dev/null
@@ -1,2 +0,0 @@
-NEWS
-README
diff --git a/dist/package/debian/files b/dist/package/debian/files
deleted file mode 100644
index 53662d0c48e..00000000000
--- a/dist/package/debian/files
+++ /dev/null
@@ -1,3 +0,0 @@
-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
deleted file mode 100644
index da07fddd09b..00000000000
--- a/dist/package/debian/libwiredtiger-dev.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/include
-usr/lib
diff --git a/dist/package/debian/libwiredtiger-dev.install b/dist/package/debian/libwiredtiger-dev.install
deleted file mode 100644
index deb99408b27..00000000000
--- a/dist/package/debian/libwiredtiger-dev.install
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/include/*
-usr/lib/pkgconfig/*
diff --git a/dist/package/debian/libwiredtiger-dev.substvars b/dist/package/debian/libwiredtiger-dev.substvars
deleted file mode 100644
index abd3ebebc30..00000000000
--- a/dist/package/debian/libwiredtiger-dev.substvars
+++ /dev/null
@@ -1 +0,0 @@
-misc:Depends=
diff --git a/dist/package/debian/libwiredtiger.dirs b/dist/package/debian/libwiredtiger.dirs
deleted file mode 100644
index 68457717bd8..00000000000
--- a/dist/package/debian/libwiredtiger.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib
diff --git a/dist/package/debian/libwiredtiger.install b/dist/package/debian/libwiredtiger.install
deleted file mode 100644
index 27fae7a0850..00000000000
--- a/dist/package/debian/libwiredtiger.install
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/libwiredtiger*.a
-usr/lib/libwiredtiger*.so
diff --git a/dist/package/debian/libwiredtiger.postinst.debhelper b/dist/package/debian/libwiredtiger.postinst.debhelper
deleted file mode 100644
index 3d89d3ef629..00000000000
--- a/dist/package/debian/libwiredtiger.postinst.debhelper
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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
deleted file mode 100644
index 7f44047270f..00000000000
--- a/dist/package/debian/libwiredtiger.postrm.debhelper
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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
deleted file mode 100644
index 1e00e6fd7a6..00000000000
--- a/dist/package/debian/libwiredtiger.substvars
+++ /dev/null
@@ -1,2 +0,0 @@
-shlibs:Depends=libc6 (>= 2.14)
-misc:Depends=
diff --git a/dist/package/debian/rules b/dist/package/debian/rules
deleted file mode 100755
index 312e24d2e6f..00000000000
--- a/dist/package/debian/rules
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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
deleted file mode 100644
index a3b3face389..00000000000
--- a/dist/package/debian/shlibs.local
+++ /dev/null
@@ -1 +0,0 @@
-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
deleted file mode 100644
index 163aaf8d82b..00000000000
--- a/dist/package/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/dist/package/debian/watch b/dist/package/debian/watch
deleted file mode 100644
index 9287dca3d91..00000000000
--- a/dist/package/debian/watch
+++ /dev/null
@@ -1,8 +0,0 @@
-# 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
deleted file mode 100644
index e7724817552..00000000000
--- a/dist/package/debian/wiredtiger-util.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/bin
diff --git a/dist/package/debian/wiredtiger-util.install b/dist/package/debian/wiredtiger-util.install
deleted file mode 100644
index 1df36c612fb..00000000000
--- a/dist/package/debian/wiredtiger-util.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/bin/*
diff --git a/dist/package/debian/wiredtiger-util.substvars b/dist/package/debian/wiredtiger-util.substvars
deleted file mode 100644
index 4dd9c7cf955..00000000000
--- a/dist/package/debian/wiredtiger-util.substvars
+++ /dev/null
@@ -1,2 +0,0 @@
-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
deleted file mode 100644
index faa994f156f..00000000000
--- a/dist/package/debian/wiredtiger.doc-base
+++ /dev/null
@@ -1,12 +0,0 @@
-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
deleted file mode 100644
index f4cb78183d0..00000000000
--- a/dist/package/wiredtiger.spec
+++ /dev/null
@@ -1,58 +0,0 @@
-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 b2f6cbec43e..dcaf975434f 100644
--- a/dist/s_define.list
+++ b/dist/s_define.list
@@ -58,7 +58,6 @@ 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 caa960d78ae..3df5920830c 100644
--- a/src/btree/bt_debug.c
+++ b/src/btree/bt_debug.c
@@ -733,6 +733,8 @@ __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"));
@@ -1032,8 +1034,7 @@ __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) + ((size_t)nentries * 3 * sizeof(size_t));
+ data = upd->data + sizeof(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/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c
index 4475b27a7b8..afe29284d06 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 2606c9d083b..7f55b1cc4fd 100644
--- a/src/conn/conn_dhandle.c
+++ b/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;
}
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 2e559531f4b..02851492039 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -974,8 +974,6 @@ __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/include/api.h b/src/include/api.h
index e1c3ba9ff3c..aa080d2bcca 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -39,15 +39,10 @@
} 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_FLAG_CHECK(s); \
+ __wt_txn_timestamp_flags(s); \
__autotxn = !F_ISSET(&(s)->txn, WT_TXN_AUTOCOMMIT | WT_TXN_RUNNING);\
if (__autotxn) \
F_SET(&(s)->txn, WT_TXN_AUTOCOMMIT)
@@ -56,7 +51,7 @@
#define TXN_API_CALL_NOCONF(s, h, n, dh) do { \
bool __autotxn = false; \
API_CALL_NOCONF(s, h, n, dh); \
- WT_TXN_TIMESTAMP_FLAG_CHECK(s); \
+ __wt_txn_timestamp_flags(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 97b91c4c061..c02e25592c0 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) { 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; }
+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) { }
diff --git a/src/include/misc.h b/src/include/misc.h
index e7b3e1931ac..2435d37ee20 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_TIMESTAMP_NULL(x) (NULL)
#define WT_DECL_TIMESTAMP(x)
+#define WT_TIMESTAMP_NULL(x) (NULL)
#endif
/*
diff --git a/src/include/txn.i b/src/include/txn.i
index b0b71dbb3d0..9e70632d890 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -82,7 +82,9 @@ __wt_timestamp_set_zero(wt_timestamp_t *ts)
{
ts->val = 0;
}
-#else
+
+#else /* WT_TIMESTAMP_SIZE != 8 */
+
#define WT_WITH_TIMESTAMP_READLOCK(s, l, e) do { \
__wt_readlock((s), (l)); \
e; \
@@ -141,6 +143,16 @@ __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 01b6d100a0c..3e857fef324 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -702,9 +702,7 @@ __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
@@ -977,11 +975,9 @@ __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_zero(&r->max_onpage_timestamp);
__wt_timestamp_set_inf(&r->min_saved_timestamp);
-#endif
/* Track if updates were used and/or uncommitted. */
r->updates_seen = r->updates_unstable = 0;
diff --git a/src/txn/txn.c b/src/txn/txn.c
index 91771403e13..3d45ff8a88c 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -578,10 +578,8 @@ __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 f3f3331cff3..eb32ef2d06a 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -437,8 +437,7 @@ __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 c52700e6b69..98887627bfc 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 2f572f3f370..f768d323afb 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 -= (size_t)n;
+ *leftp -= n;
return (0);
}
diff --git a/test/format/config.h b/test/format/config.h
index 1c4af94dc5c..7ac65147462 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, 1, 3, 3, NULL, &g.c_checksum },
+ C_IGNORE|C_STRING, 0, 0, 0, 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, 1, 3, 3, NULL, &g.c_file_type },
+ C_IGNORE|C_STRING, 0, 0, 0, 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, 1, 4, 4, NULL, &g.c_isolation },
+ C_IGNORE|C_STRING, 0, 0, 0, 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, 0, &g.c_quiet, NULL },
+ C_IGNORE|C_BOOL, 0, 0, 1, &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, UINT_MAX, UINT_MAX, &g.c_runs, NULL },
+ C_IGNORE, 0, 0, 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 (default 20 minutes)",
- C_IGNORE, 0, UINT_MAX, UINT_MAX, &g.c_timer, NULL },
+ "maximum time to run in minutes",
+ C_IGNORE, 0, 0, UINT_MAX, &g.c_timer, NULL },
{ "transaction_timestamps", /* 10% */
"enable transaction timestamp support",