summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2015-03-26 15:10:43 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2015-03-26 15:10:43 +1100
commit8172b0fdf726941bc935fd33f0b65c62b1a6c887 (patch)
treec292483607ba6163719a16f4dd18c8af90203985
parent62087f7528714a69295b4dc01aeacd1549a0e8f6 (diff)
parentbffb1e15619bcc461763d53ac68059f3902d93b2 (diff)
downloadmongo-8172b0fdf726941bc935fd33f0b65c62b1a6c887.tar.gz
Merge branch 'develop' into checkpoint-closing-files
Conflicts: src/conn/conn_sweep.c
-rw-r--r--SConstruct8
-rw-r--r--dist/s_string.ok3
-rw-r--r--dist/stat_data.py9
-rw-r--r--ext/compressors/lz4/lz4_compress.c14
-rw-r--r--ext/compressors/zlib/zlib_compress.c105
-rw-r--r--lang/java/Makefile.am2
-rw-r--r--lang/python/setup.py2
-rw-r--r--src/async/async_worker.c9
-rw-r--r--src/btree/bt_debug.c4
-rw-r--r--src/btree/bt_huffman.c7
-rw-r--r--src/btree/bt_slvg.c17
-rw-r--r--src/btree/bt_sync.c3
-rw-r--r--src/config/config_collapse.c2
-rw-r--r--src/conn/conn_api.c5
-rw-r--r--src/conn/conn_cache.c6
-rw-r--r--src/conn/conn_cache_pool.c4
-rw-r--r--src/conn/conn_ckpt.c4
-rw-r--r--src/conn/conn_dhandle.c6
-rw-r--r--src/conn/conn_log.c14
-rw-r--r--src/conn/conn_stat.c12
-rw-r--r--src/conn/conn_sweep.c105
-rw-r--r--src/cursor/cur_backup.c6
-rw-r--r--src/evict/evict_lru.c16
-rw-r--r--src/include/btree.i10
-rw-r--r--src/include/cache.h2
-rw-r--r--src/include/extern.h12
-rw-r--r--src/include/gcc.h2
-rw-r--r--src/include/lint.h2
-rw-r--r--src/include/misc.h13
-rw-r--r--src/include/msvc.h2
-rw-r--r--src/include/os.h37
-rw-r--r--src/include/os_windows.h14
-rw-r--r--src/include/posix.h12
-rw-r--r--src/include/stat.h3
-rw-r--r--src/include/wiredtiger.in244
-rw-r--r--src/lsm/lsm_manager.c6
-rw-r--r--src/lsm/lsm_worker.c6
-rw-r--r--src/meta/meta_ckpt.c2
-rw-r--r--src/meta/meta_turtle.c10
-rw-r--r--src/os_posix/os_stdio.c31
-rw-r--r--src/os_posix/os_thread.c2
-rw-r--r--src/os_win/os_fallocate.c2
-rw-r--r--src/os_win/os_mtx_cond.c4
-rw-r--r--src/os_win/os_once.c2
-rw-r--r--src/os_win/os_thread.c8
-rw-r--r--src/os_win/os_time.c4
-rw-r--r--src/support/filename.c2
-rw-r--r--src/support/huffman.c8
-rw-r--r--src/support/stat.c6
-rw-r--r--src/txn/txn.c2
-rw-r--r--test/mciproject.yml16
-rw-r--r--test/suite/test_async01.py7
-rw-r--r--test/suite/test_async02.py7
-rw-r--r--test/suite/test_backup02.py7
-rw-r--r--test/suite/test_backup04.py6
-rw-r--r--test/suite/test_base02.py5
-rw-r--r--test/suite/test_base05.py5
-rw-r--r--test/suite/test_bug006.py5
-rw-r--r--test/suite/test_bug008.py7
-rw-r--r--test/suite/test_bulk01.py10
-rw-r--r--test/suite/test_checkpoint01.py25
-rw-r--r--test/suite/test_checkpoint02.py8
-rw-r--r--test/suite/test_cursor01.py5
-rw-r--r--test/suite/test_cursor02.py5
-rw-r--r--test/suite/test_cursor04.py5
-rw-r--r--test/suite/test_cursor06.py10
-rw-r--r--test/suite/test_cursor07.py6
-rw-r--r--test/suite/test_cursor_random.py9
-rw-r--r--test/suite/test_drop.py5
-rw-r--r--test/suite/test_dupc.py5
-rw-r--r--test/suite/test_empty.py5
-rw-r--r--test/suite/test_excl.py5
-rw-r--r--test/suite/test_overwrite.py6
-rw-r--r--test/suite/test_perf001.py5
-rw-r--r--test/suite/test_rename.py5
-rw-r--r--test/suite/test_schema02.py5
-rw-r--r--test/suite/test_schema03.py6
-rw-r--r--test/suite/test_truncate01.py10
-rw-r--r--test/suite/test_txn01.py5
-rw-r--r--test/suite/test_txn03.py6
-rw-r--r--test/suite/test_upgrade.py5
-rw-r--r--test/suite/test_util02.py7
-rw-r--r--test/suite/test_util03.py5
-rw-r--r--test/suite/wtscenario.py13
-rw-r--r--test/suite/wttest.py2
-rw-r--r--test/windows/windows_shim.c7
-rw-r--r--tools/wtstats/stat_data.py6
87 files changed, 643 insertions, 429 deletions
diff --git a/SConstruct b/SConstruct
index 5c4b90992f2..8e9fae28ac6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -68,7 +68,11 @@ var.Add('CFLAGS', 'C Compiler Flags', [
"/wd4090", # Ignore warning about mismatched const qualifiers
"/wd4996", # Ignore deprecated functions
"/W3", # Warning level 3
+ #"/we4244", # Possible loss of data
"/we4013", # Error on undefined functions
+ #"/we4047", # Indirection differences in types
+ #"/we4024", # Differences in parameter types
+ #"/we4100", # Unreferenced local parameter
"/TC", # Compile as C code
#"/Od", # Disable optimization
"/Ob1", # inline expansion
@@ -76,7 +80,7 @@ var.Add('CFLAGS', 'C Compiler Flags', [
"/GF", # enable string pooling
"/EHsc", # extern "C" does not throw
#"/RTC1", # enable stack checks
- "/GS", # enable secrutiy checks
+ "/GS", # enable security checks
"/Gy", # separate functions for linker
"/Zc:wchar_t",
"/Gd",
@@ -97,6 +101,8 @@ var.Add('TOOLS', 'SCons tools', [
"textfile"
])
+var.Add('SWIG', 'SWIG binary location', swig_binary)
+
env = Environment(
variables = var
)
diff --git a/dist/s_string.ok b/dist/s_string.ok
index 86004e3d314..587cef16c51 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -423,6 +423,7 @@ autoheader
bInheritHandle
basecfg
bdb
+beginthreadex
bigram
bitcnt
bitfield
@@ -918,6 +919,7 @@ qsort
quartile
qup
rS
+rb
rbrace
rbracket
rdlock
@@ -1162,6 +1164,7 @@ vtype
vunpack
vupdate
walk's
+wb
wiredtiger
workFactor
wrapup
diff --git a/dist/stat_data.py b/dist/stat_data.py
index 8768a24700b..f133ab899ea 100644
--- a/dist/stat_data.py
+++ b/dist/stat_data.py
@@ -148,8 +148,17 @@ connection_stats = [
'tracked dirty bytes in the cache', 'no_clear,no_scale'),
CacheStat('cache_bytes_inuse',
'bytes currently in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_internal',
+ 'tracked bytes belonging to internal pages in the cache',
+ 'no_clear,no_scale'),
+ CacheStat('cache_bytes_leaf',
+ 'tracked bytes belonging to leaf pages in the cache',
+ 'no_clear,no_scale'),
CacheStat('cache_bytes_max',
'maximum bytes configured', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_overflow',
+ 'tracked bytes belonging to overflow pages in the cache',
+ 'no_clear,no_scale'),
CacheStat('cache_bytes_read', 'bytes read into cache'),
CacheStat('cache_bytes_write', 'bytes written from cache'),
CacheStat('cache_eviction_app', 'pages evicted by application threads'),
diff --git a/ext/compressors/lz4/lz4_compress.c b/ext/compressors/lz4/lz4_compress.c
index 4c27975f235..e6b8219aafb 100644
--- a/ext/compressors/lz4/lz4_compress.c
+++ b/ext/compressors/lz4/lz4_compress.c
@@ -84,7 +84,7 @@ wt_lz4_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (wt_lz4_error(compressor, session,
"LZ4 compress buffer too small", 0));
- /* Store the length of the compressed block in the first 8 bytes */
+ /* Store the length of the compressed block in the first 8 bytes. */
lz4buf = (char *)dst + sizeof(size_t);
lz4_len = (size_t)LZ4_compress((const char *)src, lz4buf, (int)src_len);
@@ -126,7 +126,7 @@ wt_lz4_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
wt_api = ((LZ4_COMPRESSOR *)compressor)->wt_api;
- /* Retrieve compressed length from start of the data buffer */
+ /* Retrieve compressed length from start of the data buffer. */
src_data_len = *(size_t *)src;
if (src_data_len + sizeof(size_t) > src_len) {
(void)wt_api->err_printf(wt_api,
@@ -135,15 +135,17 @@ wt_lz4_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (WT_ERROR);
}
- /* Skip over the data size to the start of compressed data */
+ /* Skip over the data size to the start of compressed data. */
compressed_data = (char *)src + sizeof(size_t);
/*
* The destination buffer length should always be sufficient because
- * wiredtiger keeps track of the byte count before compression
+ * wiredtiger keeps track of the byte count before compression. Use
+ * safe decompression: we may be relying on decompression to detect
+ * corruption.
*/
- decoded =
- LZ4_decompress_fast(compressed_data, (char *)dst, (int)dst_len);
+ decoded = LZ4_decompress_safe(
+ compressed_data, (char *)dst, (int)src_data_len, (int)dst_len);
if (decoded < 0)
return (wt_lz4_error(compressor, session,
diff --git a/ext/compressors/zlib/zlib_compress.c b/ext/compressors/zlib/zlib_compress.c
index 8cf8ab4792e..0d843fd7626 100644
--- a/ext/compressors/zlib/zlib_compress.c
+++ b/ext/compressors/zlib/zlib_compress.c
@@ -180,6 +180,48 @@ zlib_find_slot(uint32_t target, uint32_t *offsets, uint32_t slots)
}
/*
+ * zlib_decompress --
+ * WiredTiger zlib decompression.
+ */
+static int
+zlib_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
+ uint8_t *src, size_t src_len,
+ uint8_t *dst, size_t dst_len,
+ size_t *result_lenp)
+{
+ ZLIB_OPAQUE opaque;
+ z_stream zs;
+ int ret, tret;
+
+ memset(&zs, 0, sizeof(zs));
+ zs.zalloc = zalloc;
+ zs.zfree = zfree;
+ opaque.compressor = compressor;
+ opaque.session = session;
+ zs.opaque = &opaque;
+
+ if ((ret = inflateInit(&zs)) != Z_OK)
+ return (zlib_error(compressor, session, "inflateInit", ret));
+
+ zs.next_in = src;
+ zs.avail_in = (uint32_t)src_len;
+ zs.next_out = dst;
+ zs.avail_out = (uint32_t)dst_len;
+ while ((ret = inflate(&zs, Z_FINISH)) == Z_OK)
+ ;
+ if (ret == Z_STREAM_END) {
+ *result_lenp = zs.total_out;
+ ret = Z_OK;
+ }
+
+ if ((tret = inflateEnd(&zs)) != Z_OK && ret == Z_OK)
+ ret = tret;
+
+ return (ret == Z_OK ?
+ 0 : zlib_error(compressor, session, "inflate", ret));
+}
+
+/*
* zlib_compress_raw --
* Pack records into a specified on-disk page size.
*/
@@ -287,6 +329,27 @@ zlib_compress_raw(WT_COMPRESSOR *compressor, WT_SESSION *session,
}
#if 0
+ /* Decompress the result and confirm it matches the original source. */
+ if (last_slot > 0) {
+ void *decomp;
+ size_t result_len;
+
+ if ((decomp =
+ zalloc(&opaque, 1, (uint32_t)zs.total_in + 100)) == NULL)
+ return (ENOMEM);
+ if ((ret = zlib_decompress(compressor, session, dst,
+ zs.total_out, decomp, zs.total_in + 100, &result_len)) == 0)
+ if (memcmp(src, decomp, result_len) != 0)
+ ret = zlib_error(compressor, session,
+ "deflate compare with original source",
+ Z_DATA_ERROR);
+ zfree(&opaque, decomp);
+ if (ret != 0)
+ return (ret);
+ }
+#endif
+
+#if 0
fprintf(stderr,
"zlib_compress_raw (%s): page_max %" PRIuMAX ", slots %" PRIu32
", take %" PRIu32 ": %" PRIu32 " -> %" PRIuMAX "\n",
@@ -297,48 +360,6 @@ zlib_compress_raw(WT_COMPRESSOR *compressor, WT_SESSION *session,
}
/*
- * zlib_decompress --
- * WiredTiger zlib decompression.
- */
-static int
-zlib_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
- uint8_t *src, size_t src_len,
- uint8_t *dst, size_t dst_len,
- size_t *result_lenp)
-{
- ZLIB_OPAQUE opaque;
- z_stream zs;
- int ret, tret;
-
- memset(&zs, 0, sizeof(zs));
- zs.zalloc = zalloc;
- zs.zfree = zfree;
- opaque.compressor = compressor;
- opaque.session = session;
- zs.opaque = &opaque;
-
- if ((ret = inflateInit(&zs)) != Z_OK)
- return (zlib_error(compressor, session, "inflateInit", ret));
-
- zs.next_in = src;
- zs.avail_in = (uint32_t)src_len;
- zs.next_out = dst;
- zs.avail_out = (uint32_t)dst_len;
- while ((ret = inflate(&zs, Z_FINISH)) == Z_OK)
- ;
- if (ret == Z_STREAM_END) {
- *result_lenp = zs.total_out;
- ret = Z_OK;
- }
-
- if ((tret = inflateEnd(&zs)) != Z_OK && ret == Z_OK)
- ret = tret;
-
- return (ret == Z_OK ?
- 0 : zlib_error(compressor, session, "inflate", ret));
-}
-
-/*
* zlib_terminate --
* WiredTiger zlib compression termination.
*/
diff --git a/lang/java/Makefile.am b/lang/java/Makefile.am
index 94a7cb2702d..e6e6f748837 100644
--- a/lang/java/Makefile.am
+++ b/lang/java/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/include
JAVADEST = src/com/wiredtiger/db
JAVADESTFULL = $(srcdir)/$(JAVADEST)
diff --git a/lang/python/setup.py b/lang/python/setup.py
index 28bbe4d07e8..9eb57d55b5c 100644
--- a/lang/python/setup.py
+++ b/lang/python/setup.py
@@ -36,7 +36,7 @@ if not 'ARCHFLAGS' in os.environ:
os.environ['ARCHFLAGS'] = ''
# Suppress warnings building SWIG generated code
-extra_cflags = [ '-w' ]
+extra_cflags = [ '-w', '-I../../src/include']
dir = os.path.dirname(__file__)
diff --git a/src/async/async_worker.c b/src/async/async_worker.c
index ec68598b8c8..543046f7a0c 100644
--- a/src/async/async_worker.c
+++ b/src/async/async_worker.c
@@ -75,7 +75,8 @@ retry:
*/
my_slot = my_consume % async->async_qsize;
prev_slot = last_consume % async->async_qsize;
- *op = WT_ATOMIC_STORE8(async->async_queue[my_slot], NULL);
+ *op = (WT_ASYNC_OP_IMPL*)WT_ATOMIC_STORE8(
+ async->async_queue[my_slot], NULL);
WT_ASSERT(session, async->cur_queue > 0);
WT_ASSERT(session, *op != NULL);
@@ -278,10 +279,10 @@ __async_worker_op(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op,
}
/*
- * __async_worker --
+ * __wt_async_worker --
* The async worker threads.
*/
-void *
+WT_THREAD_RET
__wt_async_worker(void *arg)
{
WT_ASYNC *async;
@@ -354,5 +355,5 @@ err: WT_PANIC_MSG(session, ret, "async worker error");
__wt_free(session, ac);
ac = acnext;
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c
index 2f6b455c4f3..fa7cff35e5f 100644
--- a/src/btree/bt_debug.c
+++ b/src/btree/bt_debug.c
@@ -99,7 +99,7 @@ __debug_config(WT_SESSION_IMPL *session, WT_DBG *ds, const char *ofile)
return (__wt_scr_alloc(session, 512, &ds->msg));
/* If we're using a file, flush on each line. */
- WT_RET(__wt_fopen(session, ofile, "w", 0, &ds->fp));
+ WT_RET(__wt_fopen(session, ofile, WT_FHANDLE_WRITE, 0, &ds->fp));
(void)setvbuf(ds->fp, NULL, _IOLBF, 0);
return (0);
@@ -131,7 +131,7 @@ __dmsg_wrapup(WT_DBG *ds)
}
/* Close any file we opened. */
- (void)__wt_fclose(session, &ds->fp, 1);
+ (void)__wt_fclose(session, &ds->fp, WT_FHANDLE_WRITE);
}
/*
diff --git a/src/btree/bt_huffman.c b/src/btree/bt_huffman.c
index 6bba0c56369..6604bd9c9e1 100644
--- a/src/btree/bt_huffman.c
+++ b/src/btree/bt_huffman.c
@@ -157,11 +157,12 @@ __huffman_confchk_file(
/* Check the file exists. */
WT_RET(__wt_strndup(session, v->str + len, v->len - len, &fname));
- WT_ERR(__wt_fopen(session, fname, "r", WT_FOPEN_FIXED, &fp));
+ WT_ERR(__wt_fopen(session,
+ fname, WT_FHANDLE_READ, WT_FOPEN_FIXED, &fp));
/* Optionally return the file handle. */
if (fpp == NULL)
- (void)__wt_fclose(session, &fp, 0);
+ (void)__wt_fclose(session, &fp, WT_FHANDLE_READ);
else
*fpp = fp;
@@ -367,7 +368,7 @@ __wt_huffman_read(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *ip,
if (0) {
err: __wt_free(session, table);
}
- (void)__wt_fclose(session, &fp, 0);
+ (void)__wt_fclose(session, &fp, WT_FHANDLE_READ);
return (ret);
}
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c
index 6f0d4946aa5..ba1802116d0 100644
--- a/src/btree/bt_slvg.c
+++ b/src/btree/bt_slvg.c
@@ -124,7 +124,7 @@ static int __slvg_col_range_overlap(
WT_SESSION_IMPL *, uint32_t, uint32_t, WT_STUFF *);
static void __slvg_col_trk_update_start(uint32_t, WT_STUFF *);
static int __slvg_merge_block_free(WT_SESSION_IMPL *, WT_STUFF *);
-static int __slvg_ovfl_compare(const void *, const void *);
+static int WT_CDECL __slvg_ovfl_compare(const void *, const void *);
static int __slvg_ovfl_discard(WT_SESSION_IMPL *, WT_STUFF *);
static int __slvg_ovfl_reconcile(WT_SESSION_IMPL *, WT_STUFF *);
static int __slvg_ovfl_ref(WT_SESSION_IMPL *, WT_TRACK *, int);
@@ -140,9 +140,9 @@ static int __slvg_row_range_overlap(
WT_SESSION_IMPL *, uint32_t, uint32_t, WT_STUFF *);
static int __slvg_row_trk_update_start(
WT_SESSION_IMPL *, WT_ITEM *, uint32_t, WT_STUFF *);
-static int __slvg_trk_compare_addr(const void *, const void *);
-static int __slvg_trk_compare_gen(const void *, const void *);
-static int __slvg_trk_compare_key(const void *, const void *);
+static int WT_CDECL __slvg_trk_compare_addr(const void *, const void *);
+static int WT_CDECL __slvg_trk_compare_gen(const void *, const void *);
+static int WT_CDECL __slvg_trk_compare_key(const void *, const void *);
static int __slvg_trk_free(WT_SESSION_IMPL *, WT_TRACK **, int);
static void __slvg_trk_free_addr(WT_SESSION_IMPL *, WT_TRACK *);
static int __slvg_trk_init(WT_SESSION_IMPL *, uint8_t *,
@@ -2098,7 +2098,7 @@ __slvg_row_ovfl(WT_SESSION_IMPL *session,
* __slvg_trk_compare_addr --
* Compare two WT_TRACK array entries by address cookie.
*/
-static int
+static int WT_CDECL
__slvg_trk_compare_addr(const void *a, const void *b)
{
WT_DECL_RET;
@@ -2124,7 +2124,7 @@ __slvg_trk_compare_addr(const void *a, const void *b)
* __slvg_ovfl_compare --
* Bsearch comparison routine for the overflow array.
*/
-static int
+static int WT_CDECL
__slvg_ovfl_compare(const void *a, const void *b)
{
WT_ADDR *addr;
@@ -2163,6 +2163,7 @@ __slvg_ovfl_reconcile(WT_SESSION_IMPL *session, WT_STUFF *ss)
* with the lowest LSNs until overflow pages are only referenced once.
*
* This requires sorting the page list by LSN, and the overflow array
+
* by address cookie.
*/
qsort(ss->pages,
@@ -2246,7 +2247,7 @@ err: __wt_free(session, slot);
* __slvg_trk_compare_key --
* Compare two WT_TRACK array entries by key, and secondarily, by LSN.
*/
-static int
+static int WT_CDECL
__slvg_trk_compare_key(const void *a, const void *b)
{
WT_SESSION_IMPL *session;
@@ -2303,7 +2304,7 @@ __slvg_trk_compare_key(const void *a, const void *b)
* __slvg_trk_compare_gen --
* Compare two WT_TRACK array entries by LSN.
*/
-static int
+static int WT_CDECL
__slvg_trk_compare_gen(const void *a, const void *b)
{
WT_TRACK *a_trk, *b_trk;
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c
index 9f9a7cae893..dae2dd8d480 100644
--- a/src/btree/bt_sync.c
+++ b/src/btree/bt_sync.c
@@ -156,8 +156,7 @@ __sync_file(WT_SESSION_IMPL *session, int syncop)
}
if (WT_PAGE_IS_INTERNAL(page)) {
- internal_bytes +=
- page->memory_footprint;
+ internal_bytes += page->memory_footprint;
++internal_pages;
} else {
leaf_bytes += page->memory_footprint;
diff --git a/src/config/config_collapse.c b/src/config/config_collapse.c
index f54e4fc2074..23cb03c9b3a 100644
--- a/src/config/config_collapse.c
+++ b/src/config/config_collapse.c
@@ -314,7 +314,7 @@ err: __wt_scr_free(session, &build);
* __config_merge_cmp --
* Qsort function: sort the config merge array.
*/
-static int
+static int WT_CDECL
__config_merge_cmp(const void *a, const void *b)
{
WT_CONFIG_MERGE_ENTRY *ae, *be;
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c
index 179f1cbb29f..b41cad25914 100644
--- a/src/conn/conn_api.c
+++ b/src/conn/conn_api.c
@@ -1494,7 +1494,8 @@ __conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
if (exist)
return (0);
- WT_RET(__wt_fopen(session, WT_BASECONFIG_SET, "w", 0, &fp));
+ WT_RET(__wt_fopen(session,
+ WT_BASECONFIG_SET, WT_FHANDLE_WRITE, 0, &fp));
fprintf(fp, "%s\n\n",
"# Do not modify this file.\n"
@@ -1551,7 +1552,7 @@ __conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
session, &fp, WT_BASECONFIG_SET, WT_BASECONFIG));
/* Close any file handle left open, remove any temporary file. */
-err: WT_TRET(__wt_fclose(session, &fp, 1));
+err: WT_TRET(__wt_fclose(session, &fp, WT_FHANDLE_WRITE));
WT_TRET(__wt_remove_if_exists(session, WT_BASECONFIG_SET));
return (ret);
diff --git a/src/conn/conn_cache.c b/src/conn/conn_cache.c
index 4a7e15044de..a99e6d3ad20 100644
--- a/src/conn/conn_cache.c
+++ b/src/conn/conn_cache.c
@@ -190,6 +190,12 @@ __wt_cache_stats_update(WT_SESSION_IMPL *session)
WT_STAT_SET(stats,
cache_eviction_maximum_page_size, cache->evict_max_page_size);
WT_STAT_SET(stats, cache_pages_dirty, cache->pages_dirty);
+
+ /* Figure out internal, leaf and overflow stats */
+ WT_STAT_SET(stats, cache_bytes_internal, cache->bytes_internal);
+ WT_STAT_SET(stats, cache_bytes_leaf,
+ conn->cache_size - (cache->bytes_internal + cache->bytes_overflow));
+ WT_STAT_SET(stats, cache_bytes_overflow, cache->bytes_overflow);
}
/*
diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c
index 7bf090496a8..488864ce351 100644
--- a/src/conn/conn_cache_pool.c
+++ b/src/conn/conn_cache_pool.c
@@ -596,7 +596,7 @@ __cache_pool_adjust(WT_SESSION_IMPL *session,
* __wt_cache_pool_server --
* Thread to manage cache pool among connections.
*/
-void *
+WT_THREAD_RET
__wt_cache_pool_server(void *arg)
{
WT_CACHE *cache;
@@ -642,5 +642,5 @@ __wt_cache_pool_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "cache pool manager server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
diff --git a/src/conn/conn_ckpt.c b/src/conn/conn_ckpt.c
index 503c22110f9..74f27d8bd18 100644
--- a/src/conn/conn_ckpt.c
+++ b/src/conn/conn_ckpt.c
@@ -69,7 +69,7 @@ err: __wt_scr_free(session, &tmp);
* __ckpt_server --
* The checkpoint server thread.
*/
-static void *
+static WT_THREAD_RET
__ckpt_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -112,7 +112,7 @@ __ckpt_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "checkpoint server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index e28f18a6fa5..63180d64019 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -361,8 +361,7 @@ err: __wt_free(session, metaconf);
* Open the current btree handle.
*/
static int
-__conn_btree_open(
- WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags)
+__conn_btree_open(WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags)
{
WT_BTREE *btree;
WT_DATA_HANDLE *dhandle;
@@ -745,7 +744,8 @@ __wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final)
* Kludge: interrupt the eviction server in case it is holding the
* handle list lock.
*/
- F_SET(S2C(session)->cache, WT_CACHE_CLEAR_WALKS);
+ if (!F_ISSET(session, WT_SESSION_HANDLE_LIST_LOCKED))
+ F_SET(S2C(session)->cache, WT_CACHE_CLEAR_WALKS);
/* Try to remove the handle, protected by the data handle lock. */
WT_WITH_DHANDLE_LOCK(session,
diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c
index 4b995114b09..a6d53134ec2 100644
--- a/src/conn/conn_log.c
+++ b/src/conn/conn_log.c
@@ -273,7 +273,7 @@ err:
* __log_close_server --
* The log close server thread.
*/
-static void *
+static WT_THREAD_RET
__log_close_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -332,7 +332,7 @@ err: __wt_err(session, ret, "log close server error");
}
if (locked)
__wt_spin_unlock(session, &log->log_sync_lock);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
@@ -347,7 +347,7 @@ typedef struct {
* __log_wrlsn_cmp --
* The log wrlsn comparison function for qsort.
*/
-static int
+static int WT_CDECL
__log_wrlsn_cmp(const void *a, const void *b)
{
WT_LOG_WRLSN_ENTRY *ae, *be;
@@ -361,7 +361,7 @@ __log_wrlsn_cmp(const void *a, const void *b)
* __log_wrlsn_server --
* The log wrlsn server thread.
*/
-static void *
+static WT_THREAD_RET
__log_wrlsn_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -450,14 +450,14 @@ __log_wrlsn_server(void *arg)
if (0)
err: __wt_err(session, ret, "log wrlsn server error");
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
* __log_server --
* The log server thread.
*/
-static void *
+static WT_THREAD_RET
__log_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -502,7 +502,7 @@ err: __wt_err(session, ret, "log server error");
}
if (locked)
(void)__wt_writeunlock(session, log->log_archive_lock);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c
index af574a41858..0d008939d8c 100644
--- a/src/conn/conn_stat.c
+++ b/src/conn/conn_stat.c
@@ -300,11 +300,11 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp)
if ((log_file = conn->stat_fp) == NULL ||
path == NULL || strcmp(tmp->mem, path->mem) != 0) {
conn->stat_fp = NULL;
- WT_RET(__wt_fclose(session, &log_file, 1));
+ WT_RET(__wt_fclose(session, &log_file, WT_FHANDLE_APPEND));
if (path != NULL)
(void)strcpy(path->mem, tmp->mem);
- WT_RET(__wt_fopen(
- session, tmp->mem, "a", WT_FOPEN_FIXED, &log_file));
+ WT_RET(__wt_fopen(session,
+ tmp->mem, WT_FHANDLE_APPEND, WT_FOPEN_FIXED, &log_file));
}
conn->stat_fp = log_file;
@@ -380,7 +380,7 @@ err: __wt_scr_free(session, &tmp);
* __statlog_server --
* The statistics server thread.
*/
-static void *
+static WT_THREAD_RET
__statlog_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -419,7 +419,7 @@ err: WT_PANIC_MSG(session, ret, "statistics log server error");
}
__wt_buf_free(session, &path);
__wt_buf_free(session, &tmp);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
@@ -529,7 +529,7 @@ __wt_statlog_destroy(WT_SESSION_IMPL *session, int is_close)
conn->stat_session = NULL;
conn->stat_tid_set = 0;
conn->stat_format = NULL;
- WT_TRET(__wt_fclose(session, &conn->stat_fp, 1));
+ WT_TRET(__wt_fclose(session, &conn->stat_fp, WT_FHANDLE_APPEND));
conn->stat_path = NULL;
conn->stat_sources = NULL;
conn->stat_stamp = NULL;
diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c
index d788060ab17..8c82803f608 100644
--- a/src/conn/conn_sweep.c
+++ b/src/conn/conn_sweep.c
@@ -9,6 +9,42 @@
#include "wt_internal.h"
/*
+ * __sweep_remove_handles --
+ * Remove closed dhandles from the connection list.
+ */
+static int
+__sweep_remove_handles(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+ WT_DATA_HANDLE *dhandle, *dhandle_next;
+ WT_DECL_RET;
+
+ conn = S2C(session);
+ dhandle = SLIST_FIRST(&conn->dhlh);
+
+ for (; dhandle != NULL; dhandle = dhandle_next) {
+ dhandle_next = SLIST_NEXT(dhandle, l);
+ if (WT_IS_METADATA(dhandle))
+ continue;
+
+ /*
+ * If there are no longer any references to the handle in any
+ * sessions, attempt to discard it.
+ */
+ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ dhandle->session_inuse != 0 || dhandle->session_ref != 0)
+ continue;
+
+ WT_WITH_DHANDLE(session, dhandle,
+ ret = __wt_conn_dhandle_discard_single(session, 0));
+ WT_RET_BUSY_OK(ret);
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_ref);
+ }
+
+ return (ret);
+}
+
+/*
* __sweep --
* Close unused dhandles on the connection dhandle list.
*/
@@ -17,22 +53,26 @@ __sweep(WT_SESSION_IMPL *session)
{
WT_BTREE *btree;
WT_CONNECTION_IMPL *conn;
- WT_DATA_HANDLE *dhandle, *dhandle_next;
+ WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
time_t now;
- int locked;
+ int closed_handles;
conn = S2C(session);
+ closed_handles = 0;
/* Don't discard handles that have been open recently. */
WT_RET(__wt_seconds(session, &now));
WT_STAT_FAST_CONN_INCR(session, dh_conn_sweeps);
- dhandle = SLIST_FIRST(&conn->dhlh);
- for (; dhandle != NULL; dhandle = dhandle_next) {
- dhandle_next = SLIST_NEXT(dhandle, l);
+ SLIST_FOREACH(dhandle, &conn->dhlh, l) {
if (WT_IS_METADATA(dhandle))
continue;
+ if (!F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
+ dhandle->session_inuse == 0 && dhandle->session_ref == 0) {
+ ++closed_handles;
+ continue;
+ }
if (dhandle->session_inuse != 0 ||
now <= dhandle->timeofdeath + conn->sweep_idle_time)
continue;
@@ -44,15 +84,13 @@ __sweep(WT_SESSION_IMPL *session)
/*
* We have a candidate for closing; if it's open, acquire an
- * exclusive lock on the handle and close it. We might be
- * blocking opens for a long time (over disk I/O), but the
- * handle was quiescent for awhile.
+ * exclusive lock on the handle and close it.
*
- * The close can fail if an update cannot be written (updates
- * in a no-longer-referenced file might not yet be globally
- * visible if sessions have disjoint sets of files open). If
- * the handle is busy, skip it, we'll retry the close the next
- * time, after the transaction state has progressed.
+ * The close would require I/O if an update cannot be written
+ * (updates in a no-longer-referenced file might not yet be
+ * globally visible if sessions have disjoint sets of files
+ * open). In that case, skip it: we'll retry the close the
+ * next time, after the transaction state has progressed.
*
* We don't set WT_DHANDLE_EXCLUSIVE deliberately, we want
* opens to block on us rather than returning an EBUSY error to
@@ -61,8 +99,6 @@ __sweep(WT_SESSION_IMPL *session)
if ((ret =
__wt_try_writelock(session, dhandle->rwlock)) == EBUSY)
continue;
- WT_RET(ret);
- locked = 1;
/* Only sweep clean trees where all updates are visible. */
btree = dhandle->handle;
@@ -74,35 +110,26 @@ __sweep(WT_SESSION_IMPL *session)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN)) {
WT_WITH_DHANDLE(session, dhandle, ret =
__wt_conn_btree_sync_and_close(session, 0, 0));
- if (ret != 0)
- goto unlock;
/* We closed the btree handle, bump the statistic. */
- WT_STAT_FAST_CONN_INCR(session, dh_conn_handles);
+ if (ret == 0)
+ WT_STAT_FAST_CONN_INCR(
+ session, dh_conn_handles);
}
- /*
- * If there are no longer any references to the handle in any
- * sessions, attempt to discard it. The called function
- * re-checks that the handle is not in use, which is why we
- * don't do any special handling of EBUSY returns above.
- */
- if (dhandle->session_inuse == 0 && dhandle->session_ref == 0) {
- WT_WITH_DHANDLE(session, dhandle,
- ret = __wt_conn_dhandle_discard_single(session, 0));
- if (ret != 0)
- goto unlock;
-
- /* If the handle was discarded, it isn't locked. */
- locked = 0;
- } else
- WT_STAT_FAST_CONN_INCR(session, dh_conn_ref);
-
-unlock: if (locked)
- WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
+ if (dhandle->session_inuse == 0 && dhandle->session_ref == 0)
+ ++closed_handles;
+unlock: WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
WT_RET_BUSY_OK(ret);
}
+
+ if (closed_handles) {
+ WT_WITH_DHANDLE_LOCK(session,
+ ret = __sweep_remove_handles(session));
+ WT_RET(ret);
+ }
+
return (0);
}
@@ -110,7 +137,7 @@ unlock: if (locked)
* __sweep_server --
* The handle sweep server thread.
*/
-static void *
+static WT_THREAD_RET
__sweep_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -136,7 +163,7 @@ __sweep_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "handle sweep server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c
index cd847e455c8..5b47c2c1a73 100644
--- a/src/cursor/cur_backup.c
+++ b/src/cursor/cur_backup.c
@@ -248,7 +248,7 @@ __backup_start(
* Close any hot backup file.
* We're about to open the incremental backup file.
*/
- WT_TRET(__wt_fclose(session, &cb->bfp, 1));
+ WT_TRET(__wt_fclose(session, &cb->bfp, WT_FHANDLE_WRITE));
WT_ERR(__backup_file_create(session, cb, log_only));
WT_ERR(__backup_list_append(
session, cb, WT_INCREMENTAL_BACKUP));
@@ -266,7 +266,7 @@ __backup_start(
}
err: /* Close the hot backup file. */
- WT_TRET(__wt_fclose(session, &cb->bfp, 1));
+ WT_TRET(__wt_fclose(session, &cb->bfp, WT_FHANDLE_WRITE));
if (ret != 0) {
WT_TRET(__backup_cleanup_handles(session, cb));
WT_TRET(__backup_stop(session));
@@ -456,7 +456,7 @@ __backup_file_create(
{
return (__wt_fopen(session,
incremental ? WT_INCREMENTAL_BACKUP : WT_METADATA_BACKUP,
- "w", 0, &cb->bfp));
+ WT_FHANDLE_WRITE, 0, &cb->bfp));
}
/*
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 2b5bd015223..62326015d2c 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -10,13 +10,13 @@
static int __evict_clear_walks(WT_SESSION_IMPL *);
static int __evict_has_work(WT_SESSION_IMPL *, uint32_t *);
-static int __evict_lru_cmp(const void *, const void *);
+static int WT_CDECL __evict_lru_cmp(const void *, const void *);
static int __evict_lru_pages(WT_SESSION_IMPL *, int);
static int __evict_lru_walk(WT_SESSION_IMPL *, uint32_t);
static int __evict_pass(WT_SESSION_IMPL *);
static int __evict_walk(WT_SESSION_IMPL *, uint32_t);
static int __evict_walk_file(WT_SESSION_IMPL *, u_int *, uint32_t);
-static void *__evict_worker(void *);
+static WT_THREAD_RET __evict_worker(void *);
static int __evict_server_work(WT_SESSION_IMPL *);
/*
@@ -54,7 +54,7 @@ __evict_read_gen(const WT_EVICT_ENTRY *entry)
* __evict_lru_cmp --
* Qsort function: sort the eviction array.
*/
-static int
+static int WT_CDECL
__evict_lru_cmp(const void *a, const void *b)
{
uint64_t a_lru, b_lru;
@@ -94,7 +94,7 @@ __wt_evict_list_clear_page(WT_SESSION_IMPL *session, WT_REF *ref)
WT_EVICT_ENTRY *evict;
uint32_t i, elem;
- WT_ASSERT(session,
+ WT_ASSERT(session,
__wt_ref_is_root(ref) || ref->state == WT_REF_LOCKED);
/* Fast path: if the page isn't on the queue, don't bother searching. */
@@ -150,7 +150,7 @@ __wt_evict_server_wake(WT_SESSION_IMPL *session)
* __evict_server --
* Thread to evict pages from the cache.
*/
-static void *
+static WT_THREAD_RET
__evict_server(void *arg)
{
WT_CACHE *cache;
@@ -232,7 +232,7 @@ __evict_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "cache eviction server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
@@ -384,7 +384,7 @@ __wt_evict_destroy(WT_SESSION_IMPL *session)
* __evict_worker --
* Thread to help evict pages from the cache.
*/
-static void *
+static WT_THREAD_RET
__evict_worker(void *arg)
{
WT_CACHE *cache;
@@ -413,7 +413,7 @@ __evict_worker(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "cache eviction worker error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/include/btree.i b/src/include/btree.i
index 6c261f3768d..7d9a3095a0c 100644
--- a/src/include/btree.i
+++ b/src/include/btree.i
@@ -55,6 +55,11 @@ __wt_cache_page_inmem_incr(WT_SESSION_IMPL *session, WT_PAGE *page, size_t size)
(void)WT_ATOMIC_ADD8(cache->bytes_dirty, size);
(void)WT_ATOMIC_ADD8(page->modify->bytes_dirty, size);
}
+ /* Track internal and overflow size in cache. */
+ if (WT_PAGE_IS_INTERNAL(page))
+ (void)WT_ATOMIC_ADD8(cache->bytes_internal, size);
+ else if (page->type == WT_PAGE_OVFL)
+ (void)WT_ATOMIC_ADD8(cache->bytes_overflow, size);
}
/*
@@ -148,6 +153,11 @@ __wt_cache_page_inmem_decr(WT_SESSION_IMPL *session, WT_PAGE *page, size_t size)
WT_CACHE_DECR(session, page->memory_footprint, size);
if (__wt_page_is_modified(page))
__wt_cache_page_byte_dirty_decr(session, page, size);
+ /* Track internal and overflow size in cache. */
+ if (WT_PAGE_IS_INTERNAL(page))
+ WT_CACHE_DECR(session, cache->bytes_internal, size);
+ else if (page->type == WT_PAGE_OVFL)
+ WT_CACHE_DECR(session, cache->bytes_overflow, size);
}
/*
diff --git a/src/include/cache.h b/src/include/cache.h
index 8ed3176492f..11f631416af 100644
--- a/src/include/cache.h
+++ b/src/include/cache.h
@@ -57,6 +57,8 @@ struct __wt_cache {
*/
uint64_t bytes_inmem; /* Bytes/pages in memory */
uint64_t pages_inmem;
+ uint64_t bytes_internal; /* Bytes of internal pages */
+ uint64_t bytes_overflow; /* Bytes of overflow pages */
uint64_t bytes_evict; /* Bytes/pages discarded by eviction */
uint64_t pages_evict;
uint64_t bytes_dirty; /* Bytes/pages currently dirty */
diff --git a/src/include/extern.h b/src/include/extern.h
index da6660dd3a6..676264b49eb 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -8,7 +8,7 @@ extern int __wt_async_flush(WT_SESSION_IMPL *session);
extern int __wt_async_new_op(WT_SESSION_IMPL *session, const char *uri, const char *config, const char *cfg[], WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP_IMPL **opp);
extern int __wt_async_op_enqueue(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op);
extern int __wt_async_op_init(WT_SESSION_IMPL *session);
-extern void *__wt_async_worker(void *arg);
+extern WT_THREAD_RET __wt_async_worker(void *arg);
extern int __wt_block_addr_to_buffer(WT_BLOCK *block, uint8_t **pp, wt_off_t offset, uint32_t size, uint32_t cksum);
extern int __wt_block_buffer_to_addr(WT_BLOCK *block, const uint8_t *p, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump);
extern int __wt_block_addr_valid(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, int live);
@@ -220,7 +220,7 @@ extern int __wt_cache_destroy(WT_SESSION_IMPL *session);
extern int __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg);
extern int __wt_conn_cache_pool_open(WT_SESSION_IMPL *session);
extern int __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session);
-extern void *__wt_cache_pool_server(void *arg);
+extern WT_THREAD_RET __wt_cache_pool_server(void *arg);
extern int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session);
extern int __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize);
@@ -490,13 +490,13 @@ extern int __wt_rename(WT_SESSION_IMPL *session, const char *from, const char *t
extern int __wt_read( WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size_t len, void *buf);
extern int __wt_write(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size_t len, const void *buf);
extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds);
-extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, const char *mode, u_int flags, FILE **fpp);
+extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, WT_FHANDLE_MODE mode_flag, u_int flags, FILE **fpp);
extern int __wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap);
extern int __wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4)));
extern int __wt_fflush(WT_SESSION_IMPL *session, FILE *fp);
-extern int __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, int iswrite);
+extern int __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag);
extern uint64_t __wt_strtouq(const char *nptr, char **endptr, int base);
-extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, void *(*func)(void *), void *arg);
+extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg);
extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid);
extern void __wt_thread_id(char *buf, size_t buflen);
extern int __wt_seconds(WT_SESSION_IMPL *session, time_t *timep);
@@ -654,7 +654,7 @@ extern void __wt_stat_refresh_dsrc_stats(void *stats_arg);
extern void __wt_stat_aggregate_dsrc_stats(const void *child, const void *parent);
extern void __wt_stat_init_connection_stats(WT_CONNECTION_STATS *stats);
extern void __wt_stat_refresh_connection_stats(void *stats_arg);
-extern int __wt_txnid_cmp(const void *v1, const void *v2);
+extern int WT_CDECL __wt_txnid_cmp(const void *v1, const void *v2);
extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session);
extern void __wt_txn_update_oldest(WT_SESSION_IMPL *session);
extern void __wt_txn_refresh(WT_SESSION_IMPL *session, int get_snapshot);
diff --git a/src/include/gcc.h b/src/include/gcc.h
index 805838eb84b..2efbb20b39a 100644
--- a/src/include/gcc.h
+++ b/src/include/gcc.h
@@ -6,6 +6,8 @@
* See the file LICENSE for redistribution information.
*/
+#define WT_SIZET_FMT "zu" /* size_t format string */
+
/* Add GCC-specific attributes to types and function declarations. */
#define WT_COMPILER_TYPE_ALIGN(x) __attribute__((aligned(x)))
diff --git a/src/include/lint.h b/src/include/lint.h
index 5668abc6dab..631f00cb5cd 100644
--- a/src/include/lint.h
+++ b/src/include/lint.h
@@ -6,6 +6,8 @@
* See the file LICENSE for redistribution information.
*/
+#define WT_SIZET_FMT "zu" /* size_t format string */
+
#define WT_COMPILER_TYPE_ALIGN(x)
#define WT_PACKED_STRUCT_BEGIN(name) \
diff --git a/src/include/misc.h b/src/include/misc.h
index 5e8122316a3..12cf2dec375 100644
--- a/src/include/misc.h
+++ b/src/include/misc.h
@@ -24,19 +24,6 @@
#define WT_EXABYTE ((uint64_t)1152921504606846976)
/*
- * Number of directory entries can grow dynamically.
- */
-#define WT_DIR_ENTRY 32
-
-#define WT_DIRLIST_EXCLUDE 0x1 /* Exclude files matching prefix */
-#define WT_DIRLIST_INCLUDE 0x2 /* Include files matching prefix */
-
-/*
- * FILE handle open configuration.
- */
-#define WT_FOPEN_FIXED 0x1 /* Path isn't relative to home */
-
-/*
* Sizes that cannot be larger than 2**32 are stored in uint32_t fields in
* common structures to save space. To minimize conversions from size_t to
* uint32_t through the code, we use the following macros.
diff --git a/src/include/msvc.h b/src/include/msvc.h
index 3ec74b2d629..fa5b2d848e8 100644
--- a/src/include/msvc.h
+++ b/src/include/msvc.h
@@ -13,6 +13,8 @@
#define inline __inline
+#define WT_SIZET_FMT "Iu" /* size_t format string */
+
/*
* Add MSVC-specific attributes and pragmas to types and function declarations.
*/
diff --git a/src/include/os.h b/src/include/os.h
index acbc77409c3..ba5d95657d5 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -6,6 +6,37 @@
* See the file LICENSE for redistribution information.
*/
+/*
+ * FILE handle close/open configuration.
+ */
+typedef enum {
+ WT_FHANDLE_APPEND, WT_FHANDLE_READ, WT_FHANDLE_WRITE
+} WT_FHANDLE_MODE;
+
+#ifdef _WIN32
+/*
+ * Open in binary (untranslated) mode; translations involving carriage-return
+ * and linefeed characters are suppressed.
+ */
+#define WT_FOPEN_APPEND "ab"
+#define WT_FOPEN_READ "rb"
+#define WT_FOPEN_WRITE "wb"
+#else
+#define WT_FOPEN_APPEND "a"
+#define WT_FOPEN_READ "r"
+#define WT_FOPEN_WRITE "w"
+#endif
+
+#define WT_FOPEN_FIXED 0x1 /* Path isn't relative to home */
+
+/*
+ * Number of directory entries can grow dynamically.
+ */
+#define WT_DIR_ENTRY 32
+
+#define WT_DIRLIST_EXCLUDE 0x1 /* Exclude files matching prefix */
+#define WT_DIRLIST_INCLUDE 0x2 /* Include files matching prefix */
+
#define WT_SYSCALL_RETRY(call, ret) do { \
int __retry; \
for (__retry = 0; __retry < 10; ++__retry) { \
@@ -72,9 +103,3 @@ struct __wt_fh {
WT_FALLOCATE_SYS } fallocate_available;
int fallocate_requires_locking;
};
-
-#ifndef _WIN32
-#define WT_SIZET_FMT "zu" /* size_t format string */
-#else
-#define WT_SIZET_FMT "Iu" /* size_t format string */
-#endif
diff --git a/src/include/os_windows.h b/src/include/os_windows.h
index a9c1cf5f65a..49cf4d2a126 100644
--- a/src/include/os_windows.h
+++ b/src/include/os_windows.h
@@ -14,6 +14,18 @@ typedef CONDITION_VARIABLE wt_cond_t;
typedef CRITICAL_SECTION wt_mutex_t;
typedef HANDLE wt_thread_t;
+/*
+ * Thread callbacks need to match the return signature of _beginthreadex.
+ */
+#define WT_THREAD_CALLBACK(x) unsigned (__stdcall x)
+#define WT_THREAD_RET unsigned __stdcall
+#define WT_THREAD_RET_VALUE 0
+
+/*
+ * WT declaration for calling convention type
+ */
+#define WT_CDECL __cdecl
+
#if _MSC_VER < 1900
/* Timespec is a POSIX structure not defined in Windows */
struct timespec {
@@ -29,7 +41,7 @@ struct timespec {
*/
typedef uint32_t u_int;
typedef unsigned char u_char;
-typedef unsigned long u_long;
+typedef uint64_t u_long;
/* <= VS 2013 is not C99 compat */
#if _MSC_VER < 1900
diff --git a/src/include/posix.h b/src/include/posix.h
index 14249e3ed37..1aa629c98e7 100644
--- a/src/include/posix.h
+++ b/src/include/posix.h
@@ -26,3 +26,15 @@
typedef pthread_cond_t wt_cond_t;
typedef pthread_mutex_t wt_mutex_t;
typedef pthread_t wt_thread_t;
+
+/*
+ * Thread callbacks need to match the platform specific callback types
+ */
+#define WT_THREAD_CALLBACK(x) void* (x)
+#define WT_THREAD_RET void*
+#define WT_THREAD_RET_VALUE NULL
+
+/*
+ * WT declaration for calling convention type
+ */
+#define WT_CDECL
diff --git a/src/include/stat.h b/src/include/stat.h
index ffab3716f14..e04e645b3ea 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -153,8 +153,11 @@ struct __wt_connection_stats {
WT_STATS block_read;
WT_STATS block_write;
WT_STATS cache_bytes_dirty;
+ WT_STATS cache_bytes_internal;
WT_STATS cache_bytes_inuse;
+ WT_STATS cache_bytes_leaf;
WT_STATS cache_bytes_max;
+ WT_STATS cache_bytes_overflow;
WT_STATS cache_bytes_read;
WT_STATS cache_bytes_write;
WT_STATS cache_eviction_app;
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 608fc019131..bfd2641785f 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -3233,244 +3233,250 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
#define WT_STAT_CONN_BLOCK_WRITE 1019
/*! cache: tracked dirty bytes in the cache */
#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1020
+/*! cache: tracked bytes belonging to internal pages in the cache */
+#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1021
/*! cache: bytes currently in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_INUSE 1021
+#define WT_STAT_CONN_CACHE_BYTES_INUSE 1022
+/*! cache: tracked bytes belonging to leaf pages in the cache */
+#define WT_STAT_CONN_CACHE_BYTES_LEAF 1023
/*! cache: maximum bytes configured */
-#define WT_STAT_CONN_CACHE_BYTES_MAX 1022
+#define WT_STAT_CONN_CACHE_BYTES_MAX 1024
+/*! cache: tracked bytes belonging to overflow pages in the cache */
+#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1025
/*! cache: bytes read into cache */
-#define WT_STAT_CONN_CACHE_BYTES_READ 1023
+#define WT_STAT_CONN_CACHE_BYTES_READ 1026
/*! cache: bytes written from cache */
-#define WT_STAT_CONN_CACHE_BYTES_WRITE 1024
+#define WT_STAT_CONN_CACHE_BYTES_WRITE 1027
/*! cache: pages evicted by application threads */
-#define WT_STAT_CONN_CACHE_EVICTION_APP 1025
+#define WT_STAT_CONN_CACHE_EVICTION_APP 1028
/*! cache: checkpoint blocked page eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 1026
+#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 1029
/*! cache: unmodified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1027
+#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1030
/*! cache: page split during eviction deepened the tree */
-#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1028
+#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1031
/*! cache: modified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1029
+#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1032
/*! cache: pages selected for eviction unable to be evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1030
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1033
/*! cache: pages evicted because they exceeded the in-memory maximum */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1031
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1034
/*! cache: pages evicted because they had chains of deleted items */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1032
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1035
/*! cache: failed eviction of pages that exceeded the in-memory maximum */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1033
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1036
/*! cache: hazard pointer blocked page eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1034
+#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1037
/*! cache: internal pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1035
+#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1038
/*! cache: maximum page size at eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1036
+#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1039
/*! cache: eviction server candidate queue empty when topping up */
-#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1037
+#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1040
/*! cache: eviction server candidate queue not empty when topping up */
-#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1038
+#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1041
/*! cache: eviction server evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1039
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1042
/*! cache: eviction server populating queue, but not evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1040
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1043
/*! cache: eviction server unable to reach eviction goal */
-#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1041
+#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1044
/*! cache: pages split during eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_SPLIT 1042
+#define WT_STAT_CONN_CACHE_EVICTION_SPLIT 1045
/*! cache: pages walked for eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_WALK 1043
+#define WT_STAT_CONN_CACHE_EVICTION_WALK 1046
/*! cache: eviction worker thread evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1044
+#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1047
/*! cache: in-memory page splits */
-#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1045
+#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1048
/*! cache: percentage overhead */
-#define WT_STAT_CONN_CACHE_OVERHEAD 1046
+#define WT_STAT_CONN_CACHE_OVERHEAD 1049
/*! cache: tracked dirty pages in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1047
+#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1050
/*! cache: pages currently held in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_INUSE 1048
+#define WT_STAT_CONN_CACHE_PAGES_INUSE 1051
/*! cache: pages read into cache */
-#define WT_STAT_CONN_CACHE_READ 1049
+#define WT_STAT_CONN_CACHE_READ 1052
/*! cache: pages written from cache */
-#define WT_STAT_CONN_CACHE_WRITE 1050
+#define WT_STAT_CONN_CACHE_WRITE 1053
/*! connection: pthread mutex condition wait calls */
-#define WT_STAT_CONN_COND_WAIT 1051
+#define WT_STAT_CONN_COND_WAIT 1054
/*! cursor: cursor create calls */
-#define WT_STAT_CONN_CURSOR_CREATE 1052
+#define WT_STAT_CONN_CURSOR_CREATE 1055
/*! cursor: cursor insert calls */
-#define WT_STAT_CONN_CURSOR_INSERT 1053
+#define WT_STAT_CONN_CURSOR_INSERT 1056
/*! cursor: cursor next calls */
-#define WT_STAT_CONN_CURSOR_NEXT 1054
+#define WT_STAT_CONN_CURSOR_NEXT 1057
/*! cursor: cursor prev calls */
-#define WT_STAT_CONN_CURSOR_PREV 1055
+#define WT_STAT_CONN_CURSOR_PREV 1058
/*! cursor: cursor remove calls */
-#define WT_STAT_CONN_CURSOR_REMOVE 1056
+#define WT_STAT_CONN_CURSOR_REMOVE 1059
/*! cursor: cursor reset calls */
-#define WT_STAT_CONN_CURSOR_RESET 1057
+#define WT_STAT_CONN_CURSOR_RESET 1060
/*! cursor: cursor search calls */
-#define WT_STAT_CONN_CURSOR_SEARCH 1058
+#define WT_STAT_CONN_CURSOR_SEARCH 1061
/*! cursor: cursor search near calls */
-#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1059
+#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1062
/*! cursor: cursor update calls */
-#define WT_STAT_CONN_CURSOR_UPDATE 1060
+#define WT_STAT_CONN_CURSOR_UPDATE 1063
/*! data-handle: connection dhandles swept */
-#define WT_STAT_CONN_DH_CONN_HANDLES 1061
+#define WT_STAT_CONN_DH_CONN_HANDLES 1064
/*! data-handle: connection candidate referenced */
-#define WT_STAT_CONN_DH_CONN_REF 1062
+#define WT_STAT_CONN_DH_CONN_REF 1065
/*! data-handle: connection sweeps */
-#define WT_STAT_CONN_DH_CONN_SWEEPS 1063
+#define WT_STAT_CONN_DH_CONN_SWEEPS 1066
/*! data-handle: connection time-of-death sets */
-#define WT_STAT_CONN_DH_CONN_TOD 1064
+#define WT_STAT_CONN_DH_CONN_TOD 1067
/*! data-handle: session dhandles swept */
-#define WT_STAT_CONN_DH_SESSION_HANDLES 1065
+#define WT_STAT_CONN_DH_SESSION_HANDLES 1068
/*! data-handle: session sweep attempts */
-#define WT_STAT_CONN_DH_SESSION_SWEEPS 1066
+#define WT_STAT_CONN_DH_SESSION_SWEEPS 1069
/*! connection: files currently open */
-#define WT_STAT_CONN_FILE_OPEN 1067
+#define WT_STAT_CONN_FILE_OPEN 1070
/*! log: log buffer size increases */
-#define WT_STAT_CONN_LOG_BUFFER_GROW 1068
+#define WT_STAT_CONN_LOG_BUFFER_GROW 1071
/*! log: total log buffer size */
-#define WT_STAT_CONN_LOG_BUFFER_SIZE 1069
+#define WT_STAT_CONN_LOG_BUFFER_SIZE 1072
/*! log: log bytes of payload data */
-#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1070
+#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1073
/*! log: log bytes written */
-#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1071
+#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1074
/*! log: yields waiting for previous log file close */
-#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1072
+#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1075
/*! log: total size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_LEN 1073
+#define WT_STAT_CONN_LOG_COMPRESS_LEN 1076
/*! log: total in-memory size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_MEM 1074
+#define WT_STAT_CONN_LOG_COMPRESS_MEM 1077
/*! log: log records too small to compress */
-#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1075
+#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1078
/*! log: log records not compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1076
+#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1079
/*! log: log records compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1077
+#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1080
/*! log: maximum log file size */
-#define WT_STAT_CONN_LOG_MAX_FILESIZE 1078
+#define WT_STAT_CONN_LOG_MAX_FILESIZE 1081
/*! log: pre-allocated log files prepared */
-#define WT_STAT_CONN_LOG_PREALLOC_FILES 1079
+#define WT_STAT_CONN_LOG_PREALLOC_FILES 1082
/*! log: number of pre-allocated log files to create */
-#define WT_STAT_CONN_LOG_PREALLOC_MAX 1080
+#define WT_STAT_CONN_LOG_PREALLOC_MAX 1083
/*! log: pre-allocated log files used */
-#define WT_STAT_CONN_LOG_PREALLOC_USED 1081
+#define WT_STAT_CONN_LOG_PREALLOC_USED 1084
/*! log: log read operations */
-#define WT_STAT_CONN_LOG_READS 1082
+#define WT_STAT_CONN_LOG_READS 1085
/*! log: log release advances write LSN */
-#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1083
+#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1086
/*! log: records processed by log scan */
-#define WT_STAT_CONN_LOG_SCAN_RECORDS 1084
+#define WT_STAT_CONN_LOG_SCAN_RECORDS 1087
/*! log: log scan records requiring two reads */
-#define WT_STAT_CONN_LOG_SCAN_REREADS 1085
+#define WT_STAT_CONN_LOG_SCAN_REREADS 1088
/*! log: log scan operations */
-#define WT_STAT_CONN_LOG_SCANS 1086
+#define WT_STAT_CONN_LOG_SCANS 1089
/*! log: consolidated slot closures */
-#define WT_STAT_CONN_LOG_SLOT_CLOSES 1087
+#define WT_STAT_CONN_LOG_SLOT_CLOSES 1090
/*! log: logging bytes consolidated */
-#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1088
+#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1091
/*! log: consolidated slot joins */
-#define WT_STAT_CONN_LOG_SLOT_JOINS 1089
+#define WT_STAT_CONN_LOG_SLOT_JOINS 1092
/*! log: consolidated slot join races */
-#define WT_STAT_CONN_LOG_SLOT_RACES 1090
+#define WT_STAT_CONN_LOG_SLOT_RACES 1093
/*! log: slots selected for switching that were unavailable */
-#define WT_STAT_CONN_LOG_SLOT_SWITCH_FAILS 1091
+#define WT_STAT_CONN_LOG_SLOT_SWITCH_FAILS 1094
/*! log: record size exceeded maximum */
-#define WT_STAT_CONN_LOG_SLOT_TOOBIG 1092
+#define WT_STAT_CONN_LOG_SLOT_TOOBIG 1095
/*! log: failed to find a slot large enough for record */
-#define WT_STAT_CONN_LOG_SLOT_TOOSMALL 1093
+#define WT_STAT_CONN_LOG_SLOT_TOOSMALL 1096
/*! log: consolidated slot join transitions */
-#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1094
+#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1097
/*! log: log sync operations */
-#define WT_STAT_CONN_LOG_SYNC 1095
+#define WT_STAT_CONN_LOG_SYNC 1098
/*! log: log sync_dir operations */
-#define WT_STAT_CONN_LOG_SYNC_DIR 1096
+#define WT_STAT_CONN_LOG_SYNC_DIR 1099
/*! log: log server thread advances write LSN */
-#define WT_STAT_CONN_LOG_WRITE_LSN 1097
+#define WT_STAT_CONN_LOG_WRITE_LSN 1100
/*! log: log write operations */
-#define WT_STAT_CONN_LOG_WRITES 1098
+#define WT_STAT_CONN_LOG_WRITES 1101
/*! LSM: sleep for LSM checkpoint throttle */
-#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1099
+#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1102
/*! LSM: sleep for LSM merge throttle */
-#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1100
+#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1103
/*! LSM: rows merged in an LSM tree */
-#define WT_STAT_CONN_LSM_ROWS_MERGED 1101
+#define WT_STAT_CONN_LSM_ROWS_MERGED 1104
/*! LSM: application work units currently queued */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_APP 1102
+#define WT_STAT_CONN_LSM_WORK_QUEUE_APP 1105
/*! LSM: merge work units currently queued */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_MANAGER 1103
+#define WT_STAT_CONN_LSM_WORK_QUEUE_MANAGER 1106
/*! LSM: tree queue hit maximum */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_MAX 1104
+#define WT_STAT_CONN_LSM_WORK_QUEUE_MAX 1107
/*! LSM: switch work units currently queued */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_SWITCH 1105
+#define WT_STAT_CONN_LSM_WORK_QUEUE_SWITCH 1108
/*! LSM: tree maintenance operations scheduled */
-#define WT_STAT_CONN_LSM_WORK_UNITS_CREATED 1106
+#define WT_STAT_CONN_LSM_WORK_UNITS_CREATED 1109
/*! LSM: tree maintenance operations discarded */
-#define WT_STAT_CONN_LSM_WORK_UNITS_DISCARDED 1107
+#define WT_STAT_CONN_LSM_WORK_UNITS_DISCARDED 1110
/*! LSM: tree maintenance operations executed */
-#define WT_STAT_CONN_LSM_WORK_UNITS_DONE 1108
+#define WT_STAT_CONN_LSM_WORK_UNITS_DONE 1111
/*! connection: memory allocations */
-#define WT_STAT_CONN_MEMORY_ALLOCATION 1109
+#define WT_STAT_CONN_MEMORY_ALLOCATION 1112
/*! connection: memory frees */
-#define WT_STAT_CONN_MEMORY_FREE 1110
+#define WT_STAT_CONN_MEMORY_FREE 1113
/*! connection: memory re-allocations */
-#define WT_STAT_CONN_MEMORY_GROW 1111
+#define WT_STAT_CONN_MEMORY_GROW 1114
/*! thread-yield: page acquire busy blocked */
-#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1112
+#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1115
/*! thread-yield: page acquire eviction blocked */
-#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1113
+#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1116
/*! thread-yield: page acquire locked blocked */
-#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1114
+#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1117
/*! thread-yield: page acquire read blocked */
-#define WT_STAT_CONN_PAGE_READ_BLOCKED 1115
+#define WT_STAT_CONN_PAGE_READ_BLOCKED 1118
/*! thread-yield: page acquire time sleeping (usecs) */
-#define WT_STAT_CONN_PAGE_SLEEP 1116
+#define WT_STAT_CONN_PAGE_SLEEP 1119
/*! connection: total read I/Os */
-#define WT_STAT_CONN_READ_IO 1117
+#define WT_STAT_CONN_READ_IO 1120
/*! reconciliation: page reconciliation calls */
-#define WT_STAT_CONN_REC_PAGES 1118
+#define WT_STAT_CONN_REC_PAGES 1121
/*! reconciliation: page reconciliation calls for eviction */
-#define WT_STAT_CONN_REC_PAGES_EVICTION 1119
+#define WT_STAT_CONN_REC_PAGES_EVICTION 1122
/*! reconciliation: split bytes currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1120
+#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1123
/*! reconciliation: split objects currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1121
+#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1124
/*! connection: pthread mutex shared lock read-lock calls */
-#define WT_STAT_CONN_RWLOCK_READ 1122
+#define WT_STAT_CONN_RWLOCK_READ 1125
/*! connection: pthread mutex shared lock write-lock calls */
-#define WT_STAT_CONN_RWLOCK_WRITE 1123
+#define WT_STAT_CONN_RWLOCK_WRITE 1126
/*! session: open cursor count */
-#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1124
+#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1127
/*! session: open session count */
-#define WT_STAT_CONN_SESSION_OPEN 1125
+#define WT_STAT_CONN_SESSION_OPEN 1128
/*! transaction: transaction begins */
-#define WT_STAT_CONN_TXN_BEGIN 1126
+#define WT_STAT_CONN_TXN_BEGIN 1129
/*! transaction: transaction checkpoints */
-#define WT_STAT_CONN_TXN_CHECKPOINT 1127
+#define WT_STAT_CONN_TXN_CHECKPOINT 1130
/*! transaction: transaction checkpoint generation */
-#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1128
+#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1131
/*! transaction: transaction checkpoint currently running */
-#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1129
+#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1132
/*! transaction: transaction checkpoint max time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1130
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1133
/*! transaction: transaction checkpoint min time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1131
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1134
/*! transaction: transaction checkpoint most recent time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1132
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1135
/*! transaction: transaction checkpoint total time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1133
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1136
/*! transaction: transactions committed */
-#define WT_STAT_CONN_TXN_COMMIT 1134
+#define WT_STAT_CONN_TXN_COMMIT 1137
/*! transaction: transaction failures due to cache overflow */
-#define WT_STAT_CONN_TXN_FAIL_CACHE 1135
+#define WT_STAT_CONN_TXN_FAIL_CACHE 1138
/*! transaction: transaction range of IDs currently pinned by a checkpoint */
-#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1136
+#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1139
/*! transaction: transaction range of IDs currently pinned */
-#define WT_STAT_CONN_TXN_PINNED_RANGE 1137
+#define WT_STAT_CONN_TXN_PINNED_RANGE 1140
/*! transaction: transactions rolled back */
-#define WT_STAT_CONN_TXN_ROLLBACK 1138
+#define WT_STAT_CONN_TXN_ROLLBACK 1141
/*! connection: total write I/Os */
-#define WT_STAT_CONN_WRITE_IO 1139
+#define WT_STAT_CONN_WRITE_IO 1142
/*!
* @}
diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c
index 75d3e8ef6e8..12b24984fcb 100644
--- a/src/lsm/lsm_manager.c
+++ b/src/lsm/lsm_manager.c
@@ -11,7 +11,7 @@
static int __lsm_manager_aggressive_update(WT_SESSION_IMPL *, WT_LSM_TREE *);
static int __lsm_manager_run_server(WT_SESSION_IMPL *);
-static void * __lsm_worker_manager(void *);
+static WT_THREAD_RET __lsm_worker_manager(void *);
/*
* __wt_lsm_manager_config --
@@ -500,7 +500,7 @@ err: if (dhandle_locked) {
* A thread that manages all open LSM trees, and the shared LSM worker
* threads.
*/
-static void *
+static WT_THREAD_RET
__lsm_worker_manager(void *arg)
{
WT_DECL_RET;
@@ -518,7 +518,7 @@ __lsm_worker_manager(void *arg)
err: WT_PANIC_MSG(session, ret, "LSM worker manager thread error");
}
F_CLR(S2C(session), WT_CONN_SERVER_LSM);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index a376a81f4eb..d1272df763d 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -10,7 +10,7 @@
static int __lsm_worker_general_op(
WT_SESSION_IMPL *, WT_LSM_WORKER_ARGS *, int *);
-static void * __lsm_worker(void *);
+static WT_THREAD_RET __lsm_worker(void *);
/*
* __wt_lsm_worker_start --
@@ -82,7 +82,7 @@ err: __wt_lsm_manager_free_work_unit(session, entry);
* __lsm_worker --
* A thread that executes work units for all open LSM trees.
*/
-static void *
+static WT_THREAD_RET
__lsm_worker(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -166,5 +166,5 @@ err: __wt_lsm_manager_free_work_unit(session, entry);
WT_PANIC_MSG(session, ret,
"Error in LSM worker thread %d", cookie->id);
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index 0a8557c7a33..70c9bf8dfcd 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -230,7 +230,7 @@ err: __wt_free(session, namep);
* __ckpt_compare_order --
* Qsort comparison routine for the checkpoint list.
*/
-static int
+static int WT_CDECL
__ckpt_compare_order(const void *a, const void *b)
{
WT_CKPT *ackpt, *bckpt;
diff --git a/src/meta/meta_turtle.c b/src/meta/meta_turtle.c
index 4cd72ba2532..7e3ac3530f8 100644
--- a/src/meta/meta_turtle.c
+++ b/src/meta/meta_turtle.c
@@ -78,7 +78,8 @@ __metadata_load_hot_backup(WT_SESSION_IMPL *session)
WT_RET(__wt_exist(session, WT_METADATA_BACKUP, &exist));
if (!exist)
return (0);
- WT_RET(__wt_fopen(session, WT_METADATA_BACKUP, "r", 0, &fp));
+ WT_RET(__wt_fopen(session,
+ WT_METADATA_BACKUP, WT_FHANDLE_READ, 0, &fp));
/* Read line pairs and load them into the metadata file. */
WT_ERR(__wt_scr_alloc(session, 512, &key));
@@ -95,7 +96,7 @@ __metadata_load_hot_backup(WT_SESSION_IMPL *session)
F_SET(S2C(session), WT_CONN_WAS_BACKUP);
-err: WT_TRET(__wt_fclose(session, &fp, 0));
+err: WT_TRET(__wt_fclose(session, &fp, WT_FHANDLE_READ));
__wt_scr_free(session, &key);
__wt_scr_free(session, &value);
return (ret);
@@ -235,7 +236,8 @@ __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep)
if (!exist)
return (strcmp(key, WT_METAFILE_URI) == 0 ?
__metadata_config(session, valuep) : WT_NOTFOUND);
- WT_RET(__wt_fopen(session, WT_METADATA_TURTLE, "r", 0, &fp));
+ WT_RET(__wt_fopen(session,
+ WT_METADATA_TURTLE, WT_FHANDLE_READ, 0, &fp));
/* Search for the key. */
WT_ERR(__wt_scr_alloc(session, 512, &buf));
@@ -257,7 +259,7 @@ __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep)
/* Copy the value for the caller. */
WT_ERR(__wt_strdup(session, buf->data, valuep));
-err: WT_TRET(__wt_fclose(session, &fp, 0));
+err: WT_TRET(__wt_fclose(session, &fp, WT_FHANDLE_READ));
__wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/os_posix/os_stdio.c b/src/os_posix/os_stdio.c
index 071bdd9fd33..8d97fdd2880 100644
--- a/src/os_posix/os_stdio.c
+++ b/src/os_posix/os_stdio.c
@@ -14,10 +14,10 @@
*/
int
__wt_fopen(WT_SESSION_IMPL *session,
- const char *name, const char *mode, u_int flags, FILE **fpp)
+ const char *name, WT_FHANDLE_MODE mode_flag, u_int flags, FILE **fpp)
{
WT_DECL_RET;
- const char *path;
+ const char *mode, *path;
char *pathbuf;
WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: fopen", name));
@@ -30,20 +30,19 @@ __wt_fopen(WT_SESSION_IMPL *session,
path = pathbuf;
}
-#ifdef _WIN32
- {
- char buf[10];
- /*
- * Open in binary (untranslated) mode; translations involving
- * carriage-return and linefeed characters are suppressed.
- */
- (void)snprintf(buf, sizeof(buf), "%s" "b", mode);
-
- *fpp = fopen(path, buf);
+ mode = NULL;
+ switch (mode_flag) {
+ case WT_FHANDLE_APPEND:
+ mode = WT_FOPEN_APPEND;
+ break;
+ case WT_FHANDLE_READ:
+ mode = WT_FOPEN_READ;
+ break;
+ case WT_FHANDLE_WRITE:
+ mode = WT_FOPEN_WRITE;
+ break;
}
-#else
*fpp = fopen(path, mode);
-#endif
if (*fpp == NULL)
ret = __wt_errno();
@@ -105,7 +104,7 @@ __wt_fflush(WT_SESSION_IMPL *session, FILE *fp)
* Close a FILE handle.
*/
int
-__wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, int iswrite)
+__wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag)
{
FILE *fp;
WT_DECL_RET;
@@ -120,7 +119,7 @@ __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, int iswrite)
* If the handle was opened for writing, flush the file to the backing
* OS buffers, then flush the OS buffers to the backing disk.
*/
- if (iswrite) {
+ if (mode_flag == WT_FHANDLE_APPEND || mode_flag == WT_FHANDLE_WRITE) {
ret = __wt_fflush(session, fp);
if (fsync(fileno(fp)) != 0)
WT_TRET(__wt_errno());
diff --git a/src/os_posix/os_thread.c b/src/os_posix/os_thread.c
index 392f997f1ac..c70a04c8df7 100644
--- a/src/os_posix/os_thread.c
+++ b/src/os_posix/os_thread.c
@@ -14,7 +14,7 @@
*/
int
__wt_thread_create(WT_SESSION_IMPL *session,
- wt_thread_t *tidret, void *(*func)(void *), void *arg)
+ wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg)
{
WT_DECL_RET;
diff --git a/src/os_win/os_fallocate.c b/src/os_win/os_fallocate.c
index 9d0a86882c6..f01ef0e101a 100644
--- a/src/os_win/os_fallocate.c
+++ b/src/os_win/os_fallocate.c
@@ -15,6 +15,8 @@
void
__wt_fallocate_config(WT_SESSION_IMPL *session, WT_FH *fh)
{
+ WT_UNUSED(session);
+
fh->fallocate_available = WT_FALLOCATE_AVAILABLE;
/*
diff --git a/src/os_win/os_mtx_cond.c b/src/os_win/os_mtx_cond.c
index a09b744720f..51f6d6533c8 100644
--- a/src/os_win/os_mtx_cond.c
+++ b/src/os_win/os_mtx_cond.c
@@ -46,7 +46,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs)
DWORD milliseconds;
WT_DECL_RET;
uint64_t milliseconds64;
- int lasterror, locked;
+ int locked;
locked = 0;
@@ -76,7 +76,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs)
*/
if (milliseconds64 >= INFINITE)
milliseconds64 = INFINITE - 1;
- milliseconds = milliseconds64;
+ milliseconds = (DWORD)milliseconds64;
/*
* 0 would mean the CV sleep becomes a TryCV which we do not
diff --git a/src/os_win/os_once.c b/src/os_win/os_once.c
index 179c1bc97f7..bec8c08777c 100644
--- a/src/os_win/os_once.c
+++ b/src/os_win/os_once.c
@@ -19,6 +19,8 @@ BOOL CALLBACK _wt_init_once_callback(
)
{
void(*init_routine)(void) = Parameter;
+ WT_UNUSED(InitOnce);
+ WT_UNUSED(Context);
init_routine();
diff --git a/src/os_win/os_thread.c b/src/os_win/os_thread.c
index 05f7dc15914..b5f13aea4e9 100644
--- a/src/os_win/os_thread.c
+++ b/src/os_win/os_thread.c
@@ -14,14 +14,14 @@
*/
int
__wt_thread_create(WT_SESSION_IMPL *session,
- wt_thread_t *tidret, void *(*func)(void *), void *arg)
+ wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg)
{
/* Spawn a new thread of control. */
- *tidret = CreateThread(NULL, 0, func, arg, 0, NULL);
- if (*tidret != NULL)
+ *tidret = (HANDLE)_beginthreadex(NULL, 0, func, arg, 0, NULL);
+ if (*tidret != 0)
return (0);
- WT_RET_MSG(session, __wt_errno(), "CreateThread");
+ WT_RET_MSG(session, errno, "_beginthreadex");
}
/*
diff --git a/src/os_win/os_time.c b/src/os_win/os_time.c
index 30fde045c54..c51db118ce1 100644
--- a/src/os_win/os_time.c
+++ b/src/os_win/os_time.c
@@ -32,8 +32,10 @@ int
__wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp)
{
uint64_t ns100;
-
FILETIME time;
+
+ WT_UNUSED(session);
+
GetSystemTimeAsFileTime(&time);
ns100 = (((int64_t)time.dwHighDateTime << 32) + time.dwLowDateTime)
diff --git a/src/support/filename.c b/src/support/filename.c
index 6d46422c70e..db466ed3bd4 100644
--- a/src/support/filename.c
+++ b/src/support/filename.c
@@ -104,7 +104,7 @@ __wt_sync_and_rename_fp(
*fpp = NULL;
/* Flush to disk and close the handle. */
- WT_RET(__wt_fclose(session, &fp, 1));
+ WT_RET(__wt_fclose(session, &fp, WT_FHANDLE_WRITE));
/* Rename the source file to the target. */
WT_RET(__wt_rename(session, from, to));
diff --git a/src/support/huffman.c b/src/support/huffman.c
index 12f98184b5c..48361551ba1 100644
--- a/src/support/huffman.c
+++ b/src/support/huffman.c
@@ -96,8 +96,8 @@ typedef struct __indexed_byte {
uint32_t frequency;
} INDEXED_SYMBOL;
-static int indexed_freq_compare(const void *, const void *);
-static int indexed_symbol_compare(const void *, const void *);
+static int WT_CDECL indexed_freq_compare(const void *, const void *);
+static int WT_CDECL indexed_symbol_compare(const void *, const void *);
static void make_table(
WT_SESSION_IMPL *, uint8_t *, uint16_t, WT_HUFFMAN_CODE *, u_int);
static void node_queue_close(WT_SESSION_IMPL *, NODE_QUEUE *);
@@ -117,7 +117,7 @@ static void set_codes(WT_FREQTREE_NODE *, WT_HUFFMAN_CODE *, uint16_t, uint8_t);
* indexed_symbol_compare --
* Qsort comparator to order the table by symbol, lowest to highest.
*/
-static int
+static int WT_CDECL
indexed_symbol_compare(const void *a, const void *b)
{
return (((INDEXED_SYMBOL *)a)->symbol >
@@ -131,7 +131,7 @@ indexed_symbol_compare(const void *a, const void *b)
* Qsort comparator to order the table by frequency (the most frequent
* symbols will be at the end of the array).
*/
-static int
+static int WT_CDECL
indexed_freq_compare(const void *a, const void *b)
{
return (((INDEXED_SYMBOL *)a)->frequency >
diff --git a/src/support/stat.c b/src/support/stat.c
index b0a8d21de28..824914bf8bf 100644
--- a/src/support/stat.c
+++ b/src/support/stat.c
@@ -401,6 +401,12 @@ __wt_stat_init_connection_stats(WT_CONNECTION_STATS *stats)
stats->cache_eviction_walk.desc = "cache: pages walked for eviction";
stats->cache_write.desc = "cache: pages written from cache";
stats->cache_overhead.desc = "cache: percentage overhead";
+ stats->cache_bytes_internal.desc =
+ "cache: tracked bytes belonging to internal pages in the cache";
+ stats->cache_bytes_leaf.desc =
+ "cache: tracked bytes belonging to leaf pages in the cache";
+ stats->cache_bytes_overflow.desc =
+ "cache: tracked bytes belonging to overflow pages in the cache";
stats->cache_bytes_dirty.desc =
"cache: tracked dirty bytes in the cache";
stats->cache_pages_dirty.desc =
diff --git a/src/txn/txn.c b/src/txn/txn.c
index 6c06a0af820..a1bec569ce7 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -12,7 +12,7 @@
* __wt_txnid_cmp --
* Compare transaction IDs for sorting / searching.
*/
-int
+int WT_CDECL
__wt_txnid_cmp(const void *v1, const void *v2)
{
uint64_t id1, id2;
diff --git a/test/mciproject.yml b/test/mciproject.yml
index d7f66212b2a..64007bdbd92 100644
--- a/test/mciproject.yml
+++ b/test/mciproject.yml
@@ -57,6 +57,21 @@ tasks:
${test_env_vars|} python ./test/suite/run.py -v 2
+ - name: compile-windows-alt
+ commands:
+ - func: "fetch source"
+ - command: git.apply_patch
+ params:
+ directory: wiredtiger
+ - command: shell.exec
+ params:
+ working_dir: "wiredtiger"
+ script: |
+ set -o errexit
+ set -o verbose
+
+ scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100" wiredtiger.dll libwiredtiger.lib
+
buildvariants:
- name: ubuntu1404
display_name: Ubuntu 14.04
@@ -89,6 +104,7 @@ buildvariants:
smp_command: -j$(grep -c ^processor /proc/cpuinfo)
tasks:
- name: compile-windows
+ - name: compile-windows-alt
- name: osx-108
display_name: OS X 10.8
diff --git a/test/suite/test_async01.py b/test/suite/test_async01.py
index 2150b16fa81..af5180192af 100644
--- a/test/suite/test_async01.py
+++ b/test/suite/test_async01.py
@@ -26,9 +26,10 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
+import sys, threading, wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wiredtiger import wiredtiger_open, WiredTigerError
-import sys, threading, wiredtiger, wttest
+from wtscenario import check_scenarios
# TODO - tmp code
def tty_pr(s):
@@ -121,7 +122,7 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess):
async_threads = 3
current = {}
- scenarios = [
+ scenarios = check_scenarios([
('file-col', dict(tablekind='col',uri='file')),
('file-fix', dict(tablekind='fix',uri='file')),
('file-row', dict(tablekind='row',uri='file')),
@@ -129,7 +130,7 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess):
('table-col', dict(tablekind='col',uri='table')),
('table-fix', dict(tablekind='fix',uri='table')),
('table-row', dict(tablekind='row',uri='table')),
- ]
+ ])
# Overrides WiredTigerTestCase so that we can configure
# async operations.
diff --git a/test/suite/test_async02.py b/test/suite/test_async02.py
index 43cf520e8ed..21d811989c8 100644
--- a/test/suite/test_async02.py
+++ b/test/suite/test_async02.py
@@ -26,9 +26,10 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
+import sys, threading, wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wiredtiger import wiredtiger_open, WiredTigerError
-import sys, threading, wiredtiger, wttest
+from wtscenario import check_scenarios
# TODO - tmp code
def tty_pr(s):
@@ -124,7 +125,7 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess):
async_threads = 3
current = {}
- scenarios = [
+ scenarios = check_scenarios([
('file-col', dict(tablekind='col',uri='file')),
('file-fix', dict(tablekind='fix',uri='file')),
('file-row', dict(tablekind='row',uri='file')),
@@ -132,7 +133,7 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess):
('table-col', dict(tablekind='col',uri='table')),
('table-fix', dict(tablekind='fix',uri='table')),
('table-row', dict(tablekind='row',uri='table')),
- ]
+ ])
# Overrides WiredTigerTestCase so that we can configure
# async operations.
diff --git a/test/suite/test_backup02.py b/test/suite/test_backup02.py
index b9cf0e8b59c..a56b5690ae3 100644
--- a/test/suite/test_backup02.py
+++ b/test/suite/test_backup02.py
@@ -28,16 +28,17 @@
import Queue
import threading, time, wiredtiger, wttest
-from wtthread import backup_thread, checkpoint_thread, op_thread
from helper import key_populate, simple_populate
+from wtthread import backup_thread, checkpoint_thread, op_thread
+from wtscenario import check_scenarios
# test_backup02.py
# Run background checkpoints and backsups repeatedly while doing inserts
# in another thread
class test_backup02(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('table', dict(uri='table:test',fmt='L',dsize=100,nops=200,nthreads=1,time=30)),
- ]
+ ])
def test_backup02(self):
done = threading.Event()
diff --git a/test/suite/test_backup04.py b/test/suite/test_backup04.py
index fe81dc29d45..03e1e30d8a2 100644
--- a/test/suite/test_backup04.py
+++ b/test/suite/test_backup04.py
@@ -30,7 +30,7 @@ import Queue
import threading, time, wiredtiger, wttest
import glob, os, shutil
from suite_subprocess import suite_subprocess
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios
from wtthread import op_thread
from helper import compare_files, key_populate
@@ -54,9 +54,9 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess):
# and that is not what we want here.
#
pfx = 'test_backup'
- scenarios = [
+ scenarios = check_scenarios([
('table', dict(uri='table:test',dsize=100,nops=2000,nthreads=1,time=30)),
- ]
+ ])
# Create a large cache, otherwise this test runs quite slowly.
def setUpConnectionOpen(self, dir):
diff --git a/test/suite/test_base02.py b/test/suite/test_base02.py
index 50332518217..491899fd0ed 100644
--- a/test/suite/test_base02.py
+++ b/test/suite/test_base02.py
@@ -32,18 +32,19 @@
import json
import wiredtiger, wttest
+from wtscenario import check_scenarios
# Test configuration strings.
class test_base02(wttest.WiredTigerTestCase):
name = 'test_base02a'
extra_config = ''
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:')),
('table', dict(uri='table:')),
('lsm', dict(uri='lsm:')),
('table-lsm', dict(uri='table:', extra_config=',type=lsm')),
- ]
+ ])
def create_and_drop(self, confstr):
name = self.uri + self.name
diff --git a/test/suite/test_base05.py b/test/suite/test_base05.py
index 74278624738..0726653d95f 100644
--- a/test/suite/test_base05.py
+++ b/test/suite/test_base05.py
@@ -27,6 +27,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
+from wtscenario import check_scenarios
# test_base05.py
# Cursor operations
@@ -39,12 +40,12 @@ class test_base05(wttest.WiredTigerTestCase):
table_name1 = 'test_base05a'
table_name2 = 'test_base05b'
nentries = 1000
- scenarios = [
+ scenarios = check_scenarios([
('no_huffman', dict(extraconfig='')),
('huffman_key', dict(extraconfig='huffman_key="english"')),
('huffman_val', dict(extraconfig='huffman_value="english"')),
('huffman_keyval', dict(extraconfig='huffman_key="english",huffman_value="english"'))
- ]
+ ])
def config_string(self):
"""
diff --git a/test/suite/test_bug006.py b/test/suite/test_bug006.py
index f4a41135357..401c292c0e4 100644
--- a/test/suite/test_bug006.py
+++ b/test/suite/test_bug006.py
@@ -31,15 +31,16 @@
import wiredtiger, wttest
from helper import key_populate, value_populate
+from wtscenario import check_scenarios
# Check that verify and salvage both raise exceptions if there is an open
# cursor.
class test_bug006(wttest.WiredTigerTestCase):
name = 'test_bug006'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:')),
('table', dict(uri='table:')),
- ]
+ ])
def test_bug006(self):
uri = self.uri + self.name
diff --git a/test/suite/test_bug008.py b/test/suite/test_bug008.py
index 6646d188ce5..6a14201c8dd 100644
--- a/test/suite/test_bug008.py
+++ b/test/suite/test_bug008.py
@@ -29,16 +29,17 @@
# test_bug008.py
# Regression tests.
-from helper import simple_populate, key_populate, value_populate
import wiredtiger, wttest
+from helper import simple_populate, key_populate, value_populate
+from wtscenario import check_scenarios
# Tests for invisible updates.
class test_bug008(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('fix', dict(fmt='key_format=r,value_format=8t', empty=1)),
('row', dict(fmt='key_format=S', empty=0)),
('var', dict(fmt='key_format=r', empty=0))
- ]
+ ])
# Verify cursor search and search-near operations on a file with a set of
# on-page visible records, and a set of insert-list invisible records.
diff --git a/test/suite/test_bulk01.py b/test/suite/test_bulk01.py
index e57231cd9ef..cab1112cff0 100644
--- a/test/suite/test_bulk01.py
+++ b/test/suite/test_bulk01.py
@@ -32,7 +32,7 @@
import wiredtiger, wttest
from helper import key_populate, value_populate
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios, multiply_scenarios, number_scenarios
# Smoke test bulk-load.
class test_bulk_load(wttest.WiredTigerTestCase):
@@ -72,10 +72,10 @@ class test_bulk_load(wttest.WiredTigerTestCase):
class test_bulk_load_row_order(wttest.WiredTigerTestCase):
name = 'test_bulk'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(type='file:')),
('table', dict(type='table:'))
- ]
+ ])
def test_bulk_load_row_order_check(self):
uri = self.type + self.name
@@ -114,10 +114,10 @@ class test_bulk_load_row_order(wttest.WiredTigerTestCase):
class test_bulk_load_not_empty(wttest.WiredTigerTestCase):
name = 'test_bulk'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(type='file:')),
('table', dict(type='table:'))
- ]
+ ])
def test_bulk_load_not_empty(self):
uri = self.type + self.name
diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py
index f4ace4a9a2f..c9799700001 100644
--- a/test/suite/test_checkpoint01.py
+++ b/test/suite/test_checkpoint01.py
@@ -28,6 +28,7 @@
import wiredtiger, wttest
from helper import key_populate, complex_populate_lsm, simple_populate
+from wtscenario import check_scenarios
# test_checkpoint01.py
# Checkpoint tests
@@ -35,10 +36,10 @@ from helper import key_populate, complex_populate_lsm, simple_populate
# with a set of checkpoints, then confirm the checkpoint's values are correct,
# including after other checkpoints are dropped.
class test_checkpoint(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:checkpoint',fmt='S')),
('table', dict(uri='table:checkpoint',fmt='S'))
- ]
+ ])
# Each checkpoint has a key range and a "is dropped" flag.
checkpoints = {
@@ -140,10 +141,10 @@ class test_checkpoint(wttest.WiredTigerTestCase):
# Check some specific cursor checkpoint combinations.
class test_checkpoint_cursor(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:checkpoint',fmt='S')),
('table', dict(uri='table:checkpoint',fmt='S'))
- ]
+ ])
# Check that you cannot open a checkpoint that doesn't exist.
def test_checkpoint_dne(self):
@@ -206,10 +207,10 @@ class test_checkpoint_cursor(wttest.WiredTigerTestCase):
# Check that you can checkpoint targets.
class test_checkpoint_target(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:checkpoint',fmt='S')),
('table', dict(uri='table:checkpoint',fmt='S'))
- ]
+ ])
def update(self, uri, value):
cursor = self.session.open_cursor(uri, None, "overwrite")
@@ -255,12 +256,12 @@ class test_checkpoint_target(wttest.WiredTigerTestCase):
# Check that you can't write checkpoint cursors.
class test_checkpoint_cursor_update(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file-r', dict(uri='file:checkpoint',fmt='r')),
('file-S', dict(uri='file:checkpoint',fmt='S')),
('table-r', dict(uri='table:checkpoint',fmt='r')),
('table-S', dict(uri='table:checkpoint',fmt='S'))
- ]
+ ])
def test_checkpoint_cursor_update(self):
simple_populate(self, self.uri, 'key_format=' + self.fmt, 100)
@@ -276,10 +277,10 @@ class test_checkpoint_cursor_update(wttest.WiredTigerTestCase):
# Check that WiredTigerCheckpoint works as a checkpoint specifier.
class test_checkpoint_last(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:checkpoint',fmt='S')),
('table', dict(uri='table:checkpoint',fmt='S'))
- ]
+ ])
def test_checkpoint_last(self):
# Create an object, change one record to an easily recognizable string,
@@ -344,10 +345,10 @@ class test_checkpoint_lsm_name(wttest.WiredTigerTestCase):
class test_checkpoint_empty(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:checkpoint')),
('table', dict(uri='table:checkpoint')),
- ]
+ ])
# Create an empty file, do one of 4 cases of checkpoint, then verify the
# checkpoints exist. The reason for the 4 cases is we must create all
diff --git a/test/suite/test_checkpoint02.py b/test/suite/test_checkpoint02.py
index 02dcef91dc3..cf625493f7c 100644
--- a/test/suite/test_checkpoint02.py
+++ b/test/suite/test_checkpoint02.py
@@ -28,18 +28,18 @@
import Queue
import threading, time, wiredtiger, wttest
-from wtthread import checkpoint_thread, op_thread
from helper import key_populate, simple_populate
+from wtthread import checkpoint_thread, op_thread
+from wtscenario import check_scenarios
# test_checkpoint02.py
# Run background checkpoints repeatedly while doing inserts and other
# operations in another thread
class test_checkpoint02(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('table-100', dict(uri='table:test',fmt='L',dsize=100,nops=50000,nthreads=10)),
('table-10', dict(uri='table:test',fmt='L',dsize=10,nops=50000,nthreads=30))
- ]
-
+ ])
def test_checkpoint02(self):
done = threading.Event()
diff --git a/test/suite/test_cursor01.py b/test/suite/test_cursor01.py
index a40a59a34c3..12b8f113095 100644
--- a/test/suite/test_cursor01.py
+++ b/test/suite/test_cursor01.py
@@ -27,6 +27,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
+from wtscenario import check_scenarios
# test_cursor01.py
# Cursor operations
@@ -40,7 +41,7 @@ class test_cursor01(wttest.WiredTigerTestCase):
table_name1 = 'test_cursor01'
nentries = 10
- scenarios = [
+ scenarios = check_scenarios([
('file-col', dict(tablekind='col',uri='file')),
('file-fix', dict(tablekind='fix',uri='file')),
('file-row', dict(tablekind='row',uri='file')),
@@ -48,7 +49,7 @@ class test_cursor01(wttest.WiredTigerTestCase):
('table-col', dict(tablekind='col',uri='table')),
('table-fix', dict(tablekind='fix',uri='table')),
('table-row', dict(tablekind='row',uri='table'))
- ]
+ ])
def genkey(self, i):
if self.tablekind == 'row':
diff --git a/test/suite/test_cursor02.py b/test/suite/test_cursor02.py
index 5be3cecd1d1..e2b3ec69f86 100644
--- a/test/suite/test_cursor02.py
+++ b/test/suite/test_cursor02.py
@@ -28,6 +28,7 @@
import wiredtiger
from test_cursor_tracker import TestCursorTracker
+from wtscenario import check_scenarios
# test_cursor02.py
# Cursor operations on small tables.
@@ -38,12 +39,12 @@ class test_cursor02(TestCursorTracker):
key/value content and to track/verify content
after inserts and removes.
"""
- scenarios = [
+ scenarios = check_scenarios([
('row', dict(tablekind='row', uri='table')),
('lsm-row', dict(tablekind='row', uri='lsm')),
('col', dict(tablekind='col', uri='table')),
#('fix', dict(tablekind='fix'))
- ]
+ ])
def create_session_and_cursor(self, ninitialentries):
tablearg = self.uri + ":" + self.table_name1
diff --git a/test/suite/test_cursor04.py b/test/suite/test_cursor04.py
index 43b824ee013..c9bf8140139 100644
--- a/test/suite/test_cursor04.py
+++ b/test/suite/test_cursor04.py
@@ -27,6 +27,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
+from wtscenario import check_scenarios
# test_base04.py
# Cursor operations
@@ -37,12 +38,12 @@ class test_cursor04(wttest.WiredTigerTestCase):
table_name1 = 'test_cursor04'
nentries = 20
- scenarios = [
+ scenarios = check_scenarios([
('row', dict(tablekind='row', uri='table')),
('lsm-row', dict(tablekind='row', uri='lsm')),
('col', dict(tablekind='col', uri='table')),
('fix', dict(tablekind='fix', uri='table'))
- ]
+ ])
def config_string(self):
"""
diff --git a/test/suite/test_cursor06.py b/test/suite/test_cursor06.py
index 589bcd215ee..28ac581cf66 100644
--- a/test/suite/test_cursor06.py
+++ b/test/suite/test_cursor06.py
@@ -29,21 +29,21 @@
import wiredtiger, wttest
from helper import key_populate, value_populate, simple_populate
from helper import complex_value_populate, complex_populate
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios
# test_cursor06.py
# Test cursor reconfiguration.
class test_cursor06(wttest.WiredTigerTestCase):
name = 'reconfigure'
- scenarios = [
+ scenarios = check_scenarios([
('file-r', dict(type='file:',keyfmt='r',complex=0)),
('file-S', dict(type='file:',keyfmt='S',complex=0)),
('lsm-S', dict(type='lsm:',keyfmt='S',complex=0)),
('table-r', dict(type='table:',keyfmt='r',complex=0)),
('table-S', dict(type='table:',keyfmt='S',complex=0)),
- ('table-r', dict(type='table:',keyfmt='r',complex=1)),
- ('table-S', dict(type='table:',keyfmt='S',complex=1)),
- ]
+ ('table-r-complex', dict(type='table:',keyfmt='r',complex=1)),
+ ('table-S-complex', dict(type='table:',keyfmt='S',complex=1)),
+ ])
def pop(self, uri):
if self.complex == 1:
diff --git a/test/suite/test_cursor07.py b/test/suite/test_cursor07.py
index 099c2cf09cb..afce5bef9f2 100644
--- a/test/suite/test_cursor07.py
+++ b/test/suite/test_cursor07.py
@@ -33,7 +33,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import wiredtiger_open, stat
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios
import wttest
class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess):
@@ -42,10 +42,10 @@ class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess):
uri = 'table:' + tablename
nkeys = 5
- scenarios = [
+ scenarios = check_scenarios([
('regular', dict(reopen=False)),
('reopen', dict(reopen=True))
- ]
+ ])
# Overrides WiredTigerTestCase - add logging
def setUpConnectionOpen(self, dir):
diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py
index 75275dfde83..bcf89d722b1 100644
--- a/test/suite/test_cursor_random.py
+++ b/test/suite/test_cursor_random.py
@@ -29,14 +29,15 @@
import wiredtiger, wttest
from helper import complex_populate, simple_populate
from helper import key_populate, value_populate
+from wtscenario import check_scenarios
# test_cursor_random.py
# Cursor next_random operations
class test_cursor_random(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(type='file:',fmt='S')),
('table', dict(type='table:',fmt='S'))
- ]
+ ])
# Check that opening a random cursor on a row-store returns not-supported
# for every method except for next and reset, and next returns not-found.
@@ -124,10 +125,10 @@ class test_cursor_random(wttest.WiredTigerTestCase):
# Check that opening a random cursor on column-store returns not-supported.
class test_cursor_random_column(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:random',fmt='r')),
('table', dict(uri='table:random',fmt='r')),
- ]
+ ])
def test_cursor_random_column(self):
self.session.create(
diff --git a/test/suite/test_drop.py b/test/suite/test_drop.py
index b87760f077e..0c82933b2ab 100644
--- a/test/suite/test_drop.py
+++ b/test/suite/test_drop.py
@@ -30,6 +30,7 @@ import os, time
import wiredtiger, wttest
from helper import confirm_does_not_exist, complex_populate, \
complex_populate_index_name, simple_populate
+from wtscenario import check_scenarios
# test_drop.py
# session level drop operation
@@ -37,12 +38,12 @@ class test_drop(wttest.WiredTigerTestCase):
name = 'test_drop'
extra_config = ''
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:')),
('table', dict(uri='table:')),
#Not yet: drop failing with an open cursor needs handle locking
#('table-lsm', dict(uri='table:', extra_config=',type=lsm')),
- ]
+ ])
# Populate an object, remove it and confirm it no longer exists.
def drop(self, populate, with_cursor, close_session, drop_index):
diff --git a/test/suite/test_dupc.py b/test/suite/test_dupc.py
index 5a0a6bd67cc..c28dd928ab6 100644
--- a/test/suite/test_dupc.py
+++ b/test/suite/test_dupc.py
@@ -33,6 +33,7 @@
import os, time
import wiredtiger, wttest
from helper import complex_populate, key_populate, simple_populate
+from wtscenario import check_scenarios
# Test session.open_cursor with cursor duplication.
class test_duplicate_cursor(wttest.WiredTigerTestCase):
@@ -41,12 +42,12 @@ class test_duplicate_cursor(wttest.WiredTigerTestCase):
config = 'key_format='
- scenarios = [
+ scenarios = check_scenarios([
('file-r', dict(uri='file:', fmt='r')),
('file-S', dict(uri='file:', fmt='S')),
('table-r', dict(uri='table:', fmt='r')),
('table-S', dict(uri='table:', fmt='S'))
- ]
+ ])
# Iterate through an object, duplicate the cursor and checking that it
# matches the original and is set to the same record.
diff --git a/test/suite/test_empty.py b/test/suite/test_empty.py
index 11821d44deb..4851d6b8317 100644
--- a/test/suite/test_empty.py
+++ b/test/suite/test_empty.py
@@ -29,18 +29,19 @@
import os
import wiredtiger, wttest
from helper import key_populate
+from wtscenario import check_scenarios
# test_empty.py
# Test that empty objects don't write anything other than a single sector.
class test_empty(wttest.WiredTigerTestCase):
name = 'test_empty'
- scenarios = [
+ scenarios = check_scenarios([
('file-r', dict(type='file:', fmt='r')),
('file-S', dict(type='file:', fmt='S')),
('table-r', dict(type='table:', fmt='r')),
('table-S', dict(type='table:', fmt='S'))
- ]
+ ])
# Creating an object and then closing it shouldn't write any blocks.
def test_empty_create(self):
diff --git a/test/suite/test_excl.py b/test/suite/test_excl.py
index da671cc2f9a..960e653e723 100644
--- a/test/suite/test_excl.py
+++ b/test/suite/test_excl.py
@@ -27,13 +27,14 @@
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
+from wtscenario import check_scenarios
# Test session.create with the exclusive configuration.
class test_create_excl(wttest.WiredTigerTestCase):
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(type='file:')),
('table', dict(type='table:'))
- ]
+ ])
# Create the object with "exclusive", then assert that creation with
# "exclusive" fails.
diff --git a/test/suite/test_overwrite.py b/test/suite/test_overwrite.py
index 7d938918324..f710035c086 100644
--- a/test/suite/test_overwrite.py
+++ b/test/suite/test_overwrite.py
@@ -28,19 +28,19 @@
import wiredtiger, wttest
from helper import key_populate, simple_populate
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios
# test_overwrite.py
# cursor overwrite configuration method
class test_overwrite(wttest.WiredTigerTestCase):
name = 'overwrite'
- scenarios = [
+ scenarios = check_scenarios([
('file-r', dict(type='file:',keyfmt='r')),
('file-S', dict(type='file:',keyfmt='S')),
('lsm-S', dict(type='lsm:',keyfmt='S')),
('table-r', dict(type='table:',keyfmt='r')),
('table-S', dict(type='table:',keyfmt='S')),
- ]
+ ])
# Confirm a cursor configured with/without overwrite correctly handles
# non-existent records during insert, remove and update operations.
diff --git a/test/suite/test_perf001.py b/test/suite/test_perf001.py
index a80c0c7e73a..415756e2255 100644
--- a/test/suite/test_perf001.py
+++ b/test/suite/test_perf001.py
@@ -32,17 +32,18 @@
import wiredtiger, wttest
import random
from time import clock, time
+from wtscenario import check_scenarios
# Test performance of inserting into a table with an index.
class test_perf001(wttest.WiredTigerTestCase):
table_name = 'test_perf001'
- scenarios = [
+ scenarios = check_scenarios([
#('file-file', dict(tabletype='file',indextype='file')),
('file-lsm', dict(tabletype='file',indextype='lsm')),
#('lsm-file', dict(tabletype='lsm',indextype='file')),
#('lsm-lsm', dict(tabletype='lsm',indextype='lsm')),
- ]
+ ])
def setUpConnectionOpen(self, dir):
wtopen_args = 'create,cache_size=512M'
diff --git a/test/suite/test_rename.py b/test/suite/test_rename.py
index 321b73543ae..9ab4cb13da3 100644
--- a/test/suite/test_rename.py
+++ b/test/suite/test_rename.py
@@ -31,6 +31,7 @@ import wiredtiger, wttest
from helper import confirm_does_not_exist,\
complex_populate, complex_populate_check,\
simple_populate, simple_populate_check
+from wtscenario import check_scenarios
# test_rename.py
# session level rename operation
@@ -38,10 +39,10 @@ class test_rename(wttest.WiredTigerTestCase):
name1 = 'test_rename1'
name2 = 'test_rename2'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:')),
('table', dict(uri='table:'))
- ]
+ ])
# Populate and object, and rename it a couple of times, confirming the
# old name doesn't exist and the new name has the right contents.
diff --git a/test/suite/test_schema02.py b/test/suite/test_schema02.py
index 17a983c1551..6d3f444346d 100644
--- a/test/suite/test_schema02.py
+++ b/test/suite/test_schema02.py
@@ -27,6 +27,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
+from wtscenario import check_scenarios
# test_schema02.py
# Columns, column groups, indexes
@@ -36,10 +37,10 @@ class test_schema02(wttest.WiredTigerTestCase):
"""
nentries = 1000
- scenarios = [
+ scenarios = check_scenarios([
('normal', { 'idx_config' : '' }),
('lsm', { 'idx_config' : ',type=lsm' }),
- ]
+ ])
def expect_failure_colgroup(self, name, configstr, match):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py
index 5db6966f634..20e173cc215 100644
--- a/test/suite/test_schema03.py
+++ b/test/suite/test_schema03.py
@@ -29,6 +29,7 @@
import os
import suite_random
import wiredtiger, wtscenario, wttest
+from wtscenario import check_scenarios
try:
# Windows does not getrlimit/setrlimit so we must catch the resource
@@ -245,7 +246,7 @@ class test_schema03(wttest.WiredTigerTestCase):
# but boost it up to this limit anyway.
OPEN_FILE_LIMIT = 1000
- restart_scenarios = [('table', dict(s_restart=['table'],P=0.3)),
+ restart_scenarios = check_scenarios([('table', dict(s_restart=['table'],P=0.3)),
('colgroup0', dict(s_restart=['colgroup0'],P=0.3)),
('index0', dict(s_restart=['index0'],P=0.3)),
('colgroup1', dict(s_restart=['colgroup1'],P=0.3)),
@@ -254,7 +255,8 @@ class test_schema03(wttest.WiredTigerTestCase):
('index2', dict(s_restart=['index2'],P=0.3)),
('populate1', dict(s_restart=['populate1'],P=0.3)),
('ipop', dict(s_restart=['index0','populate0'],P=0.3)),
- ('all', dict(s_restart=['table','colgroup0','index0','colgroup1','index1','populate0','index2','populate1'],P=1.0))]
+ ('all', dict(s_restart=['table','colgroup0','index0','colgroup1','index1','populate0','index2','populate1'],P=1.0)),
+ ])
ntable_scenarios = wtscenario.quick_scenarios('s_ntable',
[1,2,5,8], [1.0,0.4,0.5,0.5])
diff --git a/test/suite/test_truncate01.py b/test/suite/test_truncate01.py
index c74c9bdfe91..53735318d0f 100644
--- a/test/suite/test_truncate01.py
+++ b/test/suite/test_truncate01.py
@@ -34,16 +34,16 @@ import wiredtiger, wttest
from helper import confirm_empty,\
key_populate, value_populate, simple_populate,\
complex_populate, complex_value_populate
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios, multiply_scenarios, number_scenarios
# Test truncation arguments.
class test_truncate_arguments(wttest.WiredTigerTestCase):
name = 'test_truncate'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(type='file:')),
('table', dict(type='table:'))
- ]
+ ])
# Test truncation without URI or cursors specified, or with a URI and
# either cursor specified, expect errors.
@@ -80,10 +80,10 @@ class test_truncate_arguments(wttest.WiredTigerTestCase):
# Test truncation of an object using its URI.
class test_truncate_uri(wttest.WiredTigerTestCase):
name = 'test_truncate'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(type='file:')),
('table', dict(type='table:'))
- ]
+ ])
# Populate an object, truncate it by URI, and confirm it's empty.
def test_truncate_uri(self):
diff --git a/test/suite/test_txn01.py b/test/suite/test_txn01.py
index fec90938547..94e65ff0f48 100644
--- a/test/suite/test_txn01.py
+++ b/test/suite/test_txn01.py
@@ -27,19 +27,20 @@
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
+from wtscenario import check_scenarios
# test_txn01.py
# Transactions: basic functionality
class test_txn01(wttest.WiredTigerTestCase):
nentries = 1000
- scenarios = [
+ scenarios = check_scenarios([
('col-f', dict(uri='file:text_txn01',key_format='r',value_format='S')),
('col-t', dict(uri='table:text_txn01',key_format='r',value_format='S')),
('fix-f', dict(uri='file:text_txn01',key_format='r',value_format='8t')),
('fix-t', dict(uri='table:text_txn01',key_format='r',value_format='8t')),
('row-f', dict(uri='file:text_txn01',key_format='S',value_format='S')),
('row-t', dict(uri='table:text_txn01',key_format='S',value_format='S')),
- ]
+ ])
# Overrides WiredTigerTestCase
def setUpConnectionOpen(self, dir):
diff --git a/test/suite/test_txn03.py b/test/suite/test_txn03.py
index 4f202979fe4..4025dbb1117 100644
--- a/test/suite/test_txn03.py
+++ b/test/suite/test_txn03.py
@@ -31,7 +31,7 @@
#
import wiredtiger, wttest
-from wtscenario import multiply_scenarios, number_scenarios
+from wtscenario import check_scenarios
class test_txn03(wttest.WiredTigerTestCase):
tablename = 'test_txn03'
@@ -42,9 +42,9 @@ class test_txn03(wttest.WiredTigerTestCase):
data_str2 = "TEST_VAL1"
nentries = 1000
- scenarios = [
+ scenarios = check_scenarios([
('var', dict(create_params = "key_format=S,value_format=S")),
- ]
+ ])
# Overrides WiredTigerTestCase
def setUpConnectionOpen(self, dir):
diff --git a/test/suite/test_upgrade.py b/test/suite/test_upgrade.py
index 24cecf4b518..df8024413cc 100644
--- a/test/suite/test_upgrade.py
+++ b/test/suite/test_upgrade.py
@@ -29,16 +29,17 @@
import os, time
import wiredtiger, wttest
from helper import complex_populate, simple_populate
+from wtscenario import check_scenarios
# test_upgrade.py
# session level upgrade operation
class test_upgrade(wttest.WiredTigerTestCase):
name = 'test_upgrade'
- scenarios = [
+ scenarios = check_scenarios([
('file', dict(uri='file:')),
('table', dict(uri='table:'))
- ]
+ ])
# Populate an object, then upgrade it.
def upgrade(self, populate, with_cursor):
diff --git a/test/suite/test_util02.py b/test/suite/test_util02.py
index e95746e2946..76a35695a5f 100644
--- a/test/suite/test_util02.py
+++ b/test/suite/test_util02.py
@@ -27,8 +27,9 @@
# OTHER DEALINGS IN THE SOFTWARE.
import string, os
-from suite_subprocess import suite_subprocess
import wiredtiger, wttest
+from suite_subprocess import suite_subprocess
+from wtscenario import check_scenarios
# test_util02.py
# Utilities: wt load
@@ -42,12 +43,12 @@ class test_util02(wttest.WiredTigerTestCase, suite_subprocess):
nentries = 1000
stringclass = ''.__class__
- scenarios = [
+ scenarios = check_scenarios([
('SS', dict(key_format='S',value_format='S')),
('rS', dict(key_format='r',value_format='S')),
('ri', dict(key_format='r',value_format='i')),
('ii', dict(key_format='i',value_format='i')),
- ]
+ ])
def get_string(self, i, len):
"""
diff --git a/test/suite/test_util03.py b/test/suite/test_util03.py
index aa5d723fbe8..9e3c81334ec 100644
--- a/test/suite/test_util03.py
+++ b/test/suite/test_util03.py
@@ -28,6 +28,7 @@
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
+from wtscenario import check_scenarios
# test_util03.py
# Utilities: wt create
@@ -35,12 +36,12 @@ class test_util03(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_util03.a'
nentries = 1000
- scenarios = [
+ scenarios = check_scenarios([
('none', dict(key_format=None,value_format=None)),
('SS', dict(key_format='S',value_format='S')),
('rS', dict(key_format='r',value_format='S')),
('ri', dict(key_format='r',value_format='i')),
- ]
+ ])
def test_create_process(self):
"""
diff --git a/test/suite/wtscenario.py b/test/suite/wtscenario.py
index 2e59c704971..6e4b0d3464e 100644
--- a/test/suite/wtscenario.py
+++ b/test/suite/wtscenario.py
@@ -64,6 +64,13 @@ def log2chr(val):
megabyte = 1024 * 1024
+def check_scenarios(scenes):
+ """
+ Make sure all scenarios have unique names
+ """
+ assert len(scenes) == len(dict(scenes))
+ return scenes
+
def multiply_scenarios(sep, *args):
"""
Create the cross product of two lists of scenarios
@@ -90,7 +97,7 @@ def multiply_scenarios(sep, *args):
tdict['P'] = P
total.append((name, tdict))
result = total
- return result
+ return check_scenarios(result)
def prune_sorter_key(scene):
"""
@@ -161,7 +168,7 @@ def prune_scenarios(scenes, default_count = -1, long_count = -1):
for scene in scenes:
del scene[1]['_rand']
del scene[1]['_order']
- return scenes
+ return check_scenarios(scenes)
def number_scenarios(scenes):
"""
@@ -173,7 +180,7 @@ def number_scenarios(scenes):
scene[1]['scenario_name'] = scene[0]
scene[1]['scenario_number'] = count
count += 1
- return scenes
+ return check_scenarios(scenes)
def quick_scenarios(fieldname, values, probabilities):
"""
diff --git a/test/suite/wttest.py b/test/suite/wttest.py
index c1224538c59..628c138e9ae 100644
--- a/test/suite/wttest.py
+++ b/test/suite/wttest.py
@@ -177,6 +177,8 @@ class WiredTigerTestCase(unittest.TestCase):
sys.stderr = WiredTigerTestCase._stderr
def __init__(self, *args, **kwargs):
+ if hasattr(self, 'scenarios'):
+ assert(len(self.scenarios) == len(dict(self.scenarios)))
unittest.TestCase.__init__(self, *args, **kwargs)
if not self._globalSetup:
WiredTigerTestCase.globalSetup()
diff --git a/test/windows/windows_shim.c b/test/windows/windows_shim.c
index 646ebf0c441..8b0f05bfe2d 100644
--- a/test/windows/windows_shim.c
+++ b/test/windows/windows_shim.c
@@ -59,6 +59,7 @@ usleep(useconds_t useconds)
int
pthread_rwlock_destroy(pthread_rwlock_t *lock)
{
+ lock = lock;
return (0);
}
@@ -66,6 +67,7 @@ int
pthread_rwlock_init(pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *ignored)
{
+ ignored = ignored;
InitializeSRWLock(&rwlock->rwlock);
rwlock->exclusive_locked = 0;
@@ -99,13 +101,15 @@ pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
rwlock->exclusive_locked = GetCurrentThreadId();
return (0);
-
}
+#pragma warning( once : 4024 )
+#pragma warning( once : 4047 )
int
pthread_create(pthread_t *tidret, const pthread_attr_t *ignored,
void *(*func)(void *), void * arg)
{
+ ignored = ignored;
*tidret = CreateThread(NULL, 0, func, arg, 0, NULL);
if (*tidret != NULL)
@@ -117,6 +121,7 @@ pthread_create(pthread_t *tidret, const pthread_attr_t *ignored,
int
pthread_join(pthread_t thread, void **ignored)
{
+ ignored = ignored;
WaitForSingleObject(thread, INFINITE);
return (0);
}
diff --git a/tools/wtstats/stat_data.py b/tools/wtstats/stat_data.py
index 43ae5055172..a4fc2fcc831 100644
--- a/tools/wtstats/stat_data.py
+++ b/tools/wtstats/stat_data.py
@@ -7,6 +7,9 @@ no_scale_per_second_list = [
'cache: maximum page size at eviction',
'cache: pages currently held in the cache',
'cache: percentage overhead',
+ 'cache: tracked bytes belonging to internal pages in the cache',
+ 'cache: tracked bytes belonging to leaf pages in the cache',
+ 'cache: tracked bytes belonging to overflow pages in the cache',
'cache: tracked dirty bytes in the cache',
'cache: tracked dirty pages in the cache',
'connection: files currently open',
@@ -63,6 +66,9 @@ no_clear_list = [
'cache: maximum bytes configured',
'cache: pages currently held in the cache',
'cache: percentage overhead',
+ 'cache: tracked bytes belonging to internal pages in the cache',
+ 'cache: tracked bytes belonging to leaf pages in the cache',
+ 'cache: tracked bytes belonging to overflow pages in the cache',
'cache: tracked dirty bytes in the cache',
'cache: tracked dirty pages in the cache',
'connection: files currently open',