diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2015-04-09 03:54:31 +0000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2015-04-09 03:54:31 +0000 |
commit | cddde3c0d0e98a16eea40a0596d7f01c78566045 (patch) | |
tree | 624d700cba48ae227bd551c0f9b6ec8ec5a70805 | |
parent | 0fb36c67305c3219bda25ba189c951b5bac72821 (diff) | |
parent | 9dec7cd878521b09a5c980fd6edf99e655094a2d (diff) | |
download | mongo-cddde3c0d0e98a16eea40a0596d7f01c78566045.tar.gz |
Merge branch 'develop' into named-snapshots
Conflicts:
src/config/config_def.c
61 files changed, 3337 insertions, 738 deletions
@@ -2,14 +2,14 @@ WiredTiger 2.5.3: (March 26, 2015) This is version 2.5.3 of WiredTiger. -WiredTiger release packages and documentation can be found at: +Documentation is included in the "docs" directory, documentation can +also be found at: - http://source.wiredtiger.com/ + http://source.wiredtiger.com/2.5.3/index.html -Information on configuring, building and installing WiredTiger can be -found at: +Other WiredTiger release packages and documentation can be found at: - http://source.wiredtiger.com/2.5.3/install.html + http://source.wiredtiger.com/ WiredTiger licensing information can be found at: diff --git a/SConstruct b/SConstruct index 8e9fae28ac6..9d9a3918a2e 100644 --- a/SConstruct +++ b/SConstruct @@ -338,11 +338,12 @@ t = env.Program("t_huge", LIBS=[wtlib] + wtlibs) Default(t) -#env.Program("t_fops", - #["test/fops/file.c", - #"test/fops/fops.c", - #"test/fops/t.c"], - #LIBS=[wtlib]) +t = env.Program("t_fops", + ["test/fops/file.c", + "test/fops/fops.c", + "test/fops/t.c"], + LIBS=[wtlib, shim] + wtlibs) +Default(t) if useBdb: benv = env.Clone() diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in index feade27ae1b..83db9a46aba 100644 --- a/build_posix/configure.ac.in +++ b/build_posix/configure.ac.in @@ -73,7 +73,7 @@ AM_TYPES AC_PROG_INSTALL -AC_CHECK_HEADERS([pthread_np.h]) +AC_CHECK_HEADERS([x86intrin.h]) AC_CHECK_LIB(pthread, pthread_create) AC_CHECK_LIB(dl, dlopen) AC_CHECK_LIB(rt, sched_yield) diff --git a/build_win/wiredtiger_config.h b/build_win/wiredtiger_config.h index d52b3b3ae33..80dc11d7671 100644 --- a/build_win/wiredtiger_config.h +++ b/build_win/wiredtiger_config.h @@ -88,9 +88,6 @@ /* Define to 1 if you have the `posix_memalign' function. */ /* #undef HAVE_POSIX_MEMALIGN */ -/* Define to 1 if you have the <pthread_np.h> header file. */ -/* #undef HAVE_PTHREAD_NP_H */ - /* Build the LevelDB API with RocksDB support. */ /* #undef HAVE_ROCKSDB */ @@ -124,6 +121,9 @@ /* Enable verbose message configuration. */ /* #undef HAVE_VERBOSE */ +/* Define to 1 if you have the <x86intrin.h> header file. */ +#define HAVE_X86INTRIN_H 1 + /* Spinlock type from mutex.h. */ #define SPINLOCK_TYPE SPINLOCK_MSVC diff --git a/dist/api_config.py b/dist/api_config.py index 5608933defb..4c3e3b0f9f5 100644 --- a/dist/api_config.py +++ b/dist/api_config.py @@ -209,7 +209,7 @@ def add_subconfig(c): tfile.write(''' static const WT_CONFIG_CHECK confchk_%(name)s_subconfigs[] = { \t%(check)s -\t{ NULL, NULL, NULL, NULL, NULL } +\t{ NULL, NULL, NULL, NULL, NULL, 0 } }; ''' % { 'name' : c.name, @@ -221,9 +221,9 @@ def getsubconfigstr(c): ctype = gettype(c) if ctype == 'category': add_subconfig(c) - return 'confchk_' + c.name + '_subconfigs' + return 'confchk_' + c.name + '_subconfigs, ' + str(len(c.subconfig)) else: - return 'NULL' + return 'NULL, 0' # Write structures of arrays of allowable configuration options, including a # NULL as a terminator for iteration. @@ -233,7 +233,7 @@ for name in sorted(api_data.methods.keys()): tfile.write(''' static const WT_CONFIG_CHECK confchk_%(name)s[] = { \t%(check)s -\t{ NULL, NULL, NULL, NULL, NULL } +\t{ NULL, NULL, NULL, NULL, NULL, 0 } }; ''' % { 'name' : name.replace('.', '_'), @@ -270,14 +270,15 @@ for name in sorted(api_data.methods.keys()): # Write the checks reference, or NULL if no related checks structure. tfile.write('\n\t ') if ctype: - tfile.write('confchk_' + name.replace('.', '_')) + tfile.write( + 'confchk_' + name.replace('.', '_') + ', ' + str(len(ctype))) else: - tfile.write('NULL') + tfile.write('NULL, 0') tfile.write('\n\t},') # Write a NULL as a terminator for iteration. -tfile.write('\n\t{ NULL, NULL, NULL }') +tfile.write('\n\t{ NULL, NULL, NULL, 0 }') tfile.write('\n};\n') # Write the routine that connects the WT_CONNECTION_IMPL structure to the list diff --git a/dist/dist.py b/dist/dist.py index 2ea088ba3f1..1b3ad828dfb 100644 --- a/dist/dist.py +++ b/dist/dist.py @@ -10,6 +10,10 @@ def source_files(skip_includes=False): for line in open('filelist', 'r'): if file_re.match(line): yield os.path.join('..', line.rstrip()) + # Return only the Windows-specific files in the Windows filelist + for line in open('../build_win/filelist.win', 'r'): + if 'os_win' in line and file_re.match(line): + yield os.path.join('..', line.rstrip()) for line in open('extlist', 'r'): if file_re.match(line): yield os.path.join('..', line.rstrip()) diff --git a/dist/s_string.ok b/dist/s_string.ok index c0df66559fe..2946265645b 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -563,6 +563,7 @@ instantiation intl intnum intpack +intrin inuse io ip @@ -879,6 +880,7 @@ valuep valuev vanishingly variable's +vectorized versa vfprintf vpack diff --git a/dist/style.py b/dist/style.py index 70eb7fb19ab..ecb24d756e8 100755 --- a/dist/style.py +++ b/dist/style.py @@ -9,7 +9,7 @@ def missing_comment(): for f in source_files(): skip_re = re.compile(r'DO NOT EDIT: automatically built') func_re = re.compile( - r'(/\*(?:[^\*]|\*[^/])*\*/)?\n\w[\w ]+\n(\w+)', re.DOTALL) + r'(/\*(?:[^\*]|\*[^/])*\*/)?\n\w[\w \*]+\n(\w+)', re.DOTALL) s = open(f, 'r').read() if skip_re.search(s): continue diff --git a/examples/python/ex_access.py b/examples/python/ex_access.py index 7789f932d19..8994311f4c3 100755 --- a/examples/python/ex_access.py +++ b/examples/python/ex_access.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# # Public Domain 2014-2015 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # @@ -23,10 +25,15 @@ # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. +# +import os from wiredtiger import wiredtiger_open # Connect to the database and open a session +if not os.path.exists('WT_TEST'): + os.makedirs('WT_TEST') + conn = wiredtiger_open('WT_TEST', 'create') session = conn.open_session() diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c index 6da5d9ecd16..c9e0a62c8b6 100644 --- a/src/btree/bt_debug.c +++ b/src/btree/bt_debug.c @@ -131,7 +131,7 @@ __dmsg_wrapup(WT_DBG *ds) } /* Close any file we opened. */ - (void)__wt_fclose(session, &ds->fp, WT_FHANDLE_WRITE); + (void)__wt_fclose(&ds->fp, WT_FHANDLE_WRITE); } /* @@ -395,7 +395,7 @@ __debug_dsk_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk) } /* - * __debug_shape_info -- + * __debug_tree_shape_info -- * Pretty-print information about a page. */ static char * diff --git a/src/btree/bt_huffman.c b/src/btree/bt_huffman.c index 6604bd9c9e1..b2ece7b5d11 100644 --- a/src/btree/bt_huffman.c +++ b/src/btree/bt_huffman.c @@ -162,7 +162,7 @@ __huffman_confchk_file( /* Optionally return the file handle. */ if (fpp == NULL) - (void)__wt_fclose(session, &fp, WT_FHANDLE_READ); + (void)__wt_fclose(&fp, WT_FHANDLE_READ); else *fpp = fp; @@ -368,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, WT_FHANDLE_READ); + (void)__wt_fclose(&fp, WT_FHANDLE_READ); return (ret); } diff --git a/src/config/config_check.c b/src/config/config_check.c index 391209104c7..c1f7801c13b 100644 --- a/src/config/config_check.c +++ b/src/config/config_check.c @@ -9,7 +9,7 @@ #include "wt_internal.h" static int config_check( - WT_SESSION_IMPL *, const WT_CONFIG_CHECK *, const char *, size_t); + WT_SESSION_IMPL *, const WT_CONFIG_CHECK *, u_int, const char *, size_t); /* * __conn_foc_add -- @@ -161,12 +161,14 @@ __wt_configure_method(WT_SESSION_IMPL *session, if (check != NULL) WT_ERR(__wt_strdup(session, check, &newcheck->checks)); entry->checks = checks; + entry->checks_entries = 0; /* * Confirm the configuration string passes the new set of * checks. */ - WT_ERR(config_check(session, entry->checks, config, 0)); + WT_ERR(config_check( + session, entry->checks, entry->checks_entries, config, 0)); /* * The next time this configuration is updated, we don't want to figure @@ -229,8 +231,50 @@ __wt_config_check(WT_SESSION_IMPL *session, * Callers don't check, it's a fast call without a configuration or * check array. */ - return (config == NULL || entry->checks == NULL ? - 0 : config_check(session, entry->checks, config, config_len)); + return (config == NULL || entry->checks == NULL ? 0 : + config_check(session, + entry->checks, entry->checks_entries, config, config_len)); +} + +/* + * config_check_search -- + * Search a set of checks for a matching name. + */ +static inline int +config_check_search(WT_SESSION_IMPL *session, + const WT_CONFIG_CHECK *checks, u_int entries, + const char *str, size_t len, int *ip) +{ + u_int base, indx, limit; + int cmp; + + /* + * For standard sets of configuration information, we know how many + * entries and that they're sorted, do a binary search. Else, do it + * the slow way. + */ + if (entries == 0) { + for (indx = 0; checks[indx].name != NULL; indx++) + if (WT_STRING_MATCH(checks[indx].name, str, len)) { + *ip = (int)indx; + return (0); + } + } else + for (base = 0, limit = entries; limit != 0; limit >>= 1) { + indx = base + (limit >> 1); + cmp = strncmp(checks[indx].name, str, len); + if (cmp == 0 && checks[indx].name[len] == '\0') { + *ip = (int)indx; + return (0); + } + if (cmp < 0) { + base = indx + 1; + --limit; + } + } + + WT_RET_MSG(session, EINVAL, + "unknown configuration key: '%.*s'", (int)len, str); } /* @@ -240,7 +284,8 @@ __wt_config_check(WT_SESSION_IMPL *session, */ static int config_check(WT_SESSION_IMPL *session, - const WT_CONFIG_CHECK *checks, const char *config, size_t config_len) + const WT_CONFIG_CHECK *checks, u_int checks_entries, + const char *config, size_t config_len) { WT_CONFIG parser, cparser, sparser; WT_CONFIG_ITEM k, v, ck, cv, dummy; @@ -263,13 +308,8 @@ config_check(WT_SESSION_IMPL *session, (int)k.len, k.str); /* Search for a matching entry. */ - for (i = 0; checks[i].name != NULL; i++) - if (WT_STRING_MATCH(checks[i].name, k.str, k.len)) - break; - if (checks[i].name == NULL) - WT_RET_MSG(session, EINVAL, - "unknown configuration key: '%.*s'", - (int)k.len, k.str); + WT_RET(config_check_search( + session, checks, checks_entries, k.str, k.len, &i)); if (strcmp(checks[i].type, "boolean") == 0) { badtype = (v.type != WT_CONFIG_ITEM_BOOL && @@ -278,7 +318,7 @@ config_check(WT_SESSION_IMPL *session, } else if (strcmp(checks[i].type, "category") == 0) { /* Deal with categories of the form: XXX=(XXX=blah). */ ret = config_check(session, - checks[i].subconfigs, + checks[i].subconfigs, checks[i].subconfigs_entries, k.str + strlen(checks[i].name) + 1, v.len); if (ret != EINVAL) badtype = 0; diff --git a/src/config/config_def.c b/src/config/config_def.c index 25e55aaa91c..21043f2c531 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -3,670 +3,710 @@ #include "wt_internal.h" static const WT_CONFIG_CHECK confchk_colgroup_meta[] = { - { "app_metadata", "string", NULL, NULL, NULL }, - { "collator", "string", __wt_collator_confchk, NULL, NULL }, - { "columns", "list", NULL, NULL, NULL }, - { "source", "string", NULL, NULL, NULL }, - { "type", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "app_metadata", "string", NULL, NULL, NULL, 0 }, + { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 }, + { "columns", "list", NULL, NULL, NULL, 0 }, + { "source", "string", NULL, NULL, NULL, 0 }, + { "type", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_connection_async_new_op[] = { - { "append", "boolean", NULL, NULL, NULL }, - { "overwrite", "boolean", NULL, NULL, NULL }, - { "raw", "boolean", NULL, NULL, NULL }, - { "timeout", "int", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "append", "boolean", NULL, NULL, NULL, 0 }, + { "overwrite", "boolean", NULL, NULL, NULL, 0 }, + { "raw", "boolean", NULL, NULL, NULL, 0 }, + { "timeout", "int", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_connection_close[] = { - { "leak_memory", "boolean", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "leak_memory", "boolean", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_connection_load_extension[] = { - { "config", "string", NULL, NULL, NULL }, - { "entry", "string", NULL, NULL, NULL }, - { "terminate", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "config", "string", NULL, NULL, NULL, 0 }, + { "entry", "string", NULL, NULL, NULL, 0 }, + { "terminate", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_connection_open_session[] = { { "isolation", "string", NULL, "choices=[\"read-uncommitted\",\"read-committed\"," "\"snapshot\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_async_subconfigs[] = { - { "enabled", "boolean", NULL, NULL, NULL }, - { "ops_max", "int", NULL, "min=1,max=4096", NULL }, - { "threads", "int", NULL, "min=1,max=20", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "enabled", "boolean", NULL, NULL, NULL, 0 }, + { "ops_max", "int", NULL, "min=1,max=4096", NULL, 0 }, + { "threads", "int", NULL, "min=1,max=20", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_checkpoint_subconfigs[] = { - { "log_size", "int", NULL, "min=0,max=2GB", NULL }, - { "name", "string", NULL, NULL, NULL }, - { "wait", "int", NULL, "min=0,max=100000", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "log_size", "int", NULL, "min=0,max=2GB", NULL, 0 }, + { "name", "string", NULL, NULL, NULL, 0 }, + { "wait", "int", NULL, "min=0,max=100000", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_eviction_subconfigs[] = { - { "threads_max", "int", NULL, "min=1,max=20", NULL }, - { "threads_min", "int", NULL, "min=1,max=20", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "threads_max", "int", NULL, "min=1,max=20", NULL, 0 }, + { "threads_min", "int", NULL, "min=1,max=20", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_file_manager_subconfigs[] = { - { "close_idle_time", "int", NULL, "min=1,max=1000", NULL }, - { "close_scan_interval", "int", NULL, "min=1,max=1000", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "close_idle_time", "int", NULL, "min=1,max=1000", NULL, 0 }, + { "close_scan_interval", "int", + NULL, "min=1,max=1000", + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_lsm_manager_subconfigs[] = { - { "merge", "boolean", NULL, NULL, NULL }, - { "worker_thread_max", "int", NULL, "min=3,max=20", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "merge", "boolean", NULL, NULL, NULL, 0 }, + { "worker_thread_max", "int", NULL, "min=3,max=20", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_shared_cache_subconfigs[] = { - { "chunk", "int", NULL, "min=1MB,max=10TB", NULL }, - { "name", "string", NULL, NULL, NULL }, - { "reserve", "int", NULL, NULL, NULL }, - { "size", "int", NULL, "min=1MB,max=10TB", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "chunk", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, + { "name", "string", NULL, NULL, NULL, 0 }, + { "reserve", "int", NULL, NULL, NULL, 0 }, + { "size", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_statistics_log_subconfigs[] = { - { "on_close", "boolean", NULL, NULL, NULL }, - { "path", "string", NULL, NULL, NULL }, - { "sources", "list", NULL, NULL, NULL }, - { "timestamp", "string", NULL, NULL, NULL }, - { "wait", "int", NULL, "min=0,max=100000", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "on_close", "boolean", NULL, NULL, NULL, 0 }, + { "path", "string", NULL, NULL, NULL, 0 }, + { "sources", "list", NULL, NULL, NULL, 0 }, + { "timestamp", "string", NULL, NULL, NULL, 0 }, + { "wait", "int", NULL, "min=0,max=100000", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_connection_reconfigure[] = { - { "async", "category", NULL, NULL, confchk_async_subconfigs }, - { "cache_overhead", "int", NULL, "min=0,max=30", NULL }, - { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL }, + { "async", "category", + NULL, NULL, + confchk_async_subconfigs, 3 }, + { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 }, + { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, { "checkpoint", "category", NULL, NULL, - confchk_checkpoint_subconfigs }, - { "error_prefix", "string", NULL, NULL, NULL }, + confchk_checkpoint_subconfigs, 3 }, + { "error_prefix", "string", NULL, NULL, NULL, 0 }, { "eviction", "category", NULL, NULL, - confchk_eviction_subconfigs }, + confchk_eviction_subconfigs, 2 }, { "eviction_dirty_target", "int", NULL, "min=10,max=99", - NULL }, - { "eviction_target", "int", NULL, "min=10,max=99", NULL }, - { "eviction_trigger", "int", NULL, "min=10,max=99", NULL }, + NULL, 0 }, + { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 }, + { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 }, { "file_manager", "category", NULL, NULL, - confchk_file_manager_subconfigs }, + confchk_file_manager_subconfigs, 2 }, { "lsm_manager", "category", NULL, NULL, - confchk_lsm_manager_subconfigs }, - { "lsm_merge", "boolean", NULL, NULL, NULL }, + confchk_lsm_manager_subconfigs, 2 }, + { "lsm_merge", "boolean", NULL, NULL, NULL, 0 }, { "shared_cache", "category", NULL, NULL, - confchk_shared_cache_subconfigs }, + confchk_shared_cache_subconfigs, 4 }, { "statistics", "list", NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]", - NULL }, + NULL, 0 }, { "statistics_log", "category", NULL, NULL, - confchk_statistics_log_subconfigs }, + confchk_statistics_log_subconfigs, 5 }, { "verbose", "list", NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\"," "\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\"," "\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\"," "\"recovery\",\"salvage\",\"shared_cache\",\"split\"," "\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_cursor_reconfigure[] = { - { "append", "boolean", NULL, NULL, NULL }, - { "overwrite", "boolean", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "append", "boolean", NULL, NULL, NULL, 0 }, + { "overwrite", "boolean", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_file_meta[] = { - { "allocation_size", "int", NULL, "min=512B,max=128MB", NULL }, - { "app_metadata", "string", NULL, NULL, NULL }, + { "allocation_size", "int", + NULL, "min=512B,max=128MB", + NULL, 0 }, + { "app_metadata", "string", NULL, NULL, NULL, 0 }, { "block_allocation", "string", NULL, "choices=[\"first\",\"best\"]", - NULL }, + NULL, 0 }, { "block_compressor", "string", __wt_compressor_confchk, NULL, - NULL }, - { "cache_resident", "boolean", NULL, NULL, NULL }, - { "checkpoint", "string", NULL, NULL, NULL }, - { "checkpoint_lsn", "string", NULL, NULL, NULL }, + NULL, 0 }, + { "cache_resident", "boolean", NULL, NULL, NULL, 0 }, + { "checkpoint", "string", NULL, NULL, NULL, 0 }, + { "checkpoint_lsn", "string", NULL, NULL, NULL, 0 }, { "checksum", "string", NULL, "choices=[\"on\",\"off\",\"uncompressed\"]", - NULL }, - { "collator", "string", __wt_collator_confchk, NULL, NULL }, - { "columns", "list", NULL, NULL, NULL }, - { "dictionary", "int", NULL, "min=0", NULL }, - { "format", "string", NULL, "choices=[\"btree\"]", NULL }, - { "huffman_key", "string", __wt_huffman_confchk, NULL, NULL }, + NULL, 0 }, + { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 }, + { "columns", "list", NULL, NULL, NULL, 0 }, + { "dictionary", "int", NULL, "min=0", NULL, 0 }, + { "format", "string", NULL, "choices=[\"btree\"]", NULL, 0 }, + { "huffman_key", "string", + __wt_huffman_confchk, NULL, + NULL, 0 }, { "huffman_value", "string", __wt_huffman_confchk, NULL, - NULL }, - { "id", "string", NULL, NULL, NULL }, - { "internal_item_max", "int", NULL, "min=0", NULL }, - { "internal_key_max", "int", NULL, "min=0", NULL }, - { "internal_key_truncate", "boolean", NULL, NULL, NULL }, + NULL, 0 }, + { "id", "string", NULL, NULL, NULL, 0 }, + { "internal_item_max", "int", NULL, "min=0", NULL, 0 }, + { "internal_key_max", "int", NULL, "min=0", NULL, 0 }, + { "internal_key_truncate", "boolean", NULL, NULL, NULL, 0 }, { "internal_page_max", "int", NULL, "min=512B,max=512MB", - NULL }, - { "key_format", "format", __wt_struct_confchk, NULL, NULL }, - { "key_gap", "int", NULL, "min=0", NULL }, - { "leaf_item_max", "int", NULL, "min=0", NULL }, - { "leaf_key_max", "int", NULL, "min=0", NULL }, - { "leaf_page_max", "int", NULL, "min=512B,max=512MB", NULL }, - { "leaf_value_max", "int", NULL, "min=0", NULL }, - { "memory_page_max", "int", NULL, "min=512B,max=10TB", NULL }, - { "os_cache_dirty_max", "int", NULL, "min=0", NULL }, - { "os_cache_max", "int", NULL, "min=0", NULL }, - { "prefix_compression", "boolean", NULL, NULL, NULL }, - { "prefix_compression_min", "int", NULL, "min=0", NULL }, - { "split_deepen_min_child", "int", NULL, NULL, NULL }, - { "split_deepen_per_child", "int", NULL, NULL, NULL }, - { "split_pct", "int", NULL, "min=25,max=100", NULL }, - { "value_format", "format", __wt_struct_confchk, NULL, NULL }, - { "version", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 }, + { "key_gap", "int", NULL, "min=0", NULL, 0 }, + { "leaf_item_max", "int", NULL, "min=0", NULL, 0 }, + { "leaf_key_max", "int", NULL, "min=0", NULL, 0 }, + { "leaf_page_max", "int", + NULL, "min=512B,max=512MB", + NULL, 0 }, + { "leaf_value_max", "int", NULL, "min=0", NULL, 0 }, + { "memory_page_max", "int", + NULL, "min=512B,max=10TB", + NULL, 0 }, + { "os_cache_dirty_max", "int", NULL, "min=0", NULL, 0 }, + { "os_cache_max", "int", NULL, "min=0", NULL, 0 }, + { "prefix_compression", "boolean", NULL, NULL, NULL, 0 }, + { "prefix_compression_min", "int", NULL, "min=0", NULL, 0 }, + { "split_deepen_min_child", "int", NULL, NULL, NULL, 0 }, + { "split_deepen_per_child", "int", NULL, NULL, NULL, 0 }, + { "split_pct", "int", NULL, "min=25,max=100", NULL, 0 }, + { "value_format", "format", + __wt_struct_confchk, NULL, + NULL, 0 }, + { "version", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_index_meta[] = { - { "app_metadata", "string", NULL, NULL, NULL }, - { "collator", "string", __wt_collator_confchk, NULL, NULL }, - { "columns", "list", NULL, NULL, NULL }, - { "extractor", "string", __wt_extractor_confchk, NULL, NULL }, - { "immutable", "boolean", NULL, NULL, NULL }, - { "index_key_columns", "int", NULL, NULL, NULL }, - { "key_format", "format", __wt_struct_confchk, NULL, NULL }, - { "source", "string", NULL, NULL, NULL }, - { "type", "string", NULL, NULL, NULL }, - { "value_format", "format", __wt_struct_confchk, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "app_metadata", "string", NULL, NULL, NULL, 0 }, + { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 }, + { "columns", "list", NULL, NULL, NULL, 0 }, + { "extractor", "string", + __wt_extractor_confchk, NULL, + NULL, 0 }, + { "immutable", "boolean", NULL, NULL, NULL, 0 }, + { "index_key_columns", "int", NULL, NULL, NULL, 0 }, + { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 }, + { "source", "string", NULL, NULL, NULL, 0 }, + { "type", "string", NULL, NULL, NULL, 0 }, + { "value_format", "format", + __wt_struct_confchk, NULL, + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_begin_transaction[] = { { "isolation", "string", NULL, "choices=[\"read-uncommitted\",\"read-committed\"," "\"snapshot\"]", - NULL }, - { "name", "string", NULL, NULL, NULL }, - { "priority", "int", NULL, "min=-100,max=100", NULL }, - { "snapshot", "string", NULL, NULL, NULL }, - { "sync", "boolean", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { "name", "string", NULL, NULL, NULL, 0 }, + { "priority", "int", NULL, "min=-100,max=100", NULL, 0 }, + { "snapshot", "string", NULL, NULL, NULL, 0 }, + { "sync", "boolean", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_checkpoint[] = { - { "drop", "list", NULL, NULL, NULL }, - { "force", "boolean", NULL, NULL, NULL }, - { "name", "string", NULL, NULL, NULL }, - { "target", "list", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "drop", "list", NULL, NULL, NULL, 0 }, + { "force", "boolean", NULL, NULL, NULL, 0 }, + { "name", "string", NULL, NULL, NULL, 0 }, + { "target", "list", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_compact[] = { - { "timeout", "int", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "timeout", "int", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_lsm_subconfigs[] = { - { "auto_throttle", "boolean", NULL, NULL, NULL }, - { "bloom", "boolean", NULL, NULL, NULL }, - { "bloom_bit_count", "int", NULL, "min=2,max=1000", NULL }, - { "bloom_config", "string", NULL, NULL, NULL }, - { "bloom_hash_count", "int", NULL, "min=2,max=100", NULL }, - { "bloom_oldest", "boolean", NULL, NULL, NULL }, - { "chunk_count_limit", "int", NULL, NULL, NULL }, - { "chunk_max", "int", NULL, "min=100MB,max=10TB", NULL }, - { "chunk_size", "int", NULL, "min=512K,max=500MB", NULL }, - { "merge_max", "int", NULL, "min=2,max=100", NULL }, - { "merge_min", "int", NULL, "max=100", NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "auto_throttle", "boolean", NULL, NULL, NULL, 0 }, + { "bloom", "boolean", NULL, NULL, NULL, 0 }, + { "bloom_bit_count", "int", NULL, "min=2,max=1000", NULL, 0 }, + { "bloom_config", "string", NULL, NULL, NULL, 0 }, + { "bloom_hash_count", "int", NULL, "min=2,max=100", NULL, 0 }, + { "bloom_oldest", "boolean", NULL, NULL, NULL, 0 }, + { "chunk_count_limit", "int", NULL, NULL, NULL, 0 }, + { "chunk_max", "int", NULL, "min=100MB,max=10TB", NULL, 0 }, + { "chunk_size", "int", NULL, "min=512K,max=500MB", NULL, 0 }, + { "merge_max", "int", NULL, "min=2,max=100", NULL, 0 }, + { "merge_min", "int", NULL, "max=100", NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_create[] = { - { "allocation_size", "int", NULL, "min=512B,max=128MB", NULL }, - { "app_metadata", "string", NULL, NULL, NULL }, + { "allocation_size", "int", + NULL, "min=512B,max=128MB", + NULL, 0 }, + { "app_metadata", "string", NULL, NULL, NULL, 0 }, { "block_allocation", "string", NULL, "choices=[\"first\",\"best\"]", - NULL }, + NULL, 0 }, { "block_compressor", "string", __wt_compressor_confchk, NULL, - NULL }, - { "cache_resident", "boolean", NULL, NULL, NULL }, + NULL, 0 }, + { "cache_resident", "boolean", NULL, NULL, NULL, 0 }, { "checksum", "string", NULL, "choices=[\"on\",\"off\",\"uncompressed\"]", - NULL }, - { "colgroups", "list", NULL, NULL, NULL }, - { "collator", "string", __wt_collator_confchk, NULL, NULL }, - { "columns", "list", NULL, NULL, NULL }, - { "dictionary", "int", NULL, "min=0", NULL }, - { "exclusive", "boolean", NULL, NULL, NULL }, - { "extractor", "string", __wt_extractor_confchk, NULL, NULL }, - { "format", "string", NULL, "choices=[\"btree\"]", NULL }, - { "huffman_key", "string", __wt_huffman_confchk, NULL, NULL }, + NULL, 0 }, + { "colgroups", "list", NULL, NULL, NULL, 0 }, + { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 }, + { "columns", "list", NULL, NULL, NULL, 0 }, + { "dictionary", "int", NULL, "min=0", NULL, 0 }, + { "exclusive", "boolean", NULL, NULL, NULL, 0 }, + { "extractor", "string", + __wt_extractor_confchk, NULL, + NULL, 0 }, + { "format", "string", NULL, "choices=[\"btree\"]", NULL, 0 }, + { "huffman_key", "string", + __wt_huffman_confchk, NULL, + NULL, 0 }, { "huffman_value", "string", __wt_huffman_confchk, NULL, - NULL }, - { "immutable", "boolean", NULL, NULL, NULL }, - { "internal_item_max", "int", NULL, "min=0", NULL }, - { "internal_key_max", "int", NULL, "min=0", NULL }, - { "internal_key_truncate", "boolean", NULL, NULL, NULL }, + NULL, 0 }, + { "immutable", "boolean", NULL, NULL, NULL, 0 }, + { "internal_item_max", "int", NULL, "min=0", NULL, 0 }, + { "internal_key_max", "int", NULL, "min=0", NULL, 0 }, + { "internal_key_truncate", "boolean", NULL, NULL, NULL, 0 }, { "internal_page_max", "int", NULL, "min=512B,max=512MB", - NULL }, - { "key_format", "format", __wt_struct_confchk, NULL, NULL }, - { "key_gap", "int", NULL, "min=0", NULL }, - { "leaf_item_max", "int", NULL, "min=0", NULL }, - { "leaf_key_max", "int", NULL, "min=0", NULL }, - { "leaf_page_max", "int", NULL, "min=512B,max=512MB", NULL }, - { "leaf_value_max", "int", NULL, "min=0", NULL }, - { "lsm", "category", NULL, NULL, confchk_lsm_subconfigs }, - { "memory_page_max", "int", NULL, "min=512B,max=10TB", NULL }, - { "os_cache_dirty_max", "int", NULL, "min=0", NULL }, - { "os_cache_max", "int", NULL, "min=0", NULL }, - { "prefix_compression", "boolean", NULL, NULL, NULL }, - { "prefix_compression_min", "int", NULL, "min=0", NULL }, - { "source", "string", NULL, NULL, NULL }, - { "split_deepen_min_child", "int", NULL, NULL, NULL }, - { "split_deepen_per_child", "int", NULL, NULL, NULL }, - { "split_pct", "int", NULL, "min=25,max=100", NULL }, - { "type", "string", NULL, NULL, NULL }, - { "value_format", "format", __wt_struct_confchk, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 }, + { "key_gap", "int", NULL, "min=0", NULL, 0 }, + { "leaf_item_max", "int", NULL, "min=0", NULL, 0 }, + { "leaf_key_max", "int", NULL, "min=0", NULL, 0 }, + { "leaf_page_max", "int", + NULL, "min=512B,max=512MB", + NULL, 0 }, + { "leaf_value_max", "int", NULL, "min=0", NULL, 0 }, + { "lsm", "category", NULL, NULL, confchk_lsm_subconfigs, 11 }, + { "memory_page_max", "int", + NULL, "min=512B,max=10TB", + NULL, 0 }, + { "os_cache_dirty_max", "int", NULL, "min=0", NULL, 0 }, + { "os_cache_max", "int", NULL, "min=0", NULL, 0 }, + { "prefix_compression", "boolean", NULL, NULL, NULL, 0 }, + { "prefix_compression_min", "int", NULL, "min=0", NULL, 0 }, + { "source", "string", NULL, NULL, NULL, 0 }, + { "split_deepen_min_child", "int", NULL, NULL, NULL, 0 }, + { "split_deepen_per_child", "int", NULL, NULL, NULL, 0 }, + { "split_pct", "int", NULL, "min=25,max=100", NULL, 0 }, + { "type", "string", NULL, NULL, NULL, 0 }, + { "value_format", "format", + __wt_struct_confchk, NULL, + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_drop[] = { - { "force", "boolean", NULL, NULL, NULL }, - { "remove_files", "boolean", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "force", "boolean", NULL, NULL, NULL, 0 }, + { "remove_files", "boolean", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_open_cursor[] = { - { "append", "boolean", NULL, NULL, NULL }, - { "bulk", "string", NULL, NULL, NULL }, - { "checkpoint", "string", NULL, NULL, NULL }, + { "append", "boolean", NULL, NULL, NULL, 0 }, + { "bulk", "string", NULL, NULL, NULL, 0 }, + { "checkpoint", "string", NULL, NULL, NULL, 0 }, { "dump", "string", NULL, "choices=[\"hex\",\"json\",\"print\"]", - NULL }, - { "next_random", "boolean", NULL, NULL, NULL }, - { "overwrite", "boolean", NULL, NULL, NULL }, - { "raw", "boolean", NULL, NULL, NULL }, - { "readonly", "boolean", NULL, NULL, NULL }, - { "skip_sort_check", "boolean", NULL, NULL, NULL }, + NULL, 0 }, + { "next_random", "boolean", NULL, NULL, NULL, 0 }, + { "overwrite", "boolean", NULL, NULL, NULL, 0 }, + { "raw", "boolean", NULL, NULL, NULL, 0 }, + { "readonly", "boolean", NULL, NULL, NULL, 0 }, + { "skip_sort_check", "boolean", NULL, NULL, NULL, 0 }, { "statistics", "list", NULL, "choices=[\"all\",\"fast\",\"clear\"]", - NULL }, - { "target", "list", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { "target", "list", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_reconfigure[] = { { "isolation", "string", NULL, "choices=[\"read-uncommitted\",\"read-committed\"," "\"snapshot\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_salvage[] = { - { "force", "boolean", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "force", "boolean", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_drop_subconfigs[] = { - { "to", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "to", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_snapshot[] = { - { "drop", "category", NULL, NULL, confchk_drop_subconfigs }, - { "name", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "drop", "category", NULL, NULL, confchk_drop_subconfigs, 1 }, + { "name", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_session_verify[] = { - { "dump_address", "boolean", NULL, NULL, NULL }, - { "dump_blocks", "boolean", NULL, NULL, NULL }, - { "dump_offsets", "list", NULL, NULL, NULL }, - { "dump_pages", "boolean", NULL, NULL, NULL }, - { "dump_shape", "boolean", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "dump_address", "boolean", NULL, NULL, NULL, 0 }, + { "dump_blocks", "boolean", NULL, NULL, NULL, 0 }, + { "dump_offsets", "list", NULL, NULL, NULL, 0 }, + { "dump_pages", "boolean", NULL, NULL, NULL, 0 }, + { "dump_shape", "boolean", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_table_meta[] = { - { "app_metadata", "string", NULL, NULL, NULL }, - { "colgroups", "list", NULL, NULL, NULL }, - { "collator", "string", __wt_collator_confchk, NULL, NULL }, - { "columns", "list", NULL, NULL, NULL }, - { "key_format", "format", __wt_struct_confchk, NULL, NULL }, - { "value_format", "format", __wt_struct_confchk, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + { "app_metadata", "string", NULL, NULL, NULL, 0 }, + { "colgroups", "list", NULL, NULL, NULL, 0 }, + { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 }, + { "columns", "list", NULL, NULL, NULL, 0 }, + { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 }, + { "value_format", "format", + __wt_struct_confchk, NULL, + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_log_subconfigs[] = { - { "archive", "boolean", NULL, NULL, NULL }, - { "compressor", "string", NULL, NULL, NULL }, - { "enabled", "boolean", NULL, NULL, NULL }, - { "file_max", "int", NULL, "min=100KB,max=2GB", NULL }, - { "path", "string", NULL, NULL, NULL }, - { "prealloc", "boolean", NULL, NULL, NULL }, + { "archive", "boolean", NULL, NULL, NULL, 0 }, + { "compressor", "string", NULL, NULL, NULL, 0 }, + { "enabled", "boolean", NULL, NULL, NULL, 0 }, + { "file_max", "int", NULL, "min=100KB,max=2GB", NULL, 0 }, + { "path", "string", NULL, NULL, NULL, 0 }, + { "prealloc", "boolean", NULL, NULL, NULL, 0 }, { "recover", "string", NULL, "choices=[\"error\",\"on\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_transaction_sync_subconfigs[] = { - { "enabled", "boolean", NULL, NULL, NULL }, + { "enabled", "boolean", NULL, NULL, NULL, 0 }, { "method", "string", NULL, "choices=[\"dsync\",\"fsync\",\"none\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = { - { "async", "category", NULL, NULL, confchk_async_subconfigs }, - { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL }, - { "cache_overhead", "int", NULL, "min=0,max=30", NULL }, - { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL }, + { "async", "category", + NULL, NULL, + confchk_async_subconfigs, 3 }, + { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 }, + { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 }, + { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, { "checkpoint", "category", NULL, NULL, - confchk_checkpoint_subconfigs }, - { "checkpoint_sync", "boolean", NULL, NULL, NULL }, - { "config_base", "boolean", NULL, NULL, NULL }, - { "create", "boolean", NULL, NULL, NULL }, + confchk_checkpoint_subconfigs, 3 }, + { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 }, + { "config_base", "boolean", NULL, NULL, NULL, 0 }, + { "create", "boolean", NULL, NULL, NULL, 0 }, { "direct_io", "list", NULL, "choices=[\"checkpoint\",\"data\",\"log\"]", - NULL }, - { "error_prefix", "string", NULL, NULL, NULL }, + NULL, 0 }, + { "error_prefix", "string", NULL, NULL, NULL, 0 }, { "eviction", "category", NULL, NULL, - confchk_eviction_subconfigs }, + confchk_eviction_subconfigs, 2 }, { "eviction_dirty_target", "int", NULL, "min=10,max=99", - NULL }, - { "eviction_target", "int", NULL, "min=10,max=99", NULL }, - { "eviction_trigger", "int", NULL, "min=10,max=99", NULL }, - { "exclusive", "boolean", NULL, NULL, NULL }, - { "extensions", "list", NULL, NULL, NULL }, + NULL, 0 }, + { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 }, + { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 }, + { "exclusive", "boolean", NULL, NULL, NULL, 0 }, + { "extensions", "list", NULL, NULL, NULL, 0 }, { "file_extend", "list", NULL, "choices=[\"data\",\"log\"]", - NULL }, + NULL, 0 }, { "file_manager", "category", NULL, NULL, - confchk_file_manager_subconfigs }, - { "hazard_max", "int", NULL, "min=15", NULL }, - { "log", "category", NULL, NULL, confchk_log_subconfigs }, + confchk_file_manager_subconfigs, 2 }, + { "hazard_max", "int", NULL, "min=15", NULL, 0 }, + { "log", "category", NULL, NULL, confchk_log_subconfigs, 7 }, { "lsm_manager", "category", NULL, NULL, - confchk_lsm_manager_subconfigs }, - { "lsm_merge", "boolean", NULL, NULL, NULL }, - { "mmap", "boolean", NULL, NULL, NULL }, - { "multiprocess", "boolean", NULL, NULL, NULL }, - { "session_max", "int", NULL, "min=1", NULL }, - { "session_scratch_max", "int", NULL, NULL, NULL }, + confchk_lsm_manager_subconfigs, 2 }, + { "lsm_merge", "boolean", NULL, NULL, NULL, 0 }, + { "mmap", "boolean", NULL, NULL, NULL, 0 }, + { "multiprocess", "boolean", NULL, NULL, NULL, 0 }, + { "session_max", "int", NULL, "min=1", NULL, 0 }, + { "session_scratch_max", "int", NULL, NULL, NULL, 0 }, { "shared_cache", "category", NULL, NULL, - confchk_shared_cache_subconfigs }, + confchk_shared_cache_subconfigs, 4 }, { "statistics", "list", NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]", - NULL }, + NULL, 0 }, { "statistics_log", "category", NULL, NULL, - confchk_statistics_log_subconfigs }, + confchk_statistics_log_subconfigs, 5 }, { "transaction_sync", "category", NULL, NULL, - confchk_transaction_sync_subconfigs }, - { "use_environment_priv", "boolean", NULL, NULL, NULL }, + confchk_transaction_sync_subconfigs, 2 }, + { "use_environment_priv", "boolean", NULL, NULL, NULL, 0 }, { "verbose", "list", NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\"," "\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\"," "\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\"," "\"recovery\",\"salvage\",\"shared_cache\",\"split\"," "\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = { - { "async", "category", NULL, NULL, confchk_async_subconfigs }, - { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL }, - { "cache_overhead", "int", NULL, "min=0,max=30", NULL }, - { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL }, + { "async", "category", + NULL, NULL, + confchk_async_subconfigs, 3 }, + { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 }, + { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 }, + { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, { "checkpoint", "category", NULL, NULL, - confchk_checkpoint_subconfigs }, - { "checkpoint_sync", "boolean", NULL, NULL, NULL }, - { "config_base", "boolean", NULL, NULL, NULL }, - { "create", "boolean", NULL, NULL, NULL }, + confchk_checkpoint_subconfigs, 3 }, + { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 }, + { "config_base", "boolean", NULL, NULL, NULL, 0 }, + { "create", "boolean", NULL, NULL, NULL, 0 }, { "direct_io", "list", NULL, "choices=[\"checkpoint\",\"data\",\"log\"]", - NULL }, - { "error_prefix", "string", NULL, NULL, NULL }, + NULL, 0 }, + { "error_prefix", "string", NULL, NULL, NULL, 0 }, { "eviction", "category", NULL, NULL, - confchk_eviction_subconfigs }, + confchk_eviction_subconfigs, 2 }, { "eviction_dirty_target", "int", NULL, "min=10,max=99", - NULL }, - { "eviction_target", "int", NULL, "min=10,max=99", NULL }, - { "eviction_trigger", "int", NULL, "min=10,max=99", NULL }, - { "exclusive", "boolean", NULL, NULL, NULL }, - { "extensions", "list", NULL, NULL, NULL }, + NULL, 0 }, + { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 }, + { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 }, + { "exclusive", "boolean", NULL, NULL, NULL, 0 }, + { "extensions", "list", NULL, NULL, NULL, 0 }, { "file_extend", "list", NULL, "choices=[\"data\",\"log\"]", - NULL }, + NULL, 0 }, { "file_manager", "category", NULL, NULL, - confchk_file_manager_subconfigs }, - { "hazard_max", "int", NULL, "min=15", NULL }, - { "log", "category", NULL, NULL, confchk_log_subconfigs }, + confchk_file_manager_subconfigs, 2 }, + { "hazard_max", "int", NULL, "min=15", NULL, 0 }, + { "log", "category", NULL, NULL, confchk_log_subconfigs, 7 }, { "lsm_manager", "category", NULL, NULL, - confchk_lsm_manager_subconfigs }, - { "lsm_merge", "boolean", NULL, NULL, NULL }, - { "mmap", "boolean", NULL, NULL, NULL }, - { "multiprocess", "boolean", NULL, NULL, NULL }, - { "session_max", "int", NULL, "min=1", NULL }, - { "session_scratch_max", "int", NULL, NULL, NULL }, + confchk_lsm_manager_subconfigs, 2 }, + { "lsm_merge", "boolean", NULL, NULL, NULL, 0 }, + { "mmap", "boolean", NULL, NULL, NULL, 0 }, + { "multiprocess", "boolean", NULL, NULL, NULL, 0 }, + { "session_max", "int", NULL, "min=1", NULL, 0 }, + { "session_scratch_max", "int", NULL, NULL, NULL, 0 }, { "shared_cache", "category", NULL, NULL, - confchk_shared_cache_subconfigs }, + confchk_shared_cache_subconfigs, 4 }, { "statistics", "list", NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]", - NULL }, + NULL, 0 }, { "statistics_log", "category", NULL, NULL, - confchk_statistics_log_subconfigs }, + confchk_statistics_log_subconfigs, 5 }, { "transaction_sync", "category", NULL, NULL, - confchk_transaction_sync_subconfigs }, - { "use_environment_priv", "boolean", NULL, NULL, NULL }, + confchk_transaction_sync_subconfigs, 2 }, + { "use_environment_priv", "boolean", NULL, NULL, NULL, 0 }, { "verbose", "list", NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\"," "\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\"," "\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\"," "\"recovery\",\"salvage\",\"shared_cache\",\"split\"," "\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]", - NULL }, - { "version", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { "version", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = { - { "async", "category", NULL, NULL, confchk_async_subconfigs }, - { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL }, - { "cache_overhead", "int", NULL, "min=0,max=30", NULL }, - { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL }, + { "async", "category", + NULL, NULL, + confchk_async_subconfigs, 3 }, + { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 }, + { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 }, + { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, { "checkpoint", "category", NULL, NULL, - confchk_checkpoint_subconfigs }, - { "checkpoint_sync", "boolean", NULL, NULL, NULL }, + confchk_checkpoint_subconfigs, 3 }, + { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 }, { "direct_io", "list", NULL, "choices=[\"checkpoint\",\"data\",\"log\"]", - NULL }, - { "error_prefix", "string", NULL, NULL, NULL }, + NULL, 0 }, + { "error_prefix", "string", NULL, NULL, NULL, 0 }, { "eviction", "category", NULL, NULL, - confchk_eviction_subconfigs }, + confchk_eviction_subconfigs, 2 }, { "eviction_dirty_target", "int", NULL, "min=10,max=99", - NULL }, - { "eviction_target", "int", NULL, "min=10,max=99", NULL }, - { "eviction_trigger", "int", NULL, "min=10,max=99", NULL }, - { "extensions", "list", NULL, NULL, NULL }, + NULL, 0 }, + { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 }, + { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 }, + { "extensions", "list", NULL, NULL, NULL, 0 }, { "file_extend", "list", NULL, "choices=[\"data\",\"log\"]", - NULL }, + NULL, 0 }, { "file_manager", "category", NULL, NULL, - confchk_file_manager_subconfigs }, - { "hazard_max", "int", NULL, "min=15", NULL }, - { "log", "category", NULL, NULL, confchk_log_subconfigs }, + confchk_file_manager_subconfigs, 2 }, + { "hazard_max", "int", NULL, "min=15", NULL, 0 }, + { "log", "category", NULL, NULL, confchk_log_subconfigs, 7 }, { "lsm_manager", "category", NULL, NULL, - confchk_lsm_manager_subconfigs }, - { "lsm_merge", "boolean", NULL, NULL, NULL }, - { "mmap", "boolean", NULL, NULL, NULL }, - { "multiprocess", "boolean", NULL, NULL, NULL }, - { "session_max", "int", NULL, "min=1", NULL }, - { "session_scratch_max", "int", NULL, NULL, NULL }, + confchk_lsm_manager_subconfigs, 2 }, + { "lsm_merge", "boolean", NULL, NULL, NULL, 0 }, + { "mmap", "boolean", NULL, NULL, NULL, 0 }, + { "multiprocess", "boolean", NULL, NULL, NULL, 0 }, + { "session_max", "int", NULL, "min=1", NULL, 0 }, + { "session_scratch_max", "int", NULL, NULL, NULL, 0 }, { "shared_cache", "category", NULL, NULL, - confchk_shared_cache_subconfigs }, + confchk_shared_cache_subconfigs, 4 }, { "statistics", "list", NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]", - NULL }, + NULL, 0 }, { "statistics_log", "category", NULL, NULL, - confchk_statistics_log_subconfigs }, + confchk_statistics_log_subconfigs, 5 }, { "transaction_sync", "category", NULL, NULL, - confchk_transaction_sync_subconfigs }, + confchk_transaction_sync_subconfigs, 2 }, { "verbose", "list", NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\"," "\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\"," "\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\"," "\"recovery\",\"salvage\",\"shared_cache\",\"split\"," "\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]", - NULL }, - { "version", "string", NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { "version", "string", NULL, NULL, NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = { - { "async", "category", NULL, NULL, confchk_async_subconfigs }, - { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL }, - { "cache_overhead", "int", NULL, "min=0,max=30", NULL }, - { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL }, + { "async", "category", + NULL, NULL, + confchk_async_subconfigs, 3 }, + { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 }, + { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 }, + { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 }, { "checkpoint", "category", NULL, NULL, - confchk_checkpoint_subconfigs }, - { "checkpoint_sync", "boolean", NULL, NULL, NULL }, + confchk_checkpoint_subconfigs, 3 }, + { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 }, { "direct_io", "list", NULL, "choices=[\"checkpoint\",\"data\",\"log\"]", - NULL }, - { "error_prefix", "string", NULL, NULL, NULL }, + NULL, 0 }, + { "error_prefix", "string", NULL, NULL, NULL, 0 }, { "eviction", "category", NULL, NULL, - confchk_eviction_subconfigs }, + confchk_eviction_subconfigs, 2 }, { "eviction_dirty_target", "int", NULL, "min=10,max=99", - NULL }, - { "eviction_target", "int", NULL, "min=10,max=99", NULL }, - { "eviction_trigger", "int", NULL, "min=10,max=99", NULL }, - { "extensions", "list", NULL, NULL, NULL }, + NULL, 0 }, + { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 }, + { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 }, + { "extensions", "list", NULL, NULL, NULL, 0 }, { "file_extend", "list", NULL, "choices=[\"data\",\"log\"]", - NULL }, + NULL, 0 }, { "file_manager", "category", NULL, NULL, - confchk_file_manager_subconfigs }, - { "hazard_max", "int", NULL, "min=15", NULL }, - { "log", "category", NULL, NULL, confchk_log_subconfigs }, + confchk_file_manager_subconfigs, 2 }, + { "hazard_max", "int", NULL, "min=15", NULL, 0 }, + { "log", "category", NULL, NULL, confchk_log_subconfigs, 7 }, { "lsm_manager", "category", NULL, NULL, - confchk_lsm_manager_subconfigs }, - { "lsm_merge", "boolean", NULL, NULL, NULL }, - { "mmap", "boolean", NULL, NULL, NULL }, - { "multiprocess", "boolean", NULL, NULL, NULL }, - { "session_max", "int", NULL, "min=1", NULL }, - { "session_scratch_max", "int", NULL, NULL, NULL }, + confchk_lsm_manager_subconfigs, 2 }, + { "lsm_merge", "boolean", NULL, NULL, NULL, 0 }, + { "mmap", "boolean", NULL, NULL, NULL, 0 }, + { "multiprocess", "boolean", NULL, NULL, NULL, 0 }, + { "session_max", "int", NULL, "min=1", NULL, 0 }, + { "session_scratch_max", "int", NULL, NULL, NULL, 0 }, { "shared_cache", "category", NULL, NULL, - confchk_shared_cache_subconfigs }, + confchk_shared_cache_subconfigs, 4 }, { "statistics", "list", NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]", - NULL }, + NULL, 0 }, { "statistics_log", "category", NULL, NULL, - confchk_statistics_log_subconfigs }, + confchk_statistics_log_subconfigs, 5 }, { "transaction_sync", "category", NULL, NULL, - confchk_transaction_sync_subconfigs }, + confchk_transaction_sync_subconfigs, 2 }, { "verbose", "list", NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\"," "\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\"," "\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\"," "\"recovery\",\"salvage\",\"shared_cache\",\"split\"," "\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]", - NULL }, - { NULL, NULL, NULL, NULL, NULL } + NULL, 0 }, + { NULL, NULL, NULL, NULL, NULL, 0 } }; static const WT_CONFIG_ENTRY config_entries[] = { { "colgroup.meta", "app_metadata=,collator=,columns=,source=,type=file", - confchk_colgroup_meta + confchk_colgroup_meta, 5 }, { "connection.add_collator", "", - NULL + NULL, 0 }, { "connection.add_compressor", "", - NULL + NULL, 0 }, { "connection.add_data_source", "", - NULL + NULL, 0 }, { "connection.add_extractor", "", - NULL + NULL, 0 }, { "connection.async_new_op", "append=0,overwrite=,raw=0,timeout=1200", - confchk_connection_async_new_op + confchk_connection_async_new_op, 4 }, { "connection.close", "leak_memory=0", - confchk_connection_close + confchk_connection_close, 1 }, { "connection.load_extension", "config=,entry=wiredtiger_extension_init," "terminate=wiredtiger_extension_terminate", - confchk_connection_load_extension + confchk_connection_load_extension, 3 }, { "connection.open_session", "isolation=read-committed", - confchk_connection_open_session + confchk_connection_open_session, 1 }, { "connection.reconfigure", "async=(enabled=0,ops_max=1024,threads=2),cache_overhead=8," @@ -680,15 +720,15 @@ static const WT_CONFIG_ENTRY config_entries[] = { "statistics=none,statistics_log=(on_close=0," "path=\"WiredTigerStat.%d.%H\",sources=," "timestamp=\"%b %d %H:%M:%S\",wait=0),verbose=", - confchk_connection_reconfigure + confchk_connection_reconfigure, 16 }, { "cursor.close", "", - NULL + NULL, 0 }, { "cursor.reconfigure", "append=0,overwrite=", - confchk_cursor_reconfigure + confchk_cursor_reconfigure, 2 }, { "file.meta", "allocation_size=4KB,app_metadata=,block_allocation=best," @@ -702,32 +742,32 @@ static const WT_CONFIG_ENTRY config_entries[] = { "prefix_compression_min=4,split_deepen_min_child=0," "split_deepen_per_child=0,split_pct=75,value_format=u," "version=(major=0,minor=0)", - confchk_file_meta + confchk_file_meta, 35 }, { "index.meta", "app_metadata=,collator=,columns=,extractor=,immutable=0," "index_key_columns=,key_format=u,source=,type=file,value_format=u", - confchk_index_meta + confchk_index_meta, 10 }, { "session.begin_transaction", "isolation=,name=,priority=0,snapshot=,sync=", - confchk_session_begin_transaction + confchk_session_begin_transaction, 5 }, { "session.checkpoint", "drop=,force=0,name=,target=", - confchk_session_checkpoint + confchk_session_checkpoint, 4 }, { "session.close", "", - NULL + NULL, 0 }, { "session.commit_transaction", "", - NULL + NULL, 0 }, { "session.compact", "timeout=1200", - confchk_session_compact + confchk_session_compact, 1 }, { "session.create", "allocation_size=4KB,app_metadata=,block_allocation=best," @@ -744,62 +784,62 @@ static const WT_CONFIG_ENTRY config_entries[] = { "prefix_compression=0,prefix_compression_min=4,source=," "split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75," "type=file,value_format=u", - confchk_session_create + confchk_session_create, 38 }, { "session.drop", "force=0,remove_files=", - confchk_session_drop + confchk_session_drop, 2 }, { "session.log_printf", "", - NULL + NULL, 0 }, { "session.open_cursor", "append=0,bulk=0,checkpoint=,dump=,next_random=0,overwrite=,raw=0" ",readonly=0,skip_sort_check=0,statistics=,target=", - confchk_session_open_cursor + confchk_session_open_cursor, 11 }, { "session.reconfigure", "isolation=read-committed", - confchk_session_reconfigure + confchk_session_reconfigure, 1 }, { "session.rename", "", - NULL + NULL, 0 }, { "session.rollback_transaction", "", - NULL + NULL, 0 }, { "session.salvage", "force=0", - confchk_session_salvage + confchk_session_salvage, 1 }, { "session.snapshot", "drop=(to=),name=", - confchk_session_snapshot + confchk_session_snapshot, 2 }, { "session.strerror", "", - NULL + NULL, 0 }, { "session.truncate", "", - NULL + NULL, 0 }, { "session.upgrade", "", - NULL + NULL, 0 }, { "session.verify", "dump_address=0,dump_blocks=0,dump_offsets=,dump_pages=0," "dump_shape=0", - confchk_session_verify + confchk_session_verify, 5 }, { "table.meta", "app_metadata=,colgroups=,collator=,columns=,key_format=u," "value_format=u", - confchk_table_meta + confchk_table_meta, 6 }, { "wiredtiger_open", "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," @@ -818,7 +858,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { "path=\"WiredTigerStat.%d.%H\",sources=," "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0" ",method=fsync),use_environment_priv=0,verbose=", - confchk_wiredtiger_open + confchk_wiredtiger_open, 32 }, { "wiredtiger_open_all", "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," @@ -838,7 +878,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0" ",method=fsync),use_environment_priv=0,verbose=,version=(major=0," "minor=0)", - confchk_wiredtiger_open_all + confchk_wiredtiger_open_all, 33 }, { "wiredtiger_open_basecfg", "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," @@ -856,7 +896,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { "path=\"WiredTigerStat.%d.%H\",sources=," "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0" ",method=fsync),verbose=,version=(major=0,minor=0)", - confchk_wiredtiger_open_basecfg + confchk_wiredtiger_open_basecfg, 29 }, { "wiredtiger_open_usercfg", "async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1," @@ -874,9 +914,9 @@ static const WT_CONFIG_ENTRY config_entries[] = { "path=\"WiredTigerStat.%d.%H\",sources=," "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0" ",method=fsync),verbose=", - confchk_wiredtiger_open_usercfg + confchk_wiredtiger_open_usercfg, 28 }, - { NULL, NULL, NULL } + { NULL, NULL, NULL, 0 } }; int diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index f60ca6e1372..95a70dffba4 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -1555,7 +1555,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, WT_FHANDLE_WRITE)); +err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_WRITE)); WT_TRET(__wt_remove_if_exists(session, WT_BASECONFIG_SET)); return (ret); @@ -1595,8 +1595,10 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, WT_CONFIG_ITEM cval, sval; WT_CONNECTION_IMPL *conn; + WT_DECL_ITEM(i1); + WT_DECL_ITEM(i2); + WT_DECL_ITEM(i3); WT_DECL_RET; - WT_ITEM i1, i2, i3; const WT_NAME_FLAG *ft; WT_SESSION_IMPL *session; @@ -1608,14 +1610,6 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, conn = NULL; session = NULL; - /* - * We could use scratch buffers, but I'd rather the default session - * not tie down chunks of memory past the open call. - */ - WT_CLEAR(i1); - WT_CLEAR(i2); - WT_CLEAR(i3); - WT_RET(__wt_library_init()); WT_RET(__wt_calloc_one(NULL, &conn)); @@ -1670,12 +1664,15 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, * Clear the entries we added to the stack, we're going to build it in * order. */ + WT_ERR(__wt_scr_alloc(session, 0, &i1)); + WT_ERR(__wt_scr_alloc(session, 0, &i2)); + WT_ERR(__wt_scr_alloc(session, 0, &i3)); cfg[0] = WT_CONFIG_BASE(session, wiredtiger_open_all); cfg[1] = NULL; - WT_ERR(__conn_config_file(session, WT_BASECONFIG, 0, cfg, &i1)); + WT_ERR(__conn_config_file(session, WT_BASECONFIG, 0, cfg, i1)); __conn_config_append(cfg, config); - WT_ERR(__conn_config_file(session, WT_USERCONFIG, 1, cfg, &i2)); - WT_ERR(__conn_config_env(session, cfg, &i3)); + WT_ERR(__conn_config_file(session, WT_USERCONFIG, 1, cfg, i2)); + WT_ERR(__conn_config_env(session, cfg, i3)); /* * Configuration ... @@ -1801,10 +1798,19 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, WT_STATIC_ASSERT(offsetof(WT_CONNECTION_IMPL, iface) == 0); *wt_connp = &conn->iface; -err: /* Discard the configuration strings. */ - __wt_buf_free(session, &i1); - __wt_buf_free(session, &i2); - __wt_buf_free(session, &i3); +err: /* Discard the scratch buffers. */ + __wt_scr_free(session, &i1); + __wt_scr_free(session, &i2); + __wt_scr_free(session, &i3); + + /* + * We may have allocated scratch memory when using the dummy session or + * the subsequently created real session, and we don't want to tie down + * memory for the rest of the run in either of them. + */ + if (session != &conn->dummy_session) + __wt_scr_discard(session); + __wt_scr_discard(&conn->dummy_session); if (ret != 0) WT_TRET(__wt_connection_close(conn)); diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c index 63180d64019..385280116a6 100644 --- a/src/conn/conn_dhandle.c +++ b/src/conn/conn_dhandle.c @@ -649,7 +649,7 @@ __wt_conn_dhandle_close_all( WT_ASSERT(session, session->dhandle == NULL); bucket = __wt_hash_city64(name, strlen(name)) % WT_HASH_ARRAY_SIZE; - SLIST_FOREACH(dhandle, &conn->dhhash[bucket], l) { + SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) { if (strcmp(dhandle->name, name) != 0) continue; diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c index 0d008939d8c..5b8d685bbc1 100644 --- a/src/conn/conn_stat.c +++ b/src/conn/conn_stat.c @@ -166,7 +166,7 @@ __statlog_dump(WT_SESSION_IMPL *session, const char *name, int conn_stats) sizeof(WT_DSRC_STATS) / sizeof(WT_STATS); for (i = 0, stats = WT_CURSOR_STATS(cursor); i < max; ++i, ++stats) - WT_ERR(__wt_fprintf(session, conn->stat_fp, + WT_ERR(__wt_fprintf(conn->stat_fp, "%s %" PRIu64 " %s %s\n", conn->stat_stamp, stats->v, name, stats->desc)); @@ -300,7 +300,7 @@ __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, WT_FHANDLE_APPEND)); + WT_RET(__wt_fclose(&log_file, WT_FHANDLE_APPEND)); if (path != NULL) (void)strcpy(path->mem, tmp->mem); WT_RET(__wt_fopen(session, @@ -344,7 +344,7 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp) WT_RET(__statlog_lsm_apply(session)); /* Flush. */ - return (__wt_fflush(session, conn->stat_fp)); + return (__wt_fflush(conn->stat_fp)); } /* @@ -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, WT_FHANDLE_APPEND)); + WT_TRET(__wt_fclose(&conn->stat_fp, WT_FHANDLE_APPEND)); conn->stat_path = NULL; conn->stat_sources = NULL; conn->stat_stamp = NULL; diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c index 5b47c2c1a73..a201477abe3 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, WT_FHANDLE_WRITE)); + WT_TRET(__wt_fclose(&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, WT_FHANDLE_WRITE)); + WT_TRET(__wt_fclose(&cb->bfp, WT_FHANDLE_WRITE)); if (ret != 0) { WT_TRET(__backup_cleanup_handles(session, cb)); WT_TRET(__backup_stop(session)); @@ -347,7 +347,7 @@ __backup_all(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb) while ((ret = cursor->next(cursor)) == 0) { WT_ERR(cursor->get_key(cursor, &key)); WT_ERR(cursor->get_value(cursor, &value)); - WT_ERR(__wt_fprintf(session, cb->bfp, "%s\n%s\n", key, value)); + WT_ERR(__wt_fprintf(cb->bfp, "%s\n%s\n", key, value)); /* * While reading the metadata file, check there are no "sources" @@ -495,7 +495,7 @@ __wt_backup_list_uri_append( /* Add the metadata entry to the backup file. */ WT_RET(__wt_metadata_search(session, name, &value)); - WT_RET(__wt_fprintf(session, cb->bfp, "%s\n%s\n", name, value)); + WT_RET(__wt_fprintf(cb->bfp, "%s\n%s\n", name, value)); __wt_free(session, value); /* Add file type objects to the list of files to be copied. */ diff --git a/src/cursor/cur_json.c b/src/cursor/cur_json.c index 67daf377f88..d793db778c6 100644 --- a/src/cursor/cur_json.c +++ b/src/cursor/cur_json.c @@ -577,9 +577,9 @@ __wt_json_token(WT_SESSION *wt_session, const char *src, int *toktype, } /* - * __wt_json_tokname + * __wt_json_tokname -- * Return a descriptive name from the token type returned by - * __wt_json_token + * __wt_json_token. */ const char * __wt_json_tokname(int toktype) diff --git a/src/cursor/cur_log.c b/src/cursor/cur_log.c index 5de3762217f..b7f11576425 100644 --- a/src/cursor/cur_log.c +++ b/src/cursor/cur_log.c @@ -14,7 +14,8 @@ */ static int __curlog_logrec(WT_SESSION_IMPL *session, - WT_ITEM *logrec, WT_LSN *lsnp, void *cookie, int firstrecord) + WT_ITEM *logrec, WT_LSN *lsnp, WT_LSN *next_lsnp, + void *cookie, int firstrecord) { WT_CURSOR_LOG *cl; @@ -23,8 +24,7 @@ __curlog_logrec(WT_SESSION_IMPL *session, /* Set up the LSNs and take a copy of the log record for the cursor. */ *cl->cur_lsn = *lsnp; - *cl->next_lsn = *lsnp; - cl->next_lsn->offset += (wt_off_t)logrec->size; + *cl->next_lsn = *next_lsnp; WT_RET(__wt_buf_set(session, cl->logrec, logrec->data, logrec->size)); /* diff --git a/src/docs/changelog.md b/src/docs/changelog.md new file mode 100644 index 00000000000..d910f359549 --- /dev/null +++ b/src/docs/changelog.md @@ -0,0 +1,2181 @@ +WiredTiger Change Log +===================== + +WiredTiger release 2.5.2, 2015-03-23 +------------------------------------ + +The WiredTiger 2.5.2 release contains important bug fixes. + +API changes: + +* Allow memory_page_max to be at most a quater of the cache size not half. + This avoids operations getting stalled due to the cache being filled with + one or two pages. + +Bug fixes and other important changes: + +* When skipping a dirty page during a checkpoint, make sure the tree is marked + dirty. + refs SUPPORT-1248, SERVER-17319, SERVER-17506, #1404, #1643, #1721, #1735 + +* Fix a bug in range truncate where we could remove the wrong records. + refs SERVER-17345 + +* Fix a bug in LSM management where we could let the cache get full - leading + to a operations being blocked. + refs #1720 + +* Fix several bugs in the checkpoint implementation that could lead to a tree + being marked clean when it had updates in memory. If shutdown occurred at + a specific time those updates would be discarded without being written. + refs SUPPORT-1248 + +* Fix some bugs in logging - where system crashes could leave empty files that + would stop recovery working on re-start. + refs #1717, #1719, SERVER-17451 + +* Fix a bug in recovery. Force recovery instead of returning an error if the + LSN given doesn't exist. + refs #1700, #1704 + +* Move writing into log worker thread to avoid latency in application threads. + refs #1683 + +* Fix a bug in the reconfigure API related to adhering to shared cache quotas. + refs #1712, #1713 + +* Fix a bug in WiredTiger statistics where we weren't recording overflow + record statistics. + refs #1520, #1703, #1711 + +* Several enhancements to eviction of large pages including: + - Don't do forced eviction of a page if it is the current walk point. + - Don't update the read generation on page in if it's set to oldest. + - Clear the walk positions before the eviction server sleeps. + - Reverse the direction of the LRU walk regularly. + - Add all pages that would block to the eviction queue. + - If evicting dirty pages use the worker threads not the server. + refs #1706 + +* Use raw mode when dumping indices. + refs #1709 + +* Fix a bug where we could race opening files while a WT_CONNECTION::close is + in progress. + refs SERVER-17319 + +* Fix a bug in LSM where snapshot transaction updates could have the wrong + visibility check applied. Leading to invalid updates. + refs #1641, #1701, #1702 + +* Fix a bug in checkpoint where it could get an EBUSY return unnecessarily. + refs #1404, #1589, #1705 + +* Fix a bug when writing a page from memory to disk (reconciling). We could + overwrite the end of a temporary buffer in some cases. + refs #1697, #1699 + +* Sometimes we would choose a sub-optimal layout for on disk pages when + writing them out from memory. + refs #1699 + +* Improve the performance of in-memory lookups by making the content of the + page structure more cache friendly. + + +WiredTiger release 2.5.1, 2015-03-07 +------------------------------------ + +The WiredTiger 2.5.1 release contains new features, minor API changes and many +bug fixes. + +New features and API changes: + +* Add a new "log=(recover=on)" option to ::wiredtiger_open. The default value + is "on", if set to "error", recovery won't be run on startup. An error will be + returned if recovery is needed but disabled. This option is mainly to support + the WiredTiger command line utility. + refs #1651 + +* Add a new WT_CURSOR::equals method that returns when the cursors are equal, + intended as a fast-path for cursor comparison. + +* Change how statistics work when there are checkpoints for an object. We + used to aggregate statistics for all open checkpoints and the current + handle. We now only return statistics for the object being queried. See + upgrading documentation for further information. + +* Add a mode to LSM that allows us to limit the size of a tree by dropping + old chunks. Enabled via "lsm=(chunk_count_limit=0)", default to 0 which + disables the functionality. Note that enabling this feature discards old + data automatically. + refs #1652 + +* Update the WiredTiger printlog command line utility to generate JSON that + can be parsed by third party tools. + Refs #1438 + +* Change how we track memory allocation overhead. We used to apply a fixed + size for each allocation (which was difficult to track). The overhead + can be specified via a new configuration option to ::wiredtiger_open using + "cache_overhead=8". The value is a percentage and the default is 8. + refs #1564 #1565 + +* Major enhancements to the wtstats.py tool that translates WiredTiger + statistics into an HTML graph. The tool now generates interactive graphs + and no longer requires third party Python libraries to be installed. + +* Add a new WT_CURSOR::reconfigure method for cursor configuration. + See API documentation for more information. + refs #1381 + +* Add a new WT_SESSION.strerror method, a thread-safe alternative to + ::wiredtiger_strerror. + refs #1516 + +Bug fixes for bugs that could cause data inconsistency: + +* Fix a bug in recovery where we could lose track of file identifiers and + apply updates to the wrong file. + Refs SERVER-17142 SERVER-17131 + +* Fix several bugs in data consistency that could cause corruption when + restarting after a hard crash, including: + - A bug in table create that could cause recovery to fail. + refs SERVER-17204 + +Other significant changes: + +* Significant tuning enhancements for the WiredTiger cache, including: + + - Avoiding stalls due to evicting large pages + - Better algorithms for getting application threads to help with cache + management without interfering with operation latencies. + - Better algorithms for maintaining the cache when there are a few very hot + pages (e.g: append workloads). SERVER-17344 + - Freeing obsolete references more aggressively, which saves space and + reduces traversal overhead when there are lots of updates or deletes. + refs SERVER-17195, #1647 + - Fix a bug that could cause a data loss if we split a large page into + multiple smaller pages and attempted to evict the page at the same time. + refs #1583 #1563 SERVER-16868 + +* Significant improvements to the cursor truncate implementation, + especially for workloads that periodically truncate from the start of + the file. + refs SERVER-17141 + +* Fix a bug in eviction where reconfiguring the number of eviction threads + could result in a segfault. + refs SERVER-17293 + +* Significant bug fixes and performance enhancements to the logging subsystem + including: + - Avoid yielding excessively to avoid CPU overhead when there are many + active sessions. + refs #1610 + - The log close thread needs to wait for outstanding writes. #1571 + - Create a new utility thread to close and fsync log files. #1560 + - Ensure that log files are closed in sequence. #1555 + - Ensure that log file create appears atomic. #1482 + - Fix a race between connection close and switching log files that could + lead to a new log file being in an undefined state. #1480 + +* Added support for advanced options to the WiredTiger verify command line + tool. + +* Fix a bug in our conflict detection algorithm, where we were failing to + detect some write-write conflicts in no-overwrite cursors. + refs SERVER-16351 + +* Significant bug fixes when writing pages to disk, including: + - Stop double count the on-disk header when choosing split points. Refs #1655 + - Fill the first and second pages as much as possible when splitting. + refs #1282 + - Improve the algorithm for fitting large items onto pages when splitting. + refs #1630 #1631 + - Fix a bug when using raw compression where we could overflow allocated + memory. + refs SERVER-16664 + +* Fix several cases where WT_SESSION::verify and WT_SESSION::salvage could + return EBUSY unnecessarily. + Refs #1404 SERVER-16457 + +* Fix a bug where racing between discarding and updating a tree returned an + error to the application. + refs #1618 SERVER-17048 + +* Fix a bug where opening a statistics cursor in parallel with a checkpoint + could lead to a deadlock. + refs #1575 SERVER-16738 + +* Change the shared cache implementation to use cache read pressure rather + than write pressure to determine how best to share memory (as checkpoints + skew write pressure as a metric). + refs #1569 + +* Fix a bug where a deadlock could occur if a checkpoint starts in parallel to + compact operations. + refs #1589 SERVER-16967 + +* Fix a bug in how we parse Huffman-encoding configuration settings during + WT_SESSION::create. + refs #1417 #1536 + +* Fix a bug where the custom extractor terminate callback was being made twice. + refs #1503 + +* Add a new mode to the eviction server where it writes out some pages even + though the eviction triggers have not yet been reached. + +* Fix several issues reported by COVERITY static analysis tool. + +WiredTiger release 2.5.0, 2014-12-24 +------------------------------------ + +The WiredTiger 2.5.0 release contains significant new features, API changes +and many bug fixes. + +Now that WiredTiger is part of MongoDB, we are tracking issues related to +MongoDB usage of WiredTiger in the MongoDB JIRA system. Some entries in +the changelog now reference JIRA tickets that can be found at: + + http://jira.mongodb.org + +New features and API changes: + +* Add support for storing large values on-page in a btree rather than in + an overflow item. This is useful for workloads that want to keep large + items in cache - since WiredTiger overflow items are never cached. + It is configured via new `leaf_value_max` configuration setting. This + enhancement led to the deprecation of internal_item_max and leaf_item_max + configuration settings, see upgrading documentation for further + information. [#1282] + +* Add support for compressing log files. When configured each compressable + log record will be compressed. This is configure with the + `log=(compressor=X)` configuration setting. See upgrading documentation + for further information. [#1359] + +* No longer return EBUSY when opening a bulk cursor, verifying or salvaging + a database if a checkpoint is currently running. This allows + applications to do these exclusive operations without shutting down the + checkpoint server thread. [#1397] [#1404] SERVER-16236 SERVER-16457 + +* Add support for immutable indexes. [#1344] + +* Added several new statistics, improved accuracy for some statistics + tracking and simplified mechanism for querying a particular statistic. + [#1505] + +* Have the eviction server write out unnecessary pages prior to the cache + reaching the configured eviction trigger size. This can reduce the + amount of eviction application threads do when configured with a large + cache. + +* Several enhancements to managing how long we keep files open + +* Revert a change in the 2.4.1 release that caused the WT_ROLLBACK (and + deprecated WT_DEADLOCK) error return to map to different numeric values. + Applications should ensure they are compiling against the same version + of the wiredtiger.h header file as the library they link against, + otherwise odd behavior will be experienced. + +* Support setting configuration strings to "none" as being equivalent to an + empty string in most cases. [#1417] + +* Enhance the hot backup implementation to allow recovery to be run between + incremental backups. [#1183] + +Other significant changes: + +* Improve performance of cursor open when there are many tables in a database. + [#1391] [#1443] + +* Reduce the impact checkpoints have on concurrent operations. This was + done by changing how we lock tables. [#1391] [#1392] + +* Improve performance when scanning a table that has many deleted items. + SERVER-16247 + +* Fix a bug in checkpoint, where the metadata (turtle) file wasn't being + synced on checkpoint. [#1383] + +* Fix a bug where WiredTiger could accumulate memory during page splits and + never free it. SERVER-16546 + +* Many enhancements and bug fixes for Windows. + +* Fix a bug where a custom extractor terminate was being called twice. + [#1503] + +* Fix a bug where a race between closing a handle and checkpointing could + lead to errors. [#1495] [#1497] + +* Validate the block header checksum before we clear it - if the checksum + field had been corrupted, we didn't notice. SERVER-16457 + +* Fix a bug in write conflict detection. Cursors configured with + no-overwrite could sometimes not see update conflicts for deleted + records. SERVER-16351 + +* Several bug fixes and performance improvements in LSM including: + - Add support for custom collators in LSM trees. [#1361] + - Fix a bug in LSM search_near, where it returned a deleted item. + BF-694, BF-700 + - Improve background maintenance operations so that the cache does + not get full unnecessarily. + - Fix a bug that could lead to updates being written into old chunks. + [#1432] [#1418] + - Fix a bug in background merge that could skip updates. SERVER-16123 + +* Fix a bug when maintaining the cache, that could cause checkpoints to + skip writing an update that should have been included. [#1419] SERVER-16336 + +* Fix a bug in WT_SESSION::drop, where failures generated error output even + when force was specified. [#1436] + +* Fix a bug in WiredTiger integer packing code when figuring out how much + space is required for a value (it can shrink as numbers grow). SERVER-16118 + +* Several enhancements to the wtstats.py tool that generates graphs from + standard WiredTiger statistics logs. [#1365] + +* Fix a bug on OS X where fsync isn't sufficient to flush a file, use + fcntl(F_FULLFSYNC) instead. + +* Work around a bug in clang 3.5.0 compare and swap primitive. The + __sync_bool_compare_and_swap version of the API in clang produces bad + code for us with -O3 optimization enabled. + + +WiredTiger release 2.4.1, 2014-11-06 +------------------------------------ + +The WiredTiger 2.4.1 release contains several new features, many bug fixes +and performance enhancements. + +New features and API changes: + +* Add new custom extractor functionality to WiredTiger indexes. Allowing an + application to define mutated and/or multiple keys for indexes. [#1199] + +* Add a new WT_SESSION::transaction_pinned_range method that allows users + to identify when a session is keeping a transaction ID pinned for a long + time. [#1314] + +* Enhance statistics output so that keys are more clearly categorized. [#1313] + +* Rename WT_DEADLOCK error return to WT_ROLLBACK. WiredTiger uses the return + in cases other than traditional application deadlock. The old value is + retained as an alias to maintain backward compatability. [#1204] + +* Increase the maximum configurable cache size to 100GB. + +Other significant changes: + +* Improve support for building on Windows platforms. [#1342] + +* Fix a bug where WiredTiger could race closing handles. [#1336] + +* Enhance performance when hot pages in cache are growing rapidly. [#1317] + +* Fix a bug in recovery, where log files that are zero extended could + result in some log records being skipped. [#1334] + +* Updates to the Java API to improve documentation and exception handling. + [#1295] + +* Improve support for building on Oracle Solaris platform [#1329] + +* Fix a bug where closing a handle could leave the tree in an inconsistent + state on failure. [#1316] + +* Several bug fixes and improvements to LSM including: + - Improving algorithm for switching the in-memory chunk. + - Fixing a bug related to dropping obsolete chunks. [#1304] + +* Fix a bug in schema level operations (table create, drop, etc). If there + was an explicit transaction running when the operation was performed that + was subsequently rolled back the object could be left in an inconsistent + state. + +* Several enhancements to cache management when there are long running + transactions present. + + +WiredTiger release 2.4.0, 2014-10-15 +------------------------------------ + +The WiredTiger 2.4.0 release contains significant new features, API changes +and many bug fixes. + +New features and API changes: + +* Cursors keep their position across transaction boundaries. That is + WT_SESSION::begin_transaction and WT_SESSION::commit_transaction no longer + reset cursors. [#1181] + +* Change cursor behavior so that when an operation returns WT_NOTFOUND, the + cursor is now left pointing to the original key/value pair. [#1209] + +* Initial support for building WiredTiger on Windows. + +* Add ability to customize a collator for specific data sources or with + application managed metadata. See upgrading documentation for more + information. [#1165] + +* Enhance extension mechanism in WiredTiger to support loading extensions from + the application binary - not just a separate library. [#1174] + +* Replace WT_SESSION::create "lsm=(merge_threads)" configuration option with + ::wiredtiger_open "lsm_manager=(worker_thread_max)". See upgrading documentation + for more information. + +* Enhancements to the WiredTiger Python API build process. [#1188] + +* Add ability to dump and load WiredTiger databases in JSON format. [#1154] + +* Add ability to automatically checkpoint based on the volume of log records + generated since the last checkpoint. This is enabled using the + ::wiredtiger_open configuration option "checkpoint=(log_size=size)" [#1170] + +* Enhance functionality allowing users to write content into the WiredTiger + transaction log. [#1171][#1175] + +* Enhance the WiredTiger HyperLevelDB implementation to support log replay. + [#1106][#1155] + +Other significant changes: + +* Fix several bugs in the shared cache implementation. [#1180][#1176] + +* Fix a bug where the public URI field in a cursor did not match the string + passed to WT_SESSION::open_cursor. [#1235] + +* Fix several bugs in salvage. [#1222][#1169] + +* Several bug fixes and enhancements for WT_CONNECTION::reconfigure. + [#1214][#1172] + +* Fix several bugs in raw compression implementation, particularly for data + that compresses extremely well. [#1191] + +* Several bug fixes and enhancements to WiredTiger LevelDB interface. + +* Switch default build from using adaptive pthread mutexes to default pthread + mutexes. + + +WiredTiger release 2.3.1, 2014-08-14 +------------------------------------ + +The WiredTiger 2.3.1 release contains mainly performance enhancements and bug +fixes. + +Changes to the WiredTiger API: + +* Fix a bug in WT_CURSOR::set_value that could lead to undefined behavior with + some value formats. + +* Make the asynchronous API generally available [#1139] + +* Add log cursors for replay and verification. Make generated log record and + operation types public. [#1106] + +* Allow eviction worker threads to be started and stopped dynamically. + Applications that use the `eviction_workers` configuration should see the + upgrading documentation on how to use this feature. + [#1116, #1143, #1158] + +Other significant changes: + +* Improve performance and reduce latency during checkpoints and LSM merges. + Remove uses of the checkpoint lock other than serializing checkpoints: + compact holds the schema lock, so it doesn't need to hold the checkpoint + lock, the new WT_BTREE handle close lock prevents checkpoints from colliding + with handle close, so LSM doesn't need the checkpoint lock either. + +* Some minor cleanups, setting the internal session's name in a few places. + [#1073] + +* Grab the live lock when loading a checkpoint in diagnostic mode: that could + race with a read. [#1102] + +* Instead of keeping a list of file URIs for checkpoint to flush, open a handle + and stash it. [#1114] + +* Add a new OS-layer function __wt_fsync_async to flush a file without waiting + for the results, call it from the Btree flush-leaves code so pages start + flushing while we're working the rest of the checkpoint. [#1136, #1152] + +* Wait for the handle flush lock when writing the leaf pages instead of + returning EBUSY. [#1136] + +* Add a wtperf page to the documentation, describe how to simulate workloads + and view statistics. [#1147] + +* Flag new structures not listed in PREDEFINE. [#1148] + +* Return EBUSY if no async handles available and fix ex_async to look for it. + [#1153] + +* Fix some problems with navigation in the reference guide. + +* Bump the number of slots for internal sessions: we have a lot more than 2 + now. Add a test for `session_max` settings, make sure we add enough to + account for at least the default internal sessions. + +* Remove tcbench: we're no longer maintaining it. + + +WiredTiger release 2.3.0, 2014-07-29 +------------------------------------ + +The WiredTiger 2.3.0 release contains significant new features, performance +enhancements and bug fixes. Significant changes are described below. + +Changes to the WiredTiger API (see upgrading documentation for details): + +* Add a LevelDB API implementation for WiredTiger. This includes support for + stock LevelDB as well as Basho, HyperLevelDB and RocksDB versions of the API. + To build the LevelDB API include --enable-leveldb in the configure command, + to specify compatability with an alternative LevelDB API use + --enable-leveldb=[basho,hyper,rocksdb]. [#1028] + +* Add ability to build some common extensions into the WiredTiger library. + This means that the libraries for those extensions don't need to be + dynamically loaded at runtime. Currently supported extensions are Snappy + compression and zlib compression. The option can be enabled by passing + --with-builtins=[snappy,zlib] to the configure command line. + +* Add a new configuration to wiredtiger_open: statistics_log=(on_close=true), + that causes a set of statistics to be logged on WT_CONNECTION::close. [#1086] + +* Add a new configuration to wiredtiger_open: exclusive, that causes the open + to fail if the database already exists. + +Other significant changes: + +* Performance improvement for high throughput workloads using multiple + eviction threads. Performance of some workloads improves by over 15% [#1087] + +* Significant performance optimizations for queries, giving up to 20% + throughput improvement for in-memory query workloads. + https://github.com/wiredtiger/wiredtiger/wiki/Query-throughput + +* Fix an off-by-one bug that could lead to ENOMEM during commit with logging. + [#1104][#1121] + +* Allow bulk loads to multiple files to complete in parallel. [#1114][#1126] + + +WiredTiger release 2.2.1, 2014-06-24 +------------------------------------ + +The WiredTiger 2.2.1 release contains mainly performance enhancements and bug +fixes. Significant changes are described below. + +Changes to the WiredTiger API (see upgrading documentation for details): + +* Change the order in which configuration setting mechanisms are applied by + wiredtiger_open. [#1010][#1034] + +* Split the global transaction_sync configuration into two parts: a sync method + (dsync, fsync or none), and an enabled flag (false by default). [#1074] + +* Add ability to sync with per transaction granularity. [#1074] + +* Update WiredTiger Java API to throw WiredTigerException consistently. [#1011] + +* Add ability to dump and load databases using JSON format. [#740][#1049] + +Other significant changes: + +* Various performance improvements to the main cursor search routine including + reductions in how often we need to copy data and profiling based optimizations + for tight search loops. [#1050][#1070] + +* Fix a bug in recovery with missing files (e.g., after a hotbackup that raced + with file creation). [#1042][#1045] + +* Several bug fixes and performance enhancements related to LSM trees and + snapshot isolation transactions. [#1057][#1060][#1075] + +* Several performance tuning enhancements to LSM trees around locking, + throttling and switching chunks. [#1051] + +* Algorithmic improvements to LSM tree compact operation. It is now faster + and more reliable. [#1063] + +* Create a separate thread to manage open file handles - which means that: + - Application threads are less likely to be responsible for closing handles + - Multi threaded workloads don't open/close handles more often than necessary + [#1018] + + +WiredTiger release 2.2.0, 2014-05-21 +------------------------------------ + +The WiredTiger 2.2.0 release contains new features, performance enhancements +and bug fixes. Significant changes include: + +Changes relevant for upgrading applications: + +Update the table create API to disable prefix compression by default. +Applications generally see better performance without prefix compression, +choosing space saving over performance is up to the application. [#981] + +Change the default leaf_page_max setting from 1MB to 32KB. Choosing a large +default leaf_page_max led to poor performance in out of cache workloads. + +Remove the `--enable-debug` option to configure. It is more standard to set +`CFLAGS="-g"` variable instead. + +Save the wiredtiger_open configuration when a database is created, so that +settings like cache size, extensions and logging are set consistently by all +subsequent users of the database. + +Add an `--enable-verbose` option to configure. In order to access the verbose +message functionality available as part of the wiredtiger_open and +WT_CONNECTION::reconfigure APIs, it is necessary to pass the `--enable-verbose` +option to configure. + +Enhance the metadata cursor implementation (i.e: cursors created with a +"metadata:" prefix) so that they can be used to inspect metadata for internal +tables and now support altering the metadata. Add a new "read_only" flag to +cursor configuration that defaults to false for metadata cursors. + +Fix several bugs in raw compression, including one that could cause data +corruption and some that triggered poor performance. +[#984][#991][#1007][#1008][#1013] + +Improve the performance of recovery - we no longer need to scan all log files +looking for the last checkpoint. + +Improve performance of read-only transactions, by deferring the allocation +of transaction IDs. [#978] + +Several bug fixes in hot backup related to log +files, including: + * Always choose the right metadata version in the backup [#972] + * Don't require that hot backup copies log files in order [#976] + * Always copy log files before data files [#976] + * Fix a bug where recovery returned an error if the last log record was + incomplete [#994] + +Speed up checkpoints by doing a better job of skipping pages that can't +contain changes that need to be included. [#954][#963][#1001] + +Add ability to store zero length data items into LSM trees. [#540] + +Add an asynchronous data access/manipulation API to WiredTiger. [#933] + +Add the ability to configure multiple eviction server threads, to help with +keeping space available in the cache. [#918] + +Add the ability to reconfigure the checkpoint and statistics log servers. +[#997][#1004] + +Improve the performance of retrieving data for in cache workloads. [#970] + +Improve the structure of the in-memory tree we are generating, by allowing +internal pages to be split. This significantly improves query performance +in some workloads. [#876] + +Work around a bug in posix_fallocate on Linux, where it could corrupt already +written data. + +Add the ability to leak memory on connection close via new leak_memory option +to WT_CONNECTION::close API. This allows for faster shutdown if a process is +going to exit when the WiredTiger connection is closing. + +Allow salvage to run on any table type. + +WiredTiger release 2.1.2, 2014-03-27 +------------------------------------ + +The WiredTiger 2.1.2 release contains performance enhancements and bug fixes. +Significant changes include: + +Update the configuration settings for shared_cache to make the distinction +between cache_size and shared_cache less confusing. See upgrading +documentation for more information. + +Various performance enhancements to improve the performance of checkpoints. + +Fix a bug that could cause a hang with small caches under heavy load. [#894] + +WiredTiger release 2.1.1, 2014-03-04 +------------------------------------ + +The WiredTiger 2.1.1 release contains new features, performance enhancements +and bug fixes. Significant changes include: + +Fix a bug where a page could be marked clean when it contained uncommitted +changes. This bug could cause undefined behavior in transaction rollback +under load. + +Fix a bug with shared caches when rebalancing between connections. + +Add a new public API to WiredTiger that provides the ability to parse +WiredTiger compatible configuration strings. See the upgrading documentation +for further information. [#873] + +A number of performance enhancements to the LSM implementation, particularly +for long running workloads. + +A number of performance enhancements and bug fixes to cache eviction code. + +Add an option to use direct I/O when reading from checkpoints. To enabled +the functionality add "direct_io=[checkpoint]" to your wiredtiger_open +configuration string. [#847] + + +WiredTiger release 2.1.0, 2014-02-04 +------------------------------------ + +The WiredTiger 2.1.0 release contains new features, performance enhancements +and bug fixes. Significant changes include: + +The WT_ITEM structure was changed so that the size field is a size_t rather +than a uint32_t. See upgrading documentation for details. + +A change to the compress_raw interface around repeating the call with more +records. See upgrading documentation for details. + +In LSM trees, the memory_page_max setting is ignored. The effective setting +is double the chunk size. [#861][#859] + +Add support for zlib compression. [#855] [#865] + +Various enhancements to how WiredTiger generates tree structures in memory to +help maintain consistent performance as table size grows. [#851] + +Add support for Levyx Inc Helium as an external data source in WiredTiger +[#849][#850] + +Improve insert performance when a table contains many identical overflow +items. + +Various performance enhancements to btree searches. [#838][#839][#840] + +Add support for newer versions of autoconf up to 1.14. [#599][#841] + +Improve multi-threaded throughput of durable log writes, including changing +the default wiredtiger_open transaction_sync configuration from dsync to +fsync, see the upgrading documentation for further information. [#831][#832] + +In the Python and Java APIs, automatically close handles to prevent invalid +accesses by applications. [#649][#800][#830] + +Various enhancements to the LSM merge algorithm, including improvements to how +files are selected for merging, and throttling based on whether merges are +keeping up (to limit write amplification). Made the minimum number of chunks +chosen to merge configurable. [#817][#819][#822] + + +WiredTiger release 2.0.1, 2013-12-12 +------------------------------------ + +The WiredTiger 2.0.1 release contains major new features, numerous performance +enhancements and bug fixes. + +Significant changes include: + +* WiredTiger now supports fine-grained durability via Write Ahead Logging (WAL). + Logging is enabled with the "log=(enabled)" configuration string to + wiredtiger_open. If the connection is not shut down cleanly and logging is + enabled, WiredTiger will automatically run recovery the next time it is + opened, rolling forward changes in the log until the last commit. + [#605] + +* Many enhancements to the LSM implementation to improve the throughput and + reduce maximum operation latency including: + - Algorithmic improvements when multiple merge threads are configured. + - Improvements to bloom filter lookup speed. + - Enhancements to internal cursor management, to reduce search overhead. + - Prioritize switching to a new level 0 chunk in utility threads, to avoid + application thread pauses. + - More advanced logic in choosing when to create bloom filters. + +* LSM specific WT_SESSION::create configuration option enhancements. Including: + - Move existing options into their own group, and strip leading lsm_ prefix. + - Add a new merge_max configuration option. + - Update the default chunk_size to be 10MB. + - Increase the default bloom filter bit and hash counts. + - Clean up files left after interrupted merges. + See the upgrading documentation for details. + [#784, #785, #786, #802] + +* WT_SESSION::compact can now be used to merge LSM trees into a small number + of chunks on disk. + [#792] + +* Enhanced the Java API, so that when WiredTiger automatically closes a + handle, the handle is automatically invalidated for the Java application. + [#485] + +* Add a script that can create an interactive web page to view statistics + from a WiredTiger statistics log. Based on D3: http://d3js.org/ + +* Enhancements to the wtperf performance testing tool to add new features + + +WiredTiger release 1.6.6, 2013-11-19 +------------------------------------ + +The WiredTiger 1.6.6 release is a bugfix and performance tuning release. + +This release of WiredTiger contains a database format change. Database files +from previous releases will need to be upgraded. + +A special note: the WiredTiger code base is now being regularly reviewed +using the Coverity Static Analysis Verification Engine. We'd like to +thank Coverity for their on-going support of Open Source projects like +WiredTiger! + +Significant changes include: + +* Performance changes include: limiting operations done inside update + serialization primitives, removing unnecessary memory barriers, replacing + spinlocks with atomic instructions, padding structures to avoid false + cache sharing, switching from per-file mutexes to per-page mutexes, + pre-allocating structures to avoid memory allocation while holding + mutexes, and using adaptive mutexes where available. + [#707, #718, #719] + +* A number of LSM stability and performance improvements: changes include + better merge algorithms, reduced locking, and higher concurrency. + +* A number of table compaction performance improvements, including changes + allowing compaction to no longer read unnecessary file blocks into the + cache, requires fewer passes over the file and support concurrent + checkpoints and eviction. This change required an underlying file + format change, see the upgrading documentation for details. + [#756, #761] + +* WiredTiger statistics have been significantly improved: + + Statistics logging has been changed to aggregate information from all + open handles. [#709, #717] + + For performance reasons, statistics are now disabled by default, see + the upgrading documentation for details. [#715] + + Statistics configuration has been changed so the connection and cursor + configuration are consistent, with matching changes to the "wt stat" + command-line utility; see the upgrading documentation for details. + +* Update WT_EVENT_HANDLER interface to contain a new "handle close" + interface and to pass a WT_SESSION handle into all callbacks, see the + upgrading documentation for details. [#649] + + Add timestamp, process ID and thread ID to messages generated via + WT_EVENT_HANDLER interface. [#753] + +* WiredTiger eviction improvements, supporting larger data-to-cache size + ratios. [#754] + +* Various fixes for handling overflow records. [#726, #743] + +* Overflow records are no longer tracked during bulk-loads, significantly + increasing bulk-load performance for some data sets. + + +WiredTiger release 1.6.5, 2013-10-09 +------------------------------------ + +This is primarily a bugfix and performance tuning release. The main changes are: + +* Change the default statistics_fast configuration from false to true. + +* Change WT_CURSOR::insert to not hold a position. [#673] + +* Disallow WT_SESSION::compact operations on LSM trees. + +* The 'sync' setting to wiredtiger_open has been renamed 'checkpoint_sync'. + +* Add a "metadata:" cursor type. [#660] + +* Fix race in the cache's dirty byte tracking. [#635, #699] + +* Fix a bug scanning through a memory-mapped file with overflow items. [#701] + +* Use hardware checksum instructions when available. [#582, #702] + +* Several bug fixes related to tracking active transaction IDs and detection of + obsolete updates with high concurrency workloads. [#639, #643, #657, #683] + +* Fix several bugs in LSM including races on shutdown and Bloom filter + creation. [#686, #687, #688]. + +* Fix a bug in LSM where we were not including Bloom filter files in backups. + [#684] + +* Optimize the LSM throttle and merge algorithms. [#676] + +* Make hot backups work concurrently with files being bulk-loaded. [#570, #653] + +* Add full support for snapshot isolation to LSM: only switch LSM chunks if all + changes are globally visible and detect conflicts between transactions across + file switches. [#629] + + +WiredTiger release 1.6.4, 2013-08-20 +------------------------------------ + +This is primarily a bugfix and performance tuning release. The main changes are: + +* Make prefix compression of keys conditional on the amount of space saved. + A database format change was required for this enhancement. See upgrading + documentation for details. [#624] + +* The default behavior of the wt utility's load command has been changed to + overwrite existing data. + +* Add a WT_SESSION.create prefix_compression_min configuration option with a + default value of 4. [#624] and [#624] + +* Fix "make install" of Python API. [#598] + +* Require platform support for atomic read/write of 64 bit values. [#553] + +* Support transaction semantics for custom data source implementations. Enhance + Memrata data source to support transactions. + +* Changes to the wtperf testing tool related to how configuration options are + specified. + +* Enhance cursor key/value memory management to be more efficient, consistent, + and have stricter checking of inputs and outputs. + +* Increase the likelihood of being able to evict hot pages. [#604] + +* Reference on-page keys instead of copying them to allocated memory. This + saves space in the cache and overhead when reading pages into cache. + [#592] and [#600] + +* Add a btree search optimization that skips matching prefixes. [#595] + +* Turn off Huffman encoding for keys on row-store internal pages. [#592] + +* Add concurrent logging infrastructure that will be used to support write + ahead logging in a future release. + + +WiredTiger release 1.6.3, 2013-07-12 +------------------------------------ + +This is a bugfix and performance tuning release. The main changes are: + +* Change the default cursor overwrite configuration so that it is consistent + across all data sources. This change may alter the behavior of existing + applications without triggering any compilation or runtime warnings. See + the upgrade documentation for details. [#512] + +* Require platform support for 64 bit atomic operations. [#553] + + +WiredTiger release 1.6.2, 2013-06-18 +------------------------------------ + +This is a bugfix and performance tuning release. The main changes are: + +* Fix a race in the WiredTiger pseudo random number generator that was leading + to poor distribution of numbers. + +* Change the default compression configuration to "uncompressed". + +* Fix a race between checkpoints and LSM that could result in a crash. [#543] + +* Add an option to output version information at runtime. Configure by + including "verbose=[version]" in the wiredtiger_open connection + configuration string. [#564] + +* Add a configurable prefix to error messages. [#527] + +* Add two new extension APIs, one to return a transaction ID, one to return + if a transaction ID is visible to the current transaction. + +* Add standard metadata functions to the extension API and make extension data + sources responsible for their own metadata entries. + +* Add a new extension function __wt_ext_config_strget that returns the + configuration value from a single string. + + +WiredTiger release 1.6.1, 2013-05-31 +------------------------------------ + +This is a bugfix and performance tuning release. The main changes are: + +* Fix the compress_raw API so that it uses platform independent types. See the + upgrade guide for further information. [#561] + +* Add an explicit enable setting to shared_cache configuration. See the + upgrade guide for further information. + +* Fix several bugs in hot backup, including race conditions between backup and + table drop (and other schema level operations). [#556] [#557] + +* Allow any data source type for indices as well as column groups. [#545] + +* Preload btree internal pages into file system cache when opening a table. + +* Change the default allocation size to 4KB so that DIRECT_IO with 4KB blocks + works. [#547] + +* Fix some bugs related to tracking the oldest active transaction. [#552] + +* Fix a bug in the extension API when using multiple databases. + +* Disallow named checkpoints on LSM trees - they aren't supported. [#546] + +* Fix support for custom collators with LSM trees. [#544] + +* Build fixes for gcc 4.1.2. + +See the upgrade documentation for details of API changes that may require +altering existing applications. + + +WiredTiger release 1.6.0, 2013-05-16 +------------------------------------ + +This release contains new features, bug fixes and performance improvements. +The significant changes are highlighted below: + +* Fix a bug where configuring direct I/O could cause checksum errors at + runtime. NOTE: database file format change. [#526] + +* Fix a race that allowed checkpoints to be deleted while hot backups are + running. [#515] + +* Scale to events per second in graphs generated from statistics log output. + [#518] + +* Changes to reduce the latency of LSM operations. + +* Add a new terminate callback to extension interfaces that is called when the + WiredTiger connection is closed. [#530] + +* Various optimizations and bug fixes to cache management and eviction code. + +* Update various statistics. + +* Fix a bug where using a combination of read-committed and snapshot + transactions could result in inconsistent values being returned. [#539] + +* Fix a bug where using LSM trees with compression enabled could result in an + invalid system call. [#535] + +* Enhance statistics logging so that it can dump "lsm:" statistics. + +See the upgrade documentation for information about database format changes +in this release. + + +WiredTiger release 1.5.3, 2013-04-26 +------------------------------------ + +This release contains some major new features along with numerous bug fixes +and performance improvements. The significant changes are highlighted +below: + +* Enhance the extension data source API to facilitate implementation of new + data stores in WiredTiger. + +* Add support for the STEC / Memrata KVS data source. + +* Add a Berkeley DB data source via the WiredTiger extension API. + +* Various enhancements to cache eviction management. Mostly to avoid stalls in + application threads. + +* Fixes to shared cache pool implementation, so resources are more + aggressively reallocated. + +* Add new statistics. + +* Implement automatic insert throttling in LSM - enabled by default. + +* Configuration strings are now case sensitive. + +* Enhance LSM merge algorithms to be more efficient as trees grow very large. + +See the upgrade documentation for details of API changes that may require +altering existing applications. + + +WiredTiger release 1.5.2, 2013-03-28 +------------------------------------ + +This is a bugfix release. The main changes are: + +[#493] Fix get_key/value in the Java API for complex cursors. + +* Fix a leak in eviction detected by valgrind. + +* Stop trying to cache the oldest reader: we only use it for eviction and only update it when required. + +* Track cursor creation in the statistics (creating a cursor per operation isn't a good idea). + + +WiredTiger release 1.5.1, 2013-03-25 +------------------------------------ + +This is a bugfix and performance tuning release. The main changes are: + +* Fix several bugs in LSM: + - the logic for setting the "no eviction" flag on LSM chunks was reversed, + causing unnecessary eviction once the cache became full; + - calling session.checkpoint while writing to an LSM tree could confuse + the logic around switching to new chunks; and + - fix a possible NULL pointer indirection when switching chunks. + +* Make WT_ASSERT a no-op when not in DIAGNOSTIC mode. + +* Panic if we find a block on the wrong list, that's not something we can + recover from. + +* If a page is reconciled (causing it's on-disk blocks to be freed and + potentially recycled), and then a subsequent collapse of a stack of + split-merge pages replaces that page with a page that has not yet been + reconciled, we can potentially free the same blocks twice. The fix is to + clear the page's WT_REF.addr field at the time we free the blocks, so + future reconciliations will ignore the original disk blocks. + +* Fix a bug in the dump utility that allowed index URIs. + +* Tweak merge to build better trees with random insert workloads. + +* Don't use a stale value for the oldest reader transaction ID. + +* Track the size of the WT_REF array in internal pages (including + WT_ADDRs). Also add an estimate of per-allocation overhead. + +* Fix a bug where URIs containing absolute paths were not being parsed + correctly. + +* Add a RMW insert mode to wtbench. + +[#427] Improve cleanup after a failed wiredtiger_open call. + +[#484] Don't allow true/false values in config strings where integers are + expected. + +[#486] Move the cache full check for autocommit transactions out of the + rollback path (since we don't reset cursors there), to after we + close a cursor. + +[#488] Fix an assertion failure if we try to do eviction without ever having done an update. + + +WiredTiger release 1.5.0, 2013-03-14 +------------------------------------ + +This release contains some major new features along with numerous bug fixes +and performance improvements. The significant changes are highlighted +below: + +* Add a Java API. + +* Create a thread to do automatic checkpoints, configured by passing + "checkpoint=(wait=X)" to wiredtiger_open. + +* Add support for periodically logging statistics to a file and a tool to + generate graphs based on those logs. Configured by passing + "statistics_log=(wait=X)" to wiredtiger_open. + +* Several changes to minimize the impact of checkpoints on other threads. + +* When reading from checkpoints, use mmap by default. + +* Enhance eviction so that internal pages take up less space. + +* Add maximum filesystem buffer cache settings to wiredtiger_open called + "os_cache_max" and "os_cache_dirty_max". After doing the specified + amount of reads or writes, WiredTiger will call fadvise and/or + sync_file_range to drop pages from the filesystem cache. This is an + alternative to direct I/O with less impact on performance. + +* Make run-time statistics optional, defaulted to "off". + +* Change how we detect if shared cache is used. It used to rely on a name, + now it will be used if the shared_cache configuration option is included. + +* Add the ability to specify a per-connection reserved size for cache + pools. Ensure cache pool reconfiguration is honoured quickly. + +* Rework hazard pointer coupling during cursor walks to be more efficient. + +* Add a cache_eviction_walk statistic to track the pages we walk and a + cache_eviction_force statistic to track the count of pages queued for + forced eviction. + +* Fixes to reduce the number of operations on shared data that were causing + bottlenecks in read only workloads. + +* Add streaming pack / unpack to the API. + +* Add some basic reconciliation stats to the connection stats. + +* In LSM, keep trying to switch if there is an error: it may be transient. + +* Minor clean up and enhancement for the reconciliation statistics, add a + set of compression statistics, both to the data-source statistics. + +* Compaction cannot run at the same time as a checkpoint: the problem is + that checkpoints review page reconciliation information and checkpoints + update page reconciliation information. Lock out checkpoints while + compaction is running. + + +WiredTiger release 1.4.2, 2013-01-14 +------------------------------------ + +[#387] Fast-path "S" and "u" formats in cursor.get_key and cursor.get_value. + +[#407] Allow non-conflicting updates to complete concurrently. + +[#418] Add code in to prioritize eviction of pages that are larger than a +certain threshold. This avoids taking a performance hit when a huge page +needs to be reconciled. Add a new memory_max_page configuration option. + +[#419] If a page splits, it potentially creates a merge-split internal page +and we potentially walk that page during fast-delete. The WT_REF.addr field +doesn't point to a cell in that case and we'll drop core. + +[#424] Add clarification wording for boolean configuration strings. + +[#425] Perform checkpoints in the calling thread, don't block eviction: when +evicting in a file that is being checkpointed, only evict clean pages. Also +Do compaction in the calling thread instead of interrupting the eviction +thread to do the work. + +[#426] Fixes for automake 1.3.x. Allow examples to run in parallel: give +each a unique home directory. + +Make the tree build without HAVE_VERBOSE. + +Fix some issues with LSM rename and add a Python test. + +Track when cursors refer to memory returned by WiredTiger, copy it if +required before dropping hazard pointers that might be protecting it. + +Verify shouldn't ever modify the file -- don't bother checking for dirty +pages, just discard everything. + +When rolling forward to resolve key prefix compression, don't copy the key, +we only need a reference to it, should speed up tables with lots of key +prefix compression. + +Requested changes for the WT_COMPRESSOR::compress_raw method API: pass in the +configured object's page size as a convenience, and if +WT_COMPRESSOR::pre_size is set, use it to determine the size of the +destination buffer, rather than using the object's page size as the maximum +needed. + + +WiredTiger release 1.4.1, 2012-12-12 +------------------------------------ + +This is a bugfix, cleanup and performance tuning release. The significant +changes are highlighted below: + +[215] Add a __wt_panic function that shuts down all of the WiredTiger APIs. + Also add a new error return WT_PANIC which means there has been an error + in the WiredTiger engine, and it should be restarted. + +[409] Fix a bug populating column groups with complex schema. Also allow empty + column lists in projection cursors. + +[150] Add description of how to do index-only searches to the documentation. + +[392] Move examples/c/ex_test_perf.c to bench/wtperf. + +[322] Add support for statistics on schema-level objects i.e tables, + column groups, indices. + +* Enhance statistics, including changing the name of some statistics. + +* Fix a bug in the eviction server that could cause it to abort, leaving the + system unusable. + + +WiredTiger release 1.4.0, 2012-12-03 +------------------------------------ + +This release adds several major new features, a number of performance +improvements and bug fixes. The significant changes are outlined below: + +New features and API changes: + +[242] Track the percentage of cache that is dirty, trigger eviction to bound + it. This can be used to bound how much data checkpoints write. + +[324] Add support for WT_COMPRESS::compress_raw, which lets the compression + routine select how many rows are included in each disk block. + +[381] Add statistics to track read and write amplification (application data + size versus I/O size) + +* Add a trigger configuration option to WT_SESSION::compact API. + +* Make WT_SESSION::create's checksum configuration 3-state: on, off, or + uncompressed blocks only. + +Bug fixes: + +* Fix build issues on Solaris. + +* Fix a bug calculating the generation of an LSM merge. + +* Fix WiredTiger dump and load for tables. + +* Fix a memory leak in checkpoints. + +* Improve accuracy of cache memory tracking with overflow items. + + +WiredTiger release 1.3.8, 2012-11-22 +------------------------------------ + +This release improves the performance of LSM trees, changes how statistics are +reported and adds a shared cache implementation: + +New features and API changes: + +[232] Add a "size of checkpoint" statistic. + +* Add a shared cache pool implemention. Manages a single cache among + multiple databases within a process. + +* Merge statistics from file and LSM sources into a "data source" statistic + structure. Rename and regroup some shared stastistics. Add a helper to + the Python API to lookup in a cursor in a simple expression. + +* Add support for sub groups of options in configuration strings. + +Performance tuning for LSM trees: + +* Don't try to merge with a chunk that is much larger than a small chunk. + +* After an LSM merge, fault in some pages before the new tree goes live to + avoid stalling application threads. + +* Don't automatically fail inserts if the write generation check fails: + compare keys instead. + +* Switch the LSM tree lock to a read/write lock, so cursors can read the + state of the tree in parallel. + +Bug fixes: + +* Fix a bug where we could write past the end of a buffer after it was grown. + + +WiredTiger release 1.3.7, 2012-11-09 +------------------------------------ + +This release fixes a bug and improves performance with Bloom filters: + +* Drop any old Bloom filter before creating a new one -- we may have been + interrupted in between creating it and updating the metadata. Write the + metadata after creating missing Bloom filters. + +* Use a separate thread for creation of Bloom filters for the newest, + unmerged LSM chunks. + +* Changes to the ex_test_perf example: change the default configuration to + 4KB pages and disable prefix compression. Change the "-i" command line + option to be a simple count of records to insert. Clean up error + handling and add option to populate using multiple threads. + +* Clarify the docs for the default buffer_alignment setting. + + +WiredTiger release 1.3.6, 2012-11-06 +------------------------------------ + +This is a bugfix and performance tuning release. The changes are as follows: + +* Rename the WiredTiger installed modules to libwiredtiger_XXX. Don't install + the nop and reverse collator modules. + +* Replace test/format's bzip configuration string with compression, which can + take one of four arguments (none, bzip, ext, snappy), change format to run + snappy compression if the library is available. + +* Rename the builtin block compressor names from "bzip2_compress" to "bzip2", + and from "snappy_compress" to "snappy". + +* Support multiple LSM merge threads with the "lsm_merge_threads" config key. + Use IDs rather than array index to mark the start chunk in a merge, in case + we race with another thread. + +* Cache the hash values used for Bloom filter lookups, rather than hashing for + each Bloom filter in an LSM tree. + +* Only switch trees in an LSM cursor if the primary chunk is on disk. + +* Add a per-btree cache priority, currently only used to make it more likely + for Bloom filter pages to stay in cache. + +* Only evict pages with read generations in the bottom quarter of the range we + see. Fix a 32-bit wrapping bug in assigning read generations. + +* For update-only LSM cursors, only open a cursor in the primary chunk. + +* LSM: Report errors from the checkpoint thread. + +* LSM: only save a Bloom URI in the metadata after it is successfully created. + +* LSM: Create missing Bloom filters when reading from an LSM tree if + "lsm_bloom_newest"is set. + +* LSM: Include all of the chosen chunks in a merge. Only pin the current chunk + in an LSM cursor if it is writeable. + + +WiredTiger release 1.3.5, 2012-10-26 +------------------------------------ + +This is a bugfix and performance tuning release. The changes are as follows: + +[#370] Document that applications are responsible for figuring out their + upgrade path if they might swap out compression engines. + +[#371] When a single session was used to reconcile multiple btrees, one of + which had dictionaries configured and one of which didn't, we failed to + clear the dictionary when starting page reconciliation. Be consistent, + never use anything other than the btree handle's configuration to decide + if we're using a dictionary in a reconcilation run. + +[#372] Fix several potential integer overflow bugs. + +[#373] Fix a bug where calls that performed an operation on multiple objects + (such as creating a table that implicitly creates a column group) + could leave the metadata incomplete if a process exited without + calling `WT_CONNECTION::close`. + Hold the schema lock while opening tables. Fixes the error "cannot be + opened until all column groups are created" message when create calls + race with open_cursor. + +[#374] Fix a race that caused crashes when using the Python API with + multi-threaded code. + +[#375] Fix a bug in __wt_cond_wait - so that it returns after timeout expires. + +* Protect the list of LSM trees with the schema lock to avoid races during + create. + +* Update ex_test_perf to output statistics during populate and improve timing + accuracy. + +* Skew eviction in favor of leaf pages - which improves read-only performance + for large LSM trees. + +* Hold the LSM tree lock while gathering statistics. + +* Fix a bug in bulk load of bitmap files. + +* Fix a related bug in the bloom code that uses bitmap stores. + +* Don't attempt to drop the first chunk of an LSM tree before creating it. + +* Instead of entering a fake key cell after the last cell on the page just + in case the page ends with a key cell which has no value, use the end of + the page to detect that case. + +* Cache cursor key/value formats in Python, to save a native call from every + get_key/value. + +* Don't sync the directory after open if the global "sync" flag is false. + +* Fix a race for LSM trees that could happen if two threads race to open a + cursor and drop the LSM tree. + +WiredTiger release 1.3.4, 2012-10-19 +------------------------------------ + +This release includes several important new features, including: + +* support for online compaction of files; +* support for tables, column groups and indices that use LSM trees for + storage; and +* improved statistics and configuration for LSM trees and Bloom filters. + +In addition, there are some significant performance improvements and bug +fixes. The full list of changes is: + +[#248] Add support for online compaction. + +[#310] Fixed a bug where overflow blocks could be accessed by a + long-running reader after they had been freed in a checkpoint. + +[#358] Allocate checkpoint blocks from the live system's list of available + blocks rather than always extending the file. + +[#361] Sync the directory after creating a file: this is apparently + required for durability on Linux, according to the Linux fsync man + page. + +[#362] Don't check if a page is on the avail or discard lists if we're + salvaging the file, that is okay. + +[#363] Remove obsolete code dealing with forced eviction. + +[#366] Fake checkpoints may have the delete flag set, ignore them when + rolling checkpoints forward. + +[#367] All metadata reads should ignore the application's transactional + context. + +[#369] Support LSM as a data source for tables, column groups and indices. + +* Add tuning options for LSM bloom filters, including controlling whether + the oldest level in the tree has a Bloom filter, whether newly-created + (level 0) files have Bloom filters, and passing arbitrary file + configuration for Bloom filters. + +* Add a merge generation to LSM chunks. Add a statistic that reports the + highest merge generation in a tree. + +* Add a new LSM statistic tracking searches that could benefit from bloom + filters. + +* Enable LSM statistics in the "wt stat" utility. + +* Interrupt LSM merge operations, rather than waiting on close. + +* Wait for a while before looking for LSM major merges, in case merges + catch up with inserts. + +* Fix LSM index searches. The main issue was LSM search_near was not + always returning the closest key to the search key, which calling code + expects. It now tries hard to find the smallest cursor larger than the + search key, and only if no larger record exists does it return the + largest record smaller than the search key. + +* Reset any old cursor position before an LSM search. This limits hazard + references in an LSM search to a single chunk. + +* Fix a memory leak in an error path in Bloom filters. + +* Tweak the search loops in hazard_{set,clear} in favor of + last-in-first-out ordering. + +* If there are many files open, some hotter than others, walk more files + looking for pages to evict. + +* Don't stop evicting until we reach the target, have eviction wake up + periodically regardless of whether the application signals it. This + latter requires a "timed condition wait" operation. + +* Tweaks to file handle flags for out-of-cache read performance on Linux + (disable readahead and access time updates). + +* Replace the WT_SESSION::dumpfile method with configuration strings to + WT_SESSION::verify. + +* Fix a bug where we weren't skipping unnecessary default checkpoints + because we weren't handling the generational number included in the + internal checkpoint name. + +* Add a "force" configuration flag to WT_SESSION::checkpoint, object + compaction needs it because the work it wants done is done by the block + manager. + +* Make compact and checkpoint operate on a table's indices. + +* When doing a page truncate, lock down the page before we unpack the + on-page cell -- it's possible the page could be instantiated, modified + and reconciled while we're sleeping, in which case the WT_REF.addr field + would no longer point on-page. + + +WiredTiger release 1.3.3, 2012-10-11 +------------------------------------ + +This is a bugfix and performance tuning release, primarily related to LSM +trees. The changes are as follows: + +[#350] Checkpoint the metadata after successful schema-level operations. + Otherwise, if process exits without closing the connection or + running a checkpoint, created objects exist but there is no record + in the metadata. + +[#351] Don't put checkpoint extent blocks on the available list, blocks on + it are considered for truncation; they have to go on the "checkpoint + available" list. + +* Choose LSM merges based on a measure of efficiency (levels collapsed per + record), rather than simply choosing a minor or a major merge. Tweak the + merge heuristic so we don't end up with runs of smaller chunks in the + middle of the tree. + +* Add a connection-wide flag to disable LSM merges. + +* Don't create Bloom filters for the oldest chunk in the system. Add the + ability to disable Bloom filters entirely. + +* Fix fast-path for bit values in WT_CURSOR::set_value. + +* Clean up allocation of LSM chunk IDs. + +* Update bloom_get so that it doesn't hold a cursor position. + +* Respect the page size for fixed-length column stores, remembering there + are 8 bits per byte. + +* Support bulk loading a bitmap into a fixed-length column store, update + Bloom filter code to use this. + +* Add an example program, ex_test_perf, to demonstrate basic LSM usage. + +* Add a new statistics cursor type "statistics:lsm". Update ex_stat.c to + demonstrate usage. + +* Add a statistics_fast flag to file statistics cursors. Update LSM + statistics so that they aggregate some cache statistics. Add ability to + open a statistics cursor on a checkpoint. + +* Walk a constant number of pages for LRU eviction. + +* Move the cache full check to after an update operation completes, when it + is no longer holding hazard references. This improves behavior with + small caches. + + +WiredTiger release 1.3.2, 2012-10-03 +------------------------------------ + +This is a bugfix and performance tuning release, primarily related to LSM +trees. The changes are as follows: + +* Implement minor merges for LSM trees, prefer them to major merges. + +* Update hazard references, so the active array grows as needed. Change + the default hazard_max to 1000. + +* Abort transactions if the cache is so full that they cannot make + progress. + +* Fix a bug where verify could crash if an empty checkpoint exists. + +* Make the maximum number of chunks for merges configurable, rather than + deriving a value from the number of hazard references available. + +* Switch to an atomic add to allocate transaction IDs. This fixes a subtle + race before where two threads could temporarily have the same ID in the + global state table. If one of the threads timed out and the other thread + committed its transaction with that ID, the commit would not become + visible immediately. This could lead to deadlock errors in workloads + that are logically conflict-free. + +* Have auto-commit transactions retry deadlocks. This requires that we + keep the user's key and value in the cursor. + +* Simplify the code handling updated records in variable-length + column-store reconciliation. + +* Never wait for eviction when holding the schema lock. This avoids + deadlocks between opening a column store file and taking a checkpoint. + +* Take care with the loop termination when walking files for eviction. We + were making one extra call into __wt_tree_walk, which would leave a leaf + page in the WT_REF_EVICT_WALK state, unable to be evicted. In some + workloads, including LSM loads, we could end up with many files all + consisting of a single leaf page, none of which could be evicted. + +* Pause updates when the cache is full. + +* In files marked as "out of cache", don't wait for eviction when reading a + page. + +* Fix the record count calculation for minor merges. This was leading to + no Bloom filter being created for minor merges after running for some + time, leading to merges taking increasingly long to complete. + +* Only sleep in the LSM checkpoint thread if no work is done. + +* Add sanity check of cache size to LSM open. + +[#338] Create fake checkpoints until an object is modified, so that a + checkpoint between the cursor create and the bulk load doesn't make + it impossible to do a bulk-load on the cursor. + + +WiredTiger release 1.3.1, 2012-09-25 +------------------------------------ + +This is a bugfix release, primarily related to LSM trees. The changes are +as follows: + +[#309] Implement auto-commit of transactions at the API. As well as + ensuring the atomicity of complex operations, this change simplified + code that simulated auto-commit internally and fixed a number of + bugs. + +[#321] Bulk-cursors no longer block checkpoints. We can't write files that + are being bulk-loaded, so change checkpoint to create checkpoints in + the metadata that, if accessed, look like empty files. + + Tighten down the requirements for bulk-load, the only thing that can + be bulk-loaded now is a newly created tree, not any empty file. + +[#329] Add dictionary support to variable-length column store objects. + Support large row-store reconciliation dictionaries: add a skiplist + as the indexing mechanism. + +[#333] Fix a leak of the in-memory transaction log structure and the LSM + data source handle. + +[#334] Fix a memory leak where a page's replacement address wasn't being + freed. + +* Check that LSM trees are not configured as column stores. + +* Fix a race when starting the LSM worker thread. It was possible for the + thread to exit immediately if it started fast enough. + +* Two fixes for LSM, one to ensure that cursors read from a checkpoint if + one is available. The other to reduce the number of empty chunks that can + be created initially. + +* Fix a bug that disabled bloom filters. + +* The configure script checks for Python support in SWIG. + +* If a drop operation fails to acquire all of the handle locks it needs, + make sure it releases the primary handle lock. + +* Fix a number of other minor bugs and memory leaks. + + +WiredTiger release 1.3.0, 2012-09-17 +------------------------------------ + +This release contains a number of major new features, including: + +* support for LSM trees with Bloom filters; +* support for hot backups; and +* support for fast truncation of files. + +In addition, there are some critical bug fixes. We recommend that all users +upgrade. Here is the full list of changes: + +[#143] Implement random record lookups. + +[#168] Add support for LSM trees. + +[#168] Add support for Bloom filters in LSM trees. + +[#198] Handle page-generation wraparound. + +[#236] Implement hot backups. + +[#244] Index cursors for column-store objects may not be created using the + record number as the index key. + +[#247] Add a fast-path for WT_SESSION::truncate that avoids reading most + data to be deleted. + +[#259] Performance hack for cursor open: don't parse the configuration + strings for a default value if the application didn't specify a + configuration string. + +[#262] Disable dump on child cursors: only the top-level cursor is wrapped + in a dump cursor. + +[#266] Deal with new / dropped indices in __wt_schema_open_index. + +[#269] Checkpoint handles must not be open when they are overwritten. + +[#271] Add support for a reserved checkpoint name "WiredTigerCheckpoint" + that opens the object's last checkpoint. + +[#271] Add the ability to access unnamed checkpoints. + +[#274] Change cursor.equals to return a standard error value and store the + cursor equality result in a separate argument. + +[#275] If exclusive handle is required for an operation and it is not + available, fail immediately: don't block. + +[#276] Fix methods that return integer parameters from Python. This + includes cursor.equals and cursor.search_near. + +[#277] Acquire the schema lock when creating the metadata file. We're + single-threaded, so it isn't protecting against anything, but the + handle management code expects to have the schema lock. + +[#279] Some optimizations for __wt_config_gets_defno. Specifically, if + we're dealing with a simple stack of config strings, just parse the + application string rather than the full list of defaults. + +[#279] Split the description string into a set of structures, to reduce the + number of string comparisons and manipulation that's required. + +[#282] Remove the cursor.reconfigure method, and replace it with + documentation showing how to "reconfigure" cursors using the + session.open_cursor method to duplicate them with different + configuration strings. + +[#284] Fix for a hazard reference race, where page eviction races with the + creation of the hazard reference, we have to check the pointer + itself as well as the state of the pointer. + +[#285] We can clear the tree's modified flag on checkpoint, as long as the + checkpoint writes all modifications. Clear the tree's modified + flag before we start the checkpoint, but reset it as necessary if + reconciliation is unable to write all of the changes in a page. + +[#287] Fix __wt_config_check to handle overlapping config values correctly. + +[#289] Add support for read-committed isolation, make it the default. Add + a session-level "isolation" setting. + +[#294] If txn_commit fails, document the transaction was rolled-back. + +[#295] Expand the documentation on using cursors without explicit + transactions. + +[#300] Include all changes whenever closing a file, don't check for + visibility. If updates are skipped while evicting a page, give up. + +[#305] Have "wt dump" fail more gracefully if the object doesn't exist. + +[#310] When freeing a tracked address in reconcilation, clear it to avoid + freeing the same address again on error. + +[#314] Replace cursor.equals with cursor.compare + +[#319] Clear the bulk_load_ok flag when closing handles. + + +* Add an "ancient transaction" statistic so we can find out if they're + actually occurring in the field. + +* Add an "was object ever modified" flag to the btree handle, and use it to + avoid writing read-only objects during internal checkpoints, issue + +* Add per-connection statistics counters for transaction checkpoint, begin, + commit and rollback. Add per-btree statistics counters for update + conflicts. + +* Another fixed-length column-store implicit record fix: if the earliest + row in the object is row 10, and it's on an append list, we still must + return rows 1-9, they've been implicitly created. + +* Bulk cursors: disallow cursor.{equals,next,prev,reset,search, + search_near,update,remove}; only close and insert are supported. + +* Change session.truncate to support any cursor position for range + truncation, not just keys that are known to exist. + +* Checkpoint has to flush the metadata file, but only after it's flushed + all of the other files. + +* Discard obsolete WT_UPDATE structures during updates. + +* Document that duplicated cursors are positioned at the same point as the + cursor that was duplicated. + +* Fix a (very unlikely) deadlock at startup, if an application issues a + checkpoint before the eviction server has managed to open its sesssion. + +* Fix a core dump if we verify a file that's corrupted such that we are + unable to load any checkpoints at all, and the per-checkpoint bit map is + never set. + +* If a page selected for eviction cannot be freed because it has some + recent updates, try instead to free memory by trimming old updates. + +* If a thread fails to evict a page, try to bump its snapshot. This avoids + the common case of read-committed threads getting stuck because one + thread falls behind (e.g., because we can't evict during a checkpoint). + +* If an exclusive table create fails, return EEXIST. + +* If we try to remove a file that doesn't exist, don't complain, return + success. + +* If we're repeatedly taking a checkpoint with the same name, skip the work + for read-only objects. + +* Instead of flagging the empty tree's leaf page empty as part of creating + an empty tree in memory, set the page as modified (to force + reconciliation); if the leaf page is still empty at that time, then we'll + figure it out during that reconciliation. This fixes a memory leak where + the leaf page of a empty tree wasn't being freed. + +* It's not unreasonable to open a cursor on a non-existent table, don't + complain, just return not-found. + +* Move dist/RELEASE to the top level of the tree. + +* Optimization: don't repeatedly look up btree handles for schema + operations. + +* Return keys from all operations: don't keep pointing to the application's + key. + +* Update btree usage of 64 bitstring implementation, so it's cleaner. + +* Update the bitstring implementation to use 64 bit length strings. + +* Updates performed without an active transaction should become visible + with the current transaction ID. + +* Upgrade to doxygen 1.8.x + +* Use a real snapshot transaction for checkpoints. Otherwise, the snapshot + can be updated in between checkpointing multiple files (when updating the + metadata). + + +WiredTiger release 1.2.2, 2012-06-20 +------------------------------------ + +This is a bugfix release. The changes are as follows: + +* Defer making free pages available until the end of a checkpoint, in case + there is a failure after processing some files. + +* When checking the value of the "isolation" key, don't assume it is NUL + terminated. This bug could cause transactions to run with incorrect + isolation. + +* Fix two bugs with snapshot isolation: + + 1. reset the isolation level when the transaction completes; + 2. when checking visibility, check item's ID against the maximum snapshot ID + (not the transaction's ID). + + +WiredTiger release 1.2.1, 2012-06-15 +------------------------------------ + +This is a bugfix release. The changes are as follows: + +* Avoid a deadlock between eviction and checkpoint on the connection spinlock. + +* Allocate "desc" buffers in heap memory so that they are correctly aligned + (fixes direct_io support on Linux). + +* Initialize the snapshot-avail list after cleaning it out, else we'll try and + print a NULL pointer in VERBOSE mode. + + +WiredTiger release 1.2.0, 2012-06-04 +------------------------------------ + +This release contains many bugfixes and improvements. The major changes are: + +[#138] Add support for transactions with coarse-grained durability. + Transactions provide atomicity guarantees and rollback, and uncommitted + changes are never written to disk. There is no on-disk log, so + committed changes only become durable when the next checkpoint + completes. Checkpoints are implemented by creating + transactionally-consistent snapshots within data files. + +[#156] Fully support operations that make schema changes with multiple + sessions open concurrently. + +[#159] Disable internal page key suffix compression if a custom collator is + configured. This avoids issues with collators that require complete + keys. + +[#167] Add support for durable snapshots within files. While a snapshot is + active, the pages used by the snapshot will not be overwritten. If a + file is accessed after a crash or application exit without calling + WT_CONNECTION::close, any changes made after the last snapshot will be + silently ignored. + +[#214, #216] + Fixes for forcing eviction with small caches. + +WiredTiger release 1.1.5, 2012-04-26 +------------------------------------ + +Don't update a WT_REF after it has been unlocked. + +Add an operation to set a flag atomically, use it to avoid racing on page flags. + +Fix a race between sync and reading that could cause a segfault. + + +WiredTiger release 1.1.4, 2012-04-16 +------------------------------------ + +Check the versions of autoconf, automake and libtool to avoid failures when +trying to build from the github tree with versions that are too old. + +[#191] Create the schema table as part of creating the environment so that + application threads don't race trying to create it later. + +[#193] Split-merge pages have to be reconciled to mark their parents dirty + +[#194] The dump utility should only output configuration that can be passed to + WT_SESSION::create. + +Eviction fixes for out-of-cache update workloads: + +* Fix an unlikely bug where the EVICT_LRU flag was cleared when a page in + the LRU queue was overwritten with itself during a walk. This led to an + assertion failure when the page was later evicted. + +* Clear all unused eviction queue entries while holding the lru_lock. + +* Split WT_PAGE->flags so that there is no possibility of racing: + (1) Move WT_PAGE_REC_* flags into WT_PAGE_MODIFY; + (2) Use atomic operations to set and clear the remaining (2) page flags. + +Move the test/format threads setting into the CONFIG file. + + +WiredTiger release 1.1.3, 2012-04-04 +------------------------------------ + +Fix the "exclusive" config for WT_SESSION::create. [#181] +1. Make it work for files within a single session. +2. Make it work for files across sessions. +3. Make other data sources consistent with files. + +Fix an eviction bug introduced into 1.1.2: when evicting a page with children, +remove the children from the LRU eviction queue. Reduce the impact of clearing +a page from the LRU queue by marking pages on the queue with a flag +(WT_PAGE_EVICT_LRU). + +During an eviction walk, pin pages up to the root so there is no need to spin +when attempting to lock a parent page. Use the EVICT_LRU page flag to avoid +putting a page on the LRU queue multiple times. + +Layer dump cursors on top of any cursor type. + +Add a section on replacing the default system memory allocator to the tuning +page. + +Typo in usage method for "wt write". + +Don't report range errors for config values that aren't well-formed integers. + + +WiredTiger release 1.1.2, 2012-03-20 +------------------------------------ + +Add public-domain copyright notices to the extension code. + +test/format can now run multi-threaded, fixed two bugs it found: +(1) When iterating backwards through a skiplist, we could race with an insert. +(2) If eviction fails for a page, we have to assume that eviction has unlocked + the reference. + +Scan row-store leaf pages twice when reading to reduce the overhead of the +index array. + +Eviction race fixes: +(1) Call __rec_review with WT_REFs: don't look at the page until we've checked + the state. +(2) Clear the eviction point if we hit it when discarding a child page, not + just the parent. + +Eviction tuning changes, particularly for read-only, out-of-cache workloads. + +Only notify the eviction server if an application thread doesn't find any pages +to evict, and then only once. + +Only spin on the LRU lock if there might be pages in the LRU queue to evict. + +Keep the current eviction point in memory and make the eviction walk run +concurrent with LRU eviction. + +Every test now has err/out captured, and it is checked to assure it is empty at +the end of every test. + + +WiredTiger release 1.1.1, 2012-03-12 +------------------------------------ + +Default to a verbose build: that can be switched off by running `configure +--enable-silent-rules`). + +Account for all memory allocated when reading a page into cache. Total memory +usage is now much closer to the cache size when using many small keys and +values. + +Have application threads trigger a retry forced page eviction rather than +blocking eviction. This allows rec_evict.c to simply set the WT_REF state to +WT_REF_MEM after all failures, and fixes a bug where pages on the forced +eviction queue would end up with state WT_REF_MEM, meaning they could be chosen +for eviction multiple times. + +Grow existing scratch buffers in preference to allocating new ones. + +Fix a race between threads reading in and then modifying a page. + +Get rid of the pinned flag: it is no longer used. + +Fix a race where btree files weren't completely closed before they could be +re-opened. This behavior can be triggered by using a new session on every +operation (see the new -S flag to the test/thread program). [#178] + +When connections are closed, create a session and discard the btree handles. +This fixes a long-standing bug in closing a connection: if for any reason there +are btree handles still open, we need a real session handle to close them. + +Really close btree handles: otherwise we can't safely remove or rename them. +Fixes test failures in test_base02 (among others). + +Wait for application threads in LRU eviction to drain before walking a file. + +Fix a buffer size calculation when updating the root address of a file. + +Documentation fix: 10% of 1MB is 100KB. + + +WiredTiger release 1.1.0, 2012-02-28 +------------------------------------ + +Add checks to the session.truncate method to ensure the start/stop +cursors reference the same object and have been initialized. + +Implement cursor duplication via WT_SESSION::open_cursor. [#161] + +Switch to quiet builds by default. + +Fix with automake version < 1.11, use foreign mode so that fewer +top-level files are required. + +If a session or connection method is about to return WT_NOTFOUND (some +underlying object was not found), map it to ENOENT, only cursor methods +return WT_NOTFOUND. [#163] + +Save and restore session->btree in schema ops to simplify calling code. +[#164] + +Note the wiredtiger_open config string "multiprocess" is not yet +supported. + +Move "root:F" and "version:F" entries for files into the value for +"file:F", so there is only a single record per file. +[NOTE: SCHEMA CHANGE] + +When parsing config strings, continue to the end of the string in case +of repeated keys. [#124] + +Don't require shared libraries unless Python is configured. + +Add support for direct I/O, with the config "direct_io=(data,log)". +Build with _GNU_SOURCE on Linux to enable O_DIRECT. + +Don't keep the last page of column stores pinned: it prevented eviction +of large trees created from scratch. + +Allow application threads to evict pages from any tree: maintain a count +of threads doing LRU in each tree and wait for activity to drain when +closing. diff --git a/src/docs/doxygen.log b/src/docs/doxygen.log new file mode 100644 index 00000000000..2b7bf75d679 --- /dev/null +++ b/src/docs/doxygen.log @@ -0,0 +1,37 @@ +/mnt/fast/alexg/work/amz/wiredtiger/src/include/wiredtiger.in:857: warning: The following parameters of WT_SESSION::open_cursor(WT_SESSION *session, const char *uri, WT_CURSOR *to_dup, const char *config, WT_CURSOR **cursorp) are not documented: + parameter 'to_dup' + parameter 'config' + parameter 'cursorp' +/mnt/fast/alexg/work/amz/wiredtiger/src/include/wiredtiger.in:857: warning: return type of member WT_SESSION::open_cursor is not documented +/mnt/fast/alexg/work/amz/wiredtiger/src/include/wiredtiger.in:1451: warning: block marked with [Snapshot example] for \snippet should appear twice in file ex_all.c, found it 0 times + +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/AsyncCallback.java:36: warning: return type of member com.wiredtiger.db.AsyncCallback.notify is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:42: warning: Member format (variable) of class com::wiredtiger::db::PackFormatInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:43: warning: Member formatOff (variable) of class com::wiredtiger::db::PackFormatInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:44: warning: Member formatRepeatCount (variable) of class com::wiredtiger::db::PackFormatInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:65: warning: return type of member com.wiredtiger.db.PackFormatInputStream.available is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:171: warning: return type of member com.wiredtiger.db.PackFormatInputStream.getLengthFromFormat is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:82: warning: return type of member com.wiredtiger.db.PackFormatInputStream.getType is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java:58: warning: return type of member com.wiredtiger.db.PackFormatInputStream.toString is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:42: warning: Member format (variable) of class com::wiredtiger::db::PackInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:43: warning: Member value (variable) of class com::wiredtiger::db::PackInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:44: warning: Member valueOff (variable) of class com::wiredtiger::db::PackInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:45: warning: Member valueLen (variable) of class com::wiredtiger::db::PackInputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:89: warning: return type of member com.wiredtiger.db.PackInputStream.getByte is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:126: warning: return type of member com.wiredtiger.db.PackInputStream.getByteArray is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:75: warning: return type of member com.wiredtiger.db.PackInputStream.getFormat is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:170: warning: return type of member com.wiredtiger.db.PackInputStream.getInt is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:185: warning: return type of member com.wiredtiger.db.PackInputStream.getLong is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:199: warning: return type of member com.wiredtiger.db.PackInputStream.getRecord is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:209: warning: return type of member com.wiredtiger.db.PackInputStream.getShort is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:223: warning: return type of member com.wiredtiger.db.PackInputStream.getString is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java:82: warning: return type of member com.wiredtiger.db.PackInputStream.getValue is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java:42: warning: Member format (variable) of class com::wiredtiger::db::PackOutputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java:43: warning: Member packed (variable) of class com::wiredtiger::db::PackOutputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java:44: warning: Member intBuf (variable) of class com::wiredtiger::db::PackOutputStream is not documented. +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java:59: warning: return type of member com.wiredtiger.db.PackOutputStream.getFormat is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java:66: warning: return type of member com.wiredtiger.db.PackOutputStream.getValue is not documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerException.java:35: warning: parameters of member com.wiredtiger.db.WiredTigerException.WiredTigerException are not (all) documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java:36: warning: parameters of member com.wiredtiger.db.WiredTigerPackingException.WiredTigerPackingException are not (all) documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java:37: warning: parameters of member com.wiredtiger.db.WiredTigerPanicException.WiredTigerPanicException are not (all) documented +/mnt/fast/alexg/work/amz/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java:36: warning: parameters of member com.wiredtiger.db.WiredTigerRollbackException.WiredTigerRollbackException are not (all) documented diff --git a/src/include/api.h b/src/include/api.h index 70068e32b9b..8e0d47f42b1 100644 --- a/src/include/api.h +++ b/src/include/api.h @@ -24,9 +24,9 @@ { WT_CONFIG_BASE(s, h##_##n), config, NULL }; \ API_SESSION_INIT(s, h, n, cur, dh); \ WT_ERR(WT_SESSION_CHECK_PANIC(s)); \ - WT_ERR(((config) != NULL) ? \ - __wt_config_check((s), \ - WT_CONFIG_REF(session, h##_##n), (config), 0) : 0); \ + if ((config) != NULL) \ + WT_ERR(__wt_config_check((s), \ + WT_CONFIG_REF(session, h##_##n), (config), 0)); \ WT_ERR(__wt_verbose((s), WT_VERB_API, "CALL: " #h ":" #n)) #define API_END(s, ret) \ diff --git a/src/include/btree.i b/src/include/btree.i index dfb9cbfe37d..b238786b3e6 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -1271,104 +1271,3 @@ __wt_btree_lsm_size(WT_SESSION_IMPL *session, uint64_t maxsize) return (child->memory_footprint > maxsize); } - -/* - * __wt_lex_compare -- - * Lexicographic comparison routine. - * - * Returns: - * < 0 if user_item is lexicographically < tree_item - * = 0 if user_item is lexicographically = tree_item - * > 0 if user_item is lexicographically > tree_item - * - * We use the names "user" and "tree" so it's clear in the btree code which - * the application is looking at when we call its comparison func. - */ -static inline int -__wt_lex_compare(const WT_ITEM *user_item, const WT_ITEM *tree_item) -{ - const uint8_t *userp, *treep; - size_t len, usz, tsz; - - usz = user_item->size; - tsz = tree_item->size; - len = WT_MIN(usz, tsz); - - for (userp = user_item->data, treep = tree_item->data; - len > 0; - --len, ++userp, ++treep) - if (*userp != *treep) - return (*userp < *treep ? -1 : 1); - - /* Contents are equal up to the smallest length. */ - return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1); -} - -/* - * __wt_compare -- - * The same as __wt_lex_compare, but using the application's collator - * function when configured. - */ -static inline int -__wt_compare(WT_SESSION_IMPL *session, WT_COLLATOR *collator, - const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp) -{ - if (collator == NULL) { - *cmpp = __wt_lex_compare(user_item, tree_item); - return (0); - } - return (collator->compare( - collator, &session->iface, user_item, tree_item, cmpp)); -} - -/* - * __wt_lex_compare_skip -- - * Lexicographic comparison routine, skipping leading bytes. - * - * Returns: - * < 0 if user_item is lexicographically < tree_item - * = 0 if user_item is lexicographically = tree_item - * > 0 if user_item is lexicographically > tree_item - * - * We use the names "user" and "tree" so it's clear in the btree code which - * the application is looking at when we call its comparison func. - */ -static inline int -__wt_lex_compare_skip( - const WT_ITEM *user_item, const WT_ITEM *tree_item, size_t *matchp) -{ - const uint8_t *userp, *treep; - size_t len, usz, tsz; - - usz = user_item->size; - tsz = tree_item->size; - len = WT_MIN(usz, tsz) - *matchp; - - for (userp = (uint8_t *)user_item->data + *matchp, - treep = (uint8_t *)tree_item->data + *matchp; - len > 0; - --len, ++userp, ++treep, ++*matchp) - if (*userp != *treep) - return (*userp < *treep ? -1 : 1); - - /* Contents are equal up to the smallest length. */ - return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1); -} - -/* - * __wt_compare_skip -- - * The same as __wt_lex_compare_skip, but using the application's collator - * function when configured. - */ -static inline int -__wt_compare_skip(WT_SESSION_IMPL *session, WT_COLLATOR *collator, - const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp, - size_t *matchp) -{ - if (collator == NULL) { - *cmpp = __wt_lex_compare_skip(user_item, tree_item, matchp); - return (0); - } - return (collator->compare( - collator, &session->iface, user_item, tree_item, cmpp)); -} diff --git a/src/include/btree_cmp.i b/src/include/btree_cmp.i new file mode 100644 index 00000000000..76f1ad4317a --- /dev/null +++ b/src/include/btree_cmp.i @@ -0,0 +1,190 @@ +/*- + * Copyright (c) 2014-2015 MongoDB, Inc. + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +#ifdef HAVE_X86INTRIN_H +#if !defined(_MSC_VER) +#include <x86intrin.h> +#endif + /* 16B alignment */ +#define WT_ALIGNED_16(p) (((uintptr_t)(p) & 0x0f) == 0) +#define WT_VECTOR_SIZE 16 /* chunk size */ +#endif + +/* + * __wt_lex_compare -- + * Lexicographic comparison routine. + * + * Returns: + * < 0 if user_item is lexicographically < tree_item + * = 0 if user_item is lexicographically = tree_item + * > 0 if user_item is lexicographically > tree_item + * + * We use the names "user" and "tree" so it's clear in the btree code which + * the application is looking at when we call its comparison function. + */ +static inline int +__wt_lex_compare(const WT_ITEM *user_item, const WT_ITEM *tree_item) +{ + size_t len, usz, tsz; + const uint8_t *userp, *treep; + + usz = user_item->size; + tsz = tree_item->size; + len = WT_MIN(usz, tsz); + + userp = user_item->data; + treep = tree_item->data; + +#ifdef HAVE_X86INTRIN_H + /* Use vector instructions if we'll execute at least 2 of them. */ + if (len >= WT_VECTOR_SIZE * 2) { + size_t remain; + __m128i res_eq, u, t; + + remain = len % WT_VECTOR_SIZE; + len -= remain; + if (WT_ALIGNED_16(userp) && WT_ALIGNED_16(treep)) + for (; len > 0; + len -= WT_VECTOR_SIZE, + userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE) { + u = _mm_load_si128((__m128i *)userp); + t = _mm_load_si128((__m128i *)treep); + res_eq = _mm_cmpeq_epi8(u, t); + if (_mm_movemask_epi8(res_eq) != 65535) + break; + } + else + for (; len > 0; + len -= WT_VECTOR_SIZE, + userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE) { + u = _mm_loadu_si128((__m128i *)userp); + t = _mm_loadu_si128((__m128i *)treep); + res_eq = _mm_cmpeq_epi8(u, t); + if (_mm_movemask_epi8(res_eq) != 65535) + break; + } + len += remain; + } +#endif + /* + * Use the non-vectorized version for the remaining bytes and for the + * small key sizes. + */ + for (; len > 0; --len, ++userp, ++treep) + if (*userp != *treep) + return (*userp < *treep ? -1 : 1); + + /* Contents are equal up to the smallest length. */ + return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1); +} + +/* + * __wt_compare -- + * The same as __wt_lex_compare, but using the application's collator + * function when configured. + */ +static inline int +__wt_compare(WT_SESSION_IMPL *session, WT_COLLATOR *collator, + const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp) +{ + if (collator == NULL) { + *cmpp = __wt_lex_compare(user_item, tree_item); + return (0); + } + return (collator->compare( + collator, &session->iface, user_item, tree_item, cmpp)); +} + +/* + * __wt_lex_compare_skip -- + * Lexicographic comparison routine, skipping leading bytes. + * + * Returns: + * < 0 if user_item is lexicographically < tree_item + * = 0 if user_item is lexicographically = tree_item + * > 0 if user_item is lexicographically > tree_item + * + * We use the names "user" and "tree" so it's clear in the btree code which + * the application is looking at when we call its comparison function. + */ +static inline int +__wt_lex_compare_skip( + const WT_ITEM *user_item, const WT_ITEM *tree_item, size_t *matchp) +{ + size_t len, usz, tsz; + const uint8_t *userp, *treep; + + usz = user_item->size; + tsz = tree_item->size; + len = WT_MIN(usz, tsz) - *matchp; + + userp = (uint8_t *)user_item->data + *matchp; + treep = (uint8_t *)tree_item->data + *matchp; + +#ifdef HAVE_X86INTRIN_H + /* Use vector instructions if we'll execute at least 2 of them. */ + if (len >= WT_VECTOR_SIZE * 2) { + size_t remain; + __m128i res_eq, u, t; + + remain = len % WT_VECTOR_SIZE; + len -= remain; + if (WT_ALIGNED_16(userp) && WT_ALIGNED_16(treep)) + for (; len > 0; + len -= WT_VECTOR_SIZE, + userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE, + *matchp += WT_VECTOR_SIZE) { + u = _mm_load_si128((__m128i *)userp); + t = _mm_load_si128((__m128i *)treep); + res_eq = _mm_cmpeq_epi8(u, t); + if (_mm_movemask_epi8(res_eq) != 65535) + break; + } + else + for (; len > 0; + len -= WT_VECTOR_SIZE, + userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE, + *matchp += WT_VECTOR_SIZE) { + u = _mm_loadu_si128((__m128i *)userp); + t = _mm_loadu_si128((__m128i *)treep); + res_eq = _mm_cmpeq_epi8(u, t); + if (_mm_movemask_epi8(res_eq) != 65535) + break; + } + len += remain; + } +#endif + /* + * Use the non-vectorized version for the remaining bytes and for the + * small key sizes. + */ + for (; len > 0; --len, ++userp, ++treep, ++*matchp) + if (*userp != *treep) + return (*userp < *treep ? -1 : 1); + + /* Contents are equal up to the smallest length. */ + return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1); +} + +/* + * __wt_compare_skip -- + * The same as __wt_lex_compare_skip, but using the application's collator + * function when configured. + */ +static inline int +__wt_compare_skip(WT_SESSION_IMPL *session, WT_COLLATOR *collator, + const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp, + size_t *matchp) +{ + if (collator == NULL) { + *cmpp = __wt_lex_compare_skip(user_item, tree_item, matchp); + return (0); + } + return (collator->compare( + collator, &session->iface, user_item, tree_item, cmpp)); +} diff --git a/src/include/cell.i b/src/include/cell.i index 77e9fa1e3c1..806cd247a42 100644 --- a/src/include/cell.i +++ b/src/include/cell.i @@ -549,14 +549,15 @@ __wt_cell_leaf_value_parse(WT_PAGE *page, WT_CELL *cell) static inline int __wt_cell_unpack_safe(WT_CELL *cell, WT_CELL_UNPACK *unpack, uint8_t *end) { - uint64_t saved_v, v; - uint32_t saved_len; - int copied; + struct { + uint64_t len; + uint32_t v; + } copy; + uint64_t v; const uint8_t *p; - copied = 0; - saved_len = 0; - saved_v = 0; + copy.len = 0; + copy.v = 0; /* -Werror=maybe-uninitialized */ /* * The verification code specifies an end argument, a pointer to 1 past @@ -572,14 +573,18 @@ __wt_cell_unpack_safe(WT_CELL *cell, WT_CELL_UNPACK *unpack, uint8_t *end) restart: /* - * This code is performance critical for scans through read-only trees. - * Avoid WT_CLEAR here: it makes this code run significantly slower. + * This path is performance critical for read-only trees, we're parsing + * on-page structures. For that reason we don't clear the unpacked cell + * structure (although that would be simpler), instead we make sure we + * initialize all structure elements either here or in the immediately + * following switch. */ - WT_CLEAR_INLINE(WT_CELL_UNPACK, *unpack); WT_CELL_LEN_CHK(cell, 0); unpack->cell = cell; - unpack->type = __wt_cell_type(cell); + unpack->v = 0; unpack->raw = __wt_cell_type_raw(cell); + unpack->type = __wt_cell_type(cell); + unpack->ovfl = 0; /* * Handle cells with neither an RLE count or data length: short key/data @@ -589,19 +594,24 @@ restart: case WT_CELL_KEY_SHORT_PFX: WT_CELL_LEN_CHK(cell, 1); /* skip prefix */ unpack->prefix = cell->__chunk[1]; - unpack->data = cell->__chunk + 2; unpack->size = cell->__chunk[0] >> WT_CELL_SHORT_SHIFT; unpack->__len = 2 + unpack->size; goto done; case WT_CELL_KEY_SHORT: case WT_CELL_VALUE_SHORT: + unpack->prefix = 0; unpack->data = cell->__chunk + 1; unpack->size = cell->__chunk[0] >> WT_CELL_SHORT_SHIFT; unpack->__len = 1 + unpack->size; goto done; } + unpack->prefix = 0; + unpack->data = NULL; + unpack->size = 0; + unpack->__len = 0; + p = (uint8_t *)cell + 1; /* skip cell */ /* @@ -638,10 +648,9 @@ restart: */ WT_RET(__wt_vunpack_uint( &p, end == NULL ? 0 : (size_t)(end - p), &v)); - saved_len = WT_PTRDIFF32(p, cell); - saved_v = unpack->v; + copy.len = WT_PTRDIFF32(p, cell); + copy.v = unpack->v; cell = (WT_CELL *)((uint8_t *)cell - v); - copied = 1; goto restart; case WT_CELL_KEY_OVFL: @@ -691,10 +700,10 @@ restart: * we need the right length). */ done: WT_CELL_LEN_CHK(cell, unpack->__len); - if (copied) { + if (copy.len != 0) { unpack->raw = WT_CELL_VALUE_COPY; - unpack->__len = saved_len; - unpack->v = saved_v; + unpack->__len = copy.len; + unpack->v = copy.v; } return (0); diff --git a/src/include/config.h b/src/include/config.h index 89ae686a521..a77fe5ed635 100644 --- a/src/include/config.h +++ b/src/include/config.h @@ -22,6 +22,7 @@ struct __wt_config_check { int (*checkf)(WT_SESSION_IMPL *, WT_CONFIG_ITEM *); const char *checks; const WT_CONFIG_CHECK *subconfigs; + u_int subconfigs_entries; }; #define WT_CONFIG_REF(session, n) \ @@ -33,6 +34,7 @@ struct __wt_config_entry { const char *base; /* configuration base */ const WT_CONFIG_CHECK *checks; /* check array */ + u_int checks_entries; }; struct __wt_config_parser_impl { diff --git a/src/include/extern.h b/src/include/extern.h index 8a67391edb1..cd60cedf168 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -326,7 +326,7 @@ extern int __wt_log_open(WT_SESSION_IMPL *session); extern int __wt_log_close(WT_SESSION_IMPL *session); extern int __wt_log_newfile(WT_SESSION_IMPL *session, int conn_create, int *created); extern int __wt_log_read(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags); -extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, void *cookie, int firstrecord), void *cookie); +extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp, void *cookie, int firstrecord), void *cookie); extern int __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags); extern int __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap); extern int __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp); @@ -491,10 +491,10 @@ extern int __wt_read( WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size 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, 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, WT_FHANDLE_MODE mode_flag); +extern int __wt_vfprintf(FILE *fp, const char *fmt, va_list ap); +extern int __wt_fprintf(FILE *fp, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3))); +extern int __wt_fflush(FILE *fp); +extern int __wt_fclose(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, WT_THREAD_CALLBACK(*func)(void *), void *arg); extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid); diff --git a/src/include/misc.h b/src/include/misc.h index 12cf2dec375..383df3179e7 100644 --- a/src/include/misc.h +++ b/src/include/misc.h @@ -134,17 +134,6 @@ #define WT_VERBOSE_ISSET(session, f) 0 #endif -/* - * Clear a structure, two flavors: inline when we want to guarantee there's - * no function call or setup/tear-down of a loop, and the default where the - * compiler presumably chooses. Gcc 4.3 is supposed to get this right, but - * we've seen problems when calling memset to clear structures in performance - * critical paths. - */ -#define WT_CLEAR_INLINE(type, s) do { \ - static const type __clear; \ - s = __clear; \ -} while (0) #define WT_CLEAR(s) \ memset(&(s), 0, sizeof(s)) diff --git a/src/include/mutex.i b/src/include/mutex.i index e4b497af2a7..bd6ad24d676 100644 --- a/src/include/mutex.i +++ b/src/include/mutex.i @@ -204,8 +204,9 @@ __wt_spin_trylock_func(WT_SESSION_IMPL *session, WT_DECL_RET; conn = S2C_SAFE(session); + /* If we're not maintaining statistics, it's simple. */ - if (session == NULL || !FLD_ISSET(conn->stat_flags, WT_STAT_CONN_FAST)) + if (session == NULL || !FLD_ISSET(conn->stat_flags, WT_CONN_STAT_FAST)) return (pthread_mutex_trylock(&t->lock)); /* @@ -256,7 +257,7 @@ __wt_spin_lock_func(WT_SESSION_IMPL *session, { /* If we're not maintaining statistics, it's simple. */ if (session == NULL || - !FLD_ISSET(conn->stat_flags, WT_STAT_CONN_FAST)) { + !FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) { pthread_mutex_lock(&t->lock); return; } @@ -273,7 +274,6 @@ __wt_spin_lock_func(WT_SESSION_IMPL *session, t->id = *idp; WT_FULL_BARRIER(); } - #endif /* diff --git a/src/include/wt_internal.h b/src/include/wt_internal.h index cfd403f42e5..b51c983a3c9 100644 --- a/src/include/wt_internal.h +++ b/src/include/wt_internal.h @@ -41,9 +41,6 @@ extern "C" { #else #include <pthread.h> #endif -#ifdef HAVE_PTHREAD_NP_H -#include <pthread_np.h> -#endif #include <stddef.h> #include <stdio.h> #include <stdint.h> @@ -333,6 +330,7 @@ struct __wt_update; #include "txn.i" /* required by btree.i */ #include "btree.i" /* required by cursor.i */ +#include "btree_cmp.i" #include "cursor.i" #include "bitstring.i" diff --git a/src/log/log.c b/src/log/log.c index 28483624b83..a68816a543a 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -1238,7 +1238,8 @@ err: int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, - WT_ITEM *record, WT_LSN *lsnp, void *cookie, int firstrecord), void *cookie) + WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp, + void *cookie, int firstrecord), void *cookie) { WT_CONNECTION_IMPL *conn; WT_DECL_ITEM(uncitem); @@ -1247,7 +1248,7 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, WT_ITEM buf; WT_LOG *log; WT_LOG_RECORD *logrec; - WT_LSN end_lsn, rd_lsn, start_lsn; + WT_LSN end_lsn, next_lsn, rd_lsn, start_lsn; wt_off_t log_size; uint32_t allocsize, cksum, firstlog, lastlog, lognum, rdup_len, reclen; u_int i, logcount; @@ -1370,6 +1371,7 @@ advance: WT_ERR(__log_openfile( session, 0, &log_fh, WT_LOG_FILENAME, rd_lsn.file)); WT_ERR(__log_filesize(session, log_fh, &log_size)); + eol = 0; continue; } /* @@ -1432,6 +1434,12 @@ advance: */ if (log != NULL) log->trunc_lsn = rd_lsn; + /* + * If the user asked for a specific LSN and it is not + * a valid LSN, return WT_NOTFOUND. + */ + if (LF_ISSET(WT_LOGSCAN_ONE)) + ret = WT_NOTFOUND; break; } @@ -1440,23 +1448,25 @@ advance: * header, invoke the callback. */ WT_STAT_FAST_CONN_INCR(session, log_scan_records); + next_lsn = rd_lsn; + next_lsn.offset += (wt_off_t)rdup_len; if (rd_lsn.offset != 0) { if (F_ISSET(logrec, WT_LOG_RECORD_COMPRESSED)) { WT_ERR(__log_decompress(session, &buf, &uncitem)); WT_ERR((*func)(session, uncitem, &rd_lsn, - cookie, firstrecord)); + &next_lsn, cookie, firstrecord)); __wt_scr_free(session, &uncitem); } else - WT_ERR((*func)(session, &buf, &rd_lsn, cookie, - firstrecord)); + WT_ERR((*func)(session, &buf, + &rd_lsn, &next_lsn, cookie, firstrecord)); firstrecord = 0; if (LF_ISSET(WT_LOGSCAN_ONE)) break; } - rd_lsn.offset += (wt_off_t)rdup_len; + rd_lsn = next_lsn; } /* Truncate if we're in recovery. */ diff --git a/src/meta/meta_turtle.c b/src/meta/meta_turtle.c index 7e3ac3530f8..79a555d0922 100644 --- a/src/meta/meta_turtle.c +++ b/src/meta/meta_turtle.c @@ -96,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, WT_FHANDLE_READ)); +err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_READ)); __wt_scr_free(session, &key); __wt_scr_free(session, &value); return (ret); @@ -259,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, WT_FHANDLE_READ)); +err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_READ)); __wt_scr_free(session, &buf); return (ret); } diff --git a/src/os_posix/os_open.c b/src/os_posix/os_open.c index 33b07ed6a49..dd3ee7f4e11 100644 --- a/src/os_posix/os_open.c +++ b/src/os_posix/os_open.c @@ -60,7 +60,7 @@ __wt_open(WT_SESSION_IMPL *session, hash = __wt_hash_city64(name, strlen(name)); bucket = hash % WT_HASH_ARRAY_SIZE; __wt_spin_lock(session, &conn->fh_lock); - SLIST_FOREACH(tfh, &conn->fhhash[bucket], l) { + SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl) { if (strcmp(name, tfh->name) == 0) { ++tfh->ref; *fhp = tfh; @@ -174,7 +174,7 @@ setupfh: */ matched = 0; __wt_spin_lock(session, &conn->fh_lock); - SLIST_FOREACH(tfh, &conn->fhhash[bucket], l) { + SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl) { if (strcmp(name, tfh->name) == 0) { ++tfh->ref; *fhp = tfh; diff --git a/src/os_posix/os_remove.c b/src/os_posix/os_remove.c index d1f658b7ae1..3fc692d8755 100644 --- a/src/os_posix/os_remove.c +++ b/src/os_posix/os_remove.c @@ -29,7 +29,7 @@ __remove_file_check(WT_SESSION_IMPL *session, const char *name) * level should have closed it before removing. */ __wt_spin_lock(session, &conn->fh_lock); - SLIST_FOREACH(fh, &conn->fhhash[bucket], l) + SLIST_FOREACH(fh, &conn->fhhash[bucket], hashl) if (strcmp(name, fh->name) == 0) break; __wt_spin_unlock(session, &conn->fh_lock); diff --git a/src/os_posix/os_stdio.c b/src/os_posix/os_stdio.c index 8d97fdd2880..da880f5521e 100644 --- a/src/os_posix/os_stdio.c +++ b/src/os_posix/os_stdio.c @@ -59,13 +59,9 @@ __wt_fopen(WT_SESSION_IMPL *session, * Vfprintf for a FILE handle. */ int -__wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap) +__wt_vfprintf(FILE *fp, const char *fmt, va_list ap) { - WT_DECL_RET; - - WT_UNUSED(session); - - return (vfprintf(fp, fmt, ap) < 0 ? __wt_errno() : ret); + return (vfprintf(fp, fmt, ap) < 0 ? __wt_errno() : 0); } /* @@ -73,14 +69,14 @@ __wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap) * Fprintf for a FILE handle. */ int -__wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...) - WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4))) +__wt_fprintf(FILE *fp, const char *fmt, ...) + WT_GCC_FUNC_ATTRIBUTE((format (printf, 2, 3))) { WT_DECL_RET; va_list ap; va_start(ap, fmt); - ret = __wt_vfprintf(session, fp, fmt, ap); + ret = __wt_vfprintf(fp, fmt, ap); va_end(ap); return (ret); @@ -91,10 +87,8 @@ __wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...) * Flush a FILE handle. */ int -__wt_fflush(WT_SESSION_IMPL *session, FILE *fp) +__wt_fflush(FILE *fp) { - WT_UNUSED(session); - /* Flush the handle. */ return (fflush(fp) == 0 ? 0 : __wt_errno()); } @@ -104,7 +98,7 @@ __wt_fflush(WT_SESSION_IMPL *session, FILE *fp) * Close a FILE handle. */ int -__wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag) +__wt_fclose(FILE **fpp, WT_FHANDLE_MODE mode_flag) { FILE *fp; WT_DECL_RET; @@ -120,7 +114,7 @@ __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag) * OS buffers, then flush the OS buffers to the backing disk. */ if (mode_flag == WT_FHANDLE_APPEND || mode_flag == WT_FHANDLE_WRITE) { - ret = __wt_fflush(session, fp); + ret = __wt_fflush(fp); if (fsync(fileno(fp)) != 0) WT_TRET(__wt_errno()); } diff --git a/src/os_win/os_errno.c b/src/os_win/os_errno.c index 81bcdf9089e..097c73b5731 100644 --- a/src/os_win/os_errno.c +++ b/src/os_win/os_errno.c @@ -28,7 +28,7 @@ __wt_map_error_to_windows_error(int error) { } /* - * __wt_map_error_to_windows_error -- + * __wt_map_windows_error_to_error -- * Return a positive integer, a decoded Windows error */ static int diff --git a/src/os_win/os_fallocate.c b/src/os_win/os_fallocate.c index f01ef0e101a..3b4db8ff78d 100644 --- a/src/os_win/os_fallocate.c +++ b/src/os_win/os_fallocate.c @@ -47,10 +47,8 @@ __wt_fallocate( WT_RET_MSG(session, __wt_errno(), "%s SetFilePointerEx error", fh->name); - if ((ret = SetEndOfFile(fh->filehandle_secondary)) != FALSE) { - fh->size = fh->extend_size = len; + if ((ret = SetEndOfFile(fh->filehandle_secondary)) != FALSE) return (0); - } WT_RET_MSG(session, __wt_errno(), "%s SetEndOfFile error", fh->name); } diff --git a/src/os_win/os_once.c b/src/os_win/os_once.c index bec8c08777c..bb5e059452e 100644 --- a/src/os_win/os_once.c +++ b/src/os_win/os_once.c @@ -28,8 +28,8 @@ BOOL CALLBACK _wt_init_once_callback( } /* - * __wt_library_init -- - * Some things to do, before we do anything else. + * __wt_once -- + * One-time initialization per process. */ int __wt_once(void(*init_routine)(void)) diff --git a/src/os_win/os_open.c b/src/os_win/os_open.c index 4039bcb21e5..a27bc565c18 100644 --- a/src/os_win/os_open.c +++ b/src/os_win/os_open.c @@ -39,7 +39,7 @@ __wt_open(WT_SESSION_IMPL *session, /* Increment the reference count if we already have the file open. */ matched = 0; __wt_spin_lock(session, &conn->fh_lock); - SLIST_FOREACH(tfh, &conn->fhhash[bucket], l) + SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl) if (strcmp(name, tfh->name) == 0) { ++tfh->ref; *fhp = tfh; @@ -160,7 +160,7 @@ setupfh: */ matched = 0; __wt_spin_lock(session, &conn->fh_lock); - SLIST_FOREACH(tfh, &conn->fhhash[bucket], l) + SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl) if (strcmp(name, tfh->name) == 0) { ++tfh->ref; *fhp = tfh; diff --git a/src/os_win/os_remove.c b/src/os_win/os_remove.c index 45b4d5ce6b0..0c6396c775f 100644 --- a/src/os_win/os_remove.c +++ b/src/os_win/os_remove.c @@ -29,7 +29,7 @@ __remove_file_check(WT_SESSION_IMPL *session, const char *name) * level should have closed it before removing. */ __wt_spin_lock(session, &conn->fh_lock); - SLIST_FOREACH(fh, &conn->fhhash[bucket], l) + SLIST_FOREACH(fh, &conn->fhhash[bucket], hashl) if (strcmp(name, fh->name) == 0) break; __wt_spin_unlock(session, &conn->fh_lock); diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index 0ce220e486e..158be891b16 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -127,15 +127,15 @@ typedef struct { */ struct __rec_boundary { /* - * The start field records location in the initial split buffer, - * that is, the first byte of the split chunk recorded before we - * decide to split a page; the offset between the first byte of - * chunk[0] and the first byte of chunk[1] is chunk[0]'s length. + * Offset is the byte offset in the initial split buffer of the + * first byte of the split chunk, recorded before we decide to + * split the page; the difference between chunk[1]'s offset and + * chunk[0]'s offset is chunk[0]'s length. * - * Once we split a page, we stop filling in the start field, as - * we're writing the split chunks as we find them. + * Once we split a page, we stop filling in offset values, we're + * writing the split chunks as we find them. */ - uint8_t *start; /* Split's first byte */ + size_t offset; /* Split's first byte */ /* * The recno and entries fields are the starting record number @@ -1511,8 +1511,7 @@ __rec_leaf_page_max(WT_SESSION_IMPL *session, WT_RECONCILE *r) static void __rec_split_bnd_init(WT_SESSION_IMPL *session, WT_BOUNDARY *bnd) { - bnd->start = NULL; - + bnd->offset = 0; bnd->recno = 0; bnd->entries = 0; @@ -1526,7 +1525,10 @@ __rec_split_bnd_init(WT_SESSION_IMPL *session, WT_BOUNDARY *bnd) bnd->skip_next = 0; bnd->skip_allocated = 0; - /* Ignore the key, we re-use that memory in each new reconciliation. */ + /* + * Don't touch the key, we re-use that memory in each new + * reconciliation. + */ bnd->already_compressed = 0; } @@ -1541,8 +1543,8 @@ __rec_split_bnd_grow(WT_SESSION_IMPL *session, WT_RECONCILE *r) /* * Make sure there's enough room for another boundary. The calculation * is +2, because when filling in the current boundary's information, - * we save the start point of the next boundary (for example, a record - * number or key), in the (current + 1) slot. + * we save start information for the next boundary (a byte offset and a + * record number or key), in the (current + 1) slot. * * For the same reason, we're always initializing one ahead. */ @@ -1691,7 +1693,7 @@ __rec_split_init(WT_SESSION_IMPL *session, WT_RET(__rec_split_bnd_grow(session, r)); __rec_split_bnd_init(session, &r->bnd[0]); r->bnd[0].recno = recno; - r->bnd[0].start = WT_PAGE_HEADER_BYTE(btree, dsk); + r->bnd[0].offset = WT_PAGE_HEADER_BYTE_SIZE(btree); /* * If the maximum page size is the same as the split page size, either @@ -1983,10 +1985,10 @@ __rec_split(WT_SESSION_IMPL *session, WT_RECONCILE *r, size_t next_len) session, r, &next->key, dsk->type)); /* - * Set the starting buffer address and clear the entries (the + * Set the starting buffer offset and clear the entries (the * latter not required, but cleaner). */ - next->start = r->first_free; + next->offset = WT_PTRDIFF(r->first_free, dsk); next->entries = 0; /* Set the space available to another split-size chunk. */ @@ -2642,8 +2644,8 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r) WT_DECL_ITEM(tmp); WT_DECL_RET; WT_PAGE_HEADER *dsk; - uint32_t i, len; - uint8_t *dsk_start; + size_t i, len; + uint8_t *dsk_start, *p; /* * When we overflow physical limits of the page, we walk the list of @@ -2671,8 +2673,8 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r) dsk_start = WT_PAGE_HEADER_BYTE(btree, dsk); for (i = 0, bnd = r->bnd; i < r->bnd_next; ++i, ++bnd) { /* Copy the page contents to the temporary buffer. */ - len = WT_PTRDIFF32((bnd + 1)->start, bnd->start); - memcpy(dsk_start, bnd->start, len); + len = (bnd + 1)->offset - bnd->offset; + memcpy(dsk_start, (uint8_t *)r->dsk.mem + bnd->offset, len); /* Finalize the header information and write the page. */ dsk->recno = bnd->recno; @@ -2697,13 +2699,14 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r) * chunk, including header, because if there was room for that large a * remnant, we wouldn't have switched from accumulating to a page end. */ - len = WT_PTRDIFF32(r->first_free, bnd->start); + p = (uint8_t *)r->dsk.mem + bnd->offset; + len = WT_PTRDIFF(r->first_free, p); if (len >= r->split_size - WT_PAGE_HEADER_BYTE_SIZE(btree)) WT_PANIC_ERR(session, EINVAL, "Reconciliation remnant too large for the split buffer"); dsk = r->dsk.mem; dsk_start = WT_PAGE_HEADER_BYTE(btree, dsk); - (void)memmove(dsk_start, bnd->start, len); + (void)memmove(dsk_start, p, len); /* * Fix up our caller's information, including updating the starting @@ -5470,15 +5473,6 @@ err: __wt_scr_free(session, &tmp); } /* - * The dictionary -- - * The rest of this file is support for dictionaries. - * - * It's difficult to write generic skiplist functions without turning a single - * memory allocation into two, or requiring a function call instead of a simple - * comparison. Fortunately, skiplists are relatively simple things and we can - * include them in-place. If you need generic skip-list functions to modify, - * this set wouldn't be a bad place to start. - * * __rec_dictionary_skip_search -- * Search a dictionary skiplist. */ diff --git a/src/support/err.c b/src/support/err.c index fc6569cb81e..34e44701ea0 100644 --- a/src/support/err.c +++ b/src/support/err.c @@ -16,15 +16,12 @@ static int __handle_error_default(WT_EVENT_HANDLER *handler, WT_SESSION *wt_session, int error, const char *errmsg) { - WT_SESSION_IMPL *session; - WT_UNUSED(handler); + WT_UNUSED(wt_session); WT_UNUSED(error); - session = (WT_SESSION_IMPL *)wt_session; - - WT_RET(__wt_fprintf(session, stderr, "%s\n", errmsg)); - WT_RET(__wt_fflush(session, stderr)); + WT_RET(__wt_fprintf(stderr, "%s\n", errmsg)); + WT_RET(__wt_fflush(stderr)); return (0); } @@ -36,14 +33,11 @@ static int __handle_message_default(WT_EVENT_HANDLER *handler, WT_SESSION *wt_session, const char *message) { - WT_SESSION_IMPL *session; - WT_UNUSED(handler); + WT_UNUSED(wt_session); - session = (WT_SESSION_IMPL *)wt_session; - - WT_RET(__wt_fprintf(session, stdout, "%s\n", message)); - WT_RET(__wt_fflush(session, stdout)); + WT_RET(__wt_fprintf(stdout, "%s\n", message)); + WT_RET(__wt_fflush(stdout)); return (0); } @@ -181,13 +175,13 @@ __wt_eventv(WT_SESSION_IMPL *session, int msg_event, int error, * example, we can end up here without a session.) */ if (session == NULL) { - WT_RET(__wt_fprintf(session, stderr, + WT_RET(__wt_fprintf(stderr, "WiredTiger Error%s%s: ", error == 0 ? "" : ": ", error == 0 ? "" : __wt_strerror(session, error, NULL, 0))); - WT_RET(__wt_vfprintf(session, stderr, fmt, ap)); - WT_RET(__wt_fprintf(session, stderr, "\n")); - return (__wt_fflush(session, stderr)); + WT_RET(__wt_vfprintf(stderr, fmt, ap)); + WT_RET(__wt_fprintf(stderr, "\n")); + return (__wt_fflush(stderr)); } p = s; diff --git a/src/support/filename.c b/src/support/filename.c index db466ed3bd4..2d284aeb0b0 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, WT_FHANDLE_WRITE)); + WT_RET(__wt_fclose(&fp, WT_FHANDLE_WRITE)); /* Rename the source file to the target. */ WT_RET(__wt_rename(session, from, to)); diff --git a/src/support/mutex.c b/src/support/mutex.c index fa85cfc33d5..d81ac51c0d9 100644 --- a/src/support/mutex.c +++ b/src/support/mutex.c @@ -32,7 +32,7 @@ __wt_spin_lock_register_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) for (i = 0; i < WT_SPINLOCK_MAX; i++) if (conn->spinlock_list[i] == NULL && - WT_ATOMIC_CAS(conn->spinlock_list[i], NULL, t)) + WT_ATOMIC_CAS8(conn->spinlock_list[i], NULL, t)) return (0); WT_RET_MSG(session, ENOMEM, @@ -76,7 +76,8 @@ __wt_spin_lock_unregister_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t) static int __spin_lock_next_id(WT_SESSION_IMPL *session, int *idp) { - static int lock_id = 0, next_id = 0; + static uint64_t lock_id = 0; + static int next_id = 0; WT_DECL_RET; /* If we've ever registered this location, we already have an ID. */ @@ -89,7 +90,7 @@ __spin_lock_next_id(WT_SESSION_IMPL *session, int *idp) * This work only gets done once per library instantiation, there * isn't a performance concern. */ - while (!WT_ATOMIC_CAS(lock_id, 0, 1)) + while (!WT_ATOMIC_CAS8(lock_id, 0, 1)) __wt_yield(); /* Allocate a blocking ID for this location. */ @@ -194,7 +195,7 @@ __wt_statlog_dump_spinlock(WT_CONNECTION_IMPL *conn, const char *tag) continue; } - WT_RET(__wt_fprintf(session, conn->stat_fp, + WT_RET(__wt_fprintf(conn->stat_fp, "%s %" PRIu64 " %s spinlock %s: acquisitions\n", conn->stat_stamp, spin->counter <= ignore ? 0 : spin->counter, @@ -202,12 +203,12 @@ __wt_statlog_dump_spinlock(WT_CONNECTION_IMPL *conn, const char *tag) if (FLD_ISSET(conn->stat_flags, WT_CONN_STAT_CLEAR)) spin->counter = 0; } - WT_RET(__wt_fprintf(session, conn->stat_fp, + WT_RET(__wt_fprintf(conn->stat_fp, "%s %" PRIu64 " %s spinlock %s: acquisitions\n", conn->stat_stamp, block_manager <= ignore ? 0 : block_manager, tag, "block manager")); - WT_RET(__wt_fprintf(session, conn->stat_fp, + WT_RET(__wt_fprintf(conn->stat_fp, "%s %" PRIu64 " %s spinlock %s: acquisitions\n", conn->stat_stamp, btree_page <= ignore ? 0 : btree_page, @@ -222,7 +223,7 @@ __wt_statlog_dump_spinlock(WT_CONNECTION_IMPL *conn, const char *tag) if (p->name == NULL) continue; - WT_RET(__wt_fprintf(session, conn->stat_fp, + WT_RET(__wt_fprintf(conn->stat_fp, "%s %d %s spinlock %s acquired by %s(%d)\n", conn->stat_stamp, p->total <= ignore ? 0 : p->total, @@ -236,7 +237,7 @@ __wt_statlog_dump_spinlock(WT_CONNECTION_IMPL *conn, const char *tag) if (t->name == NULL) continue; - WT_RET(__wt_fprintf(session, conn->stat_fp, + WT_RET(__wt_fprintf(conn->stat_fp, "%s %d %s spinlock %s: %s(%d) blocked by %s(%d)\n", conn->stat_stamp, p->blocked[j] <= ignore ? 0 : p->blocked[j], diff --git a/src/support/scratch.c b/src/support/scratch.c index 957101b8fae..ebea484a51f 100644 --- a/src/support/scratch.c +++ b/src/support/scratch.c @@ -269,6 +269,8 @@ __wt_scr_discard(WT_SESSION_IMPL *session) __wt_free(session, *bufp); } + session->scratch_alloc = 0; + session->scratch_cached = 0; __wt_free(session, session->scratch); #ifdef HAVE_DIAGNOSTIC __wt_free(session, session->scratch_track); diff --git a/src/txn/txn_log.c b/src/txn/txn_log.c index d3e010cf401..22f26c37eee 100644 --- a/src/txn/txn_log.c +++ b/src/txn/txn_log.c @@ -440,7 +440,8 @@ __wt_txn_truncate_end(WT_SESSION_IMPL *session) */ static int __txn_printlog(WT_SESSION_IMPL *session, - WT_ITEM *rawrec, WT_LSN *lsnp, void *cookie, int firstrecord) + WT_ITEM *rawrec, WT_LSN *lsnp, WT_LSN *next_lsnp, + void *cookie, int firstrecord) { FILE *out; WT_LOG_RECORD *logrec; @@ -452,6 +453,7 @@ __txn_printlog(WT_SESSION_IMPL *session, const uint8_t *end, *p; const char *msg; + WT_UNUSED(next_lsnp); out = cookie; p = LOG_SKIP_HEADER(rawrec->data); diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c index bc098875abf..04b9579be9c 100644 --- a/src/txn/txn_recover.c +++ b/src/txn/txn_recover.c @@ -263,13 +263,15 @@ __txn_commit_apply( */ static int __txn_log_recover(WT_SESSION_IMPL *session, - WT_ITEM *logrec, WT_LSN *lsnp, void *cookie, int firstrecord) + WT_ITEM *logrec, WT_LSN *lsnp, WT_LSN *next_lsnp, + void *cookie, int firstrecord) { WT_RECOVERY *r; const uint8_t *end, *p; uint64_t txnid; uint32_t rectype; + WT_UNUSED(next_lsnp); r = cookie; p = LOG_SKIP_HEADER(logrec->data); end = (const uint8_t *)logrec->data + logrec->size; diff --git a/test/fops/t.c b/test/fops/t.c index 1522b5941f7..4e66044996f 100644 --- a/test/fops/t.c +++ b/test/fops/t.c @@ -112,9 +112,6 @@ main(int argc, char *argv[]) if (argc != 0) return (usage()); - /* Use line buffering on stdout so status updates aren't buffered. */ - (void)setvbuf(stdout, NULL, _IOLBF, 0); - /* Clean up on signal. */ (void)signal(SIGINT, onint); @@ -156,7 +153,14 @@ wt_startup(char *config_open) int ret; char config_buf[128]; - if ((ret = system("rm -rf WT_TEST && mkdir WT_TEST")) != 0) +#undef CMD +#ifdef _WIN32 +#define CMD "rd /s /q WT_TEST & mkdir WT_TEST" +#else +#define CMD "rm -rf WT_TEST && mkdir WT_TEST" +#endif + + if ((ret = system(CMD)) != 0) die(ret, "directory cleanup call failed"); snprintf(config_buf, sizeof(config_buf), @@ -192,7 +196,13 @@ shutdown(void) { int ret; - if ((ret = system("rm -rf WT_TEST")) != 0) +#undef CMD +#ifdef _WIN32 +#define CMD "if exist WT_TEST rd /s /q WT_TEST" +#else +#define CMD "rm -rf WT_TEST" +#endif + if ((ret = system(CMD)) != 0) die(ret, "directory cleanup call failed"); } diff --git a/test/fops/thread.h b/test/fops/thread.h index 3b49a45d9bb..72333f5f710 100644 --- a/test/fops/thread.h +++ b/test/fops/thread.h @@ -27,16 +27,26 @@ */ #include <sys/types.h> +#ifndef _WIN32 #include <sys/time.h> +#endif #include <errno.h> #include <inttypes.h> +#ifndef _WIN32 #include <pthread.h> +#endif #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#ifndef _WIN32 #include <unistd.h> +#endif + +#ifdef _WIN32 +#include "windows_shim.h" +#endif #include <wiredtiger.h> diff --git a/test/format/config.c b/test/format/config.c index ce5d0a9c372..3ef1e86da83 100644 --- a/test/format/config.c +++ b/test/format/config.c @@ -340,6 +340,10 @@ config_print(int error_display) fprintf(fp, "%s=%" PRIu32 "\n", cp->name, *cp->v); fprintf(fp, "############################################\n"); + + /* Flush so we're up-to-date on error. */ + (void)fflush(fp); + if (fp != stdout) (void)fclose(fp); } @@ -397,7 +401,7 @@ void config_single(const char *s, int perm) { CONFIG *cp; - u_long v; + uint32_t v; char *p; const char *ep; @@ -447,7 +451,7 @@ config_single(const char *s, int perm) return; } - v = strtoul(ep, &p, 10); + v = (uint32_t)strtoul(ep, &p, 10); if (*p != '\0') { fprintf(stderr, "%s: %s: illegal numeric value\n", g.progname, s); @@ -459,13 +463,13 @@ config_single(const char *s, int perm) g.progname, s); exit(EXIT_FAILURE); } - } else if ((uint32_t)v < cp->min || (uint32_t)v > cp->maxset) { - fprintf(stderr, "%s: %s: value of %" PRIu32 - " outside min/max values of %" PRIu32 "-%" PRIu32 "\n", - g.progname, s, *cp->v, cp->min, cp->maxset); + } else if (v < cp->min || v > cp->maxset) { + fprintf(stderr, "%s: %s: value outside min/max values of %" + PRIu32 "-%" PRIu32 "\n", + g.progname, s, cp->min, cp->maxset); exit(EXIT_FAILURE); } - *cp->v = (uint32_t)v; + *cp->v = v; } /* diff --git a/test/format/t.c b/test/format/t.c index 03b3605a5e4..3f67db4101d 100644 --- a/test/format/t.c +++ b/test/format/t.c @@ -152,9 +152,6 @@ main(int argc, char *argv[]) if (g.replay && SINGLETHREADED) g.c_runs = 1; - /* Use line buffering on stdout so status updates aren't buffered. */ - (void)setvbuf(stdout, NULL, _IOLBF, 32); - /* * Initialize locks to single-thread named checkpoints and backups, and * to single-thread last-record updates. @@ -292,23 +289,13 @@ startup(void) if (mkdir(g.home_kvs, 0777) != 0) die(errno, "mkdir: %s", g.home_kvs); - /* - * Open/truncate the logging file; line buffer so we see up-to-date - * information on error. - */ - if (g.logging != 0) { - if ((g.logfp = fopen(g.home_log, "w")) == NULL) - die(errno, "fopen: %s", g.home_log); - (void)setvbuf(g.logfp, NULL, _IOLBF, 0); - } + /* Open/truncate the logging file. */ + if (g.logging != 0 && (g.logfp = fopen(g.home_log, "w")) == NULL) + die(errno, "fopen: %s", g.home_log); - /* - * Open/truncate the random number logging file; line buffer so we see - * up-to-date information on error. - */ + /* Open/truncate the random number logging file. */ if ((g.rand_log = fopen(g.home_rand, g.replay ? "r" : "w")) == NULL) die(errno, "%s", g.home_rand); - (void)setvbuf(g.rand_log, NULL, _IOLBF, 32); } /* diff --git a/test/format/util.c b/test/format/util.c index 27294aae79f..6ca3c011b89 100644 --- a/test/format/util.c +++ b/test/format/util.c @@ -299,7 +299,7 @@ path_setup(const char *home) */ #undef CMD #ifdef _WIN32 -#define CMD "cd %s && del /s /q * && rd /s /q KVS" +#define CMD "cd %s && del /s /q * >:nul && rd /s /q KVS" #else #define CMD "cd %s > /dev/null && rm -rf `ls | sed /rand/d`" #endif @@ -311,7 +311,7 @@ path_setup(const char *home) /* Backup directory initialize command, remove and re-create it. */ #undef CMD #ifdef _WIN32 -#define CMD "del /s && mkdir %s" +#define CMD "del /s /q >:nul && mkdir %s" #else #define CMD "rm -rf %s && mkdir %s" #endif @@ -330,9 +330,9 @@ path_setup(const char *home) #undef CMD #ifdef _WIN32 #define CMD \ - "cd %s " \ + "cd %s && " \ "rd /q /s slvg.copy & mkdir slvg.copy && " \ - "copy WiredTiger* slvg.copy\\ && copy wt* slvg.copy\\" + "copy WiredTiger* slvg.copy\\ >:nul && copy wt* slvg.copy\\ >:nul" #else #define CMD \ "cd %s > /dev/null && " \ @@ -385,6 +385,10 @@ rng(void) } r = (uint32_t)rand(); - fprintf(g.rand_log, "%" PRIu32 "\n", r); + + /* Save and flush the random number so we're up-to-date on error. */ + (void)fprintf(g.rand_log, "%" PRIu32 "\n", r); + (void)fflush(g.rand_log); + return (r); } diff --git a/test/format/wts.c b/test/format/wts.c index 553b9902a46..38183e59e18 100644 --- a/test/format/wts.c +++ b/test/format/wts.c @@ -32,14 +32,20 @@ static int handle_message(WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *message) { + int out; + (void)(handler); (void)(session); - if (g.logfp != NULL) - return (fprintf( - g.logfp, "%p:%s\n", session, message) < 0 ? -1 : 0); - - return (printf("%p:%s\n", session, message) < 0 ? -1 : 0); + /* Write and flush the message so we're up-to-date on error. */ + if (g.logfp == NULL) { + out = printf("%p:%s\n", session, message); + (void)fflush(stdout); + } else { + out = fprintf(g.logfp, "%p:%s\n", session, message); + (void)fflush(g.logfp); + } + return (out < 0 ? EIO : 0); } /* @@ -424,6 +430,7 @@ wts_dump(const char *tag, int dump_bdb) if (DATASOURCE("helium") || DATASOURCE("kvsbdb")) return; +#ifndef _WIN32 track("dump files and compare", 0ULL, NULL); len = strlen(g.home) + strlen(BERKELEY_DB_PATH) + strlen(g.uri) + 100; @@ -441,6 +448,7 @@ wts_dump(const char *tag, int dump_bdb) if ((ret = system(cmd)) != 0) die(ret, "%s: dump comparison failed", tag); free(cmd); +#endif } void diff --git a/test/mciproject.yml b/test/mciproject.yml index 64007bdbd92..49caa44438d 100644 --- a/test/mciproject.yml +++ b/test/mciproject.yml @@ -72,6 +72,23 @@ tasks: scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100" wiredtiger.dll libwiredtiger.lib + - name: fops-windows + 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 --enable-python=c:\\swigwin-3.0.2\\swig.exe ${smp_command|} + + cmd.exe /c t_fops.exe + buildvariants: - name: ubuntu1404 display_name: Ubuntu 14.04 @@ -99,12 +116,13 @@ buildvariants: - name: windows-64 display_name: Windows 64-bit run_on: - - windows-64-vs2013-compile + - windows-64-vs2013-test expansions: smp_command: -j$(grep -c ^processor /proc/cpuinfo) tasks: - name: compile-windows - name: compile-windows-alt + - name: fops-windows - name: osx-108 display_name: OS X 10.8 diff --git a/test/packing/intpack-test.c b/test/packing/intpack-test.c index 51acea15506..c07cab255bc 100644 --- a/test/packing/intpack-test.c +++ b/test/packing/intpack-test.c @@ -31,7 +31,7 @@ #include "wt_internal.h" int -main() +main(void) { const uint8_t *cp; uint8_t buf[10], *p; diff --git a/test/packing/intpack-test2.c b/test/packing/intpack-test2.c index d9ac9373cea..6956141ab58 100644 --- a/test/packing/intpack-test2.c +++ b/test/packing/intpack-test2.c @@ -31,7 +31,7 @@ #include "wt_internal.h" int -main() +main(void) { uint8_t buf[10], *p, *end; int64_t i; diff --git a/test/packing/packing-test.c b/test/packing/packing-test.c index 32b7d3d17ec..1fd9d74ffd6 100644 --- a/test/packing/packing-test.c +++ b/test/packing/packing-test.c @@ -56,7 +56,7 @@ check(const char *fmt, ...) } int -main() +main(void) { check("iii", 0, 101, -99); check("3i", 0, 101, -99); diff --git a/test/suite/test_cursor07.py b/test/suite/test_cursor07.py index 3ec93aa8a44..1fadf58c81f 100644 --- a/test/suite/test_cursor07.py +++ b/test/suite/test_cursor07.py @@ -40,7 +40,9 @@ class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess): logmax = "100K" tablename = 'test_cursor07' uri = 'table:' + tablename - nkeys = 5 + # A large number of keys will force a log file change which will + # test that scenario for log cursors. + nkeys = 7000 scenarios = check_scenarios([ ('regular', dict(reopen=False)), diff --git a/test/suite/test_cursor08.py b/test/suite/test_cursor08.py new file mode 100644 index 00000000000..663451eb5b5 --- /dev/null +++ b/test/suite/test_cursor08.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2015 MongoDB, Inc. +# Public Domain 2008-2014 WiredTiger, Inc. +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# test_cursor08.py +# Log cursors with compression +# + +import fnmatch, os, shutil, run, time +from suite_subprocess import suite_subprocess +from wiredtiger import wiredtiger_open, stat, WiredTigerError +from wtscenario import multiply_scenarios, number_scenarios, check_scenarios +import wttest + +class test_cursor08(wttest.WiredTigerTestCase, suite_subprocess): + logmax = "100K" + tablename = 'test_cursor08' + uri = 'table:' + tablename + nkeys = 500 + + reopens = check_scenarios([ + ('regular', dict(reopen=False)), + ('reopen', dict(reopen=True)) + ]) + compress = check_scenarios([ + ('bzip2', dict(compress='bzip2')), + ('nop', dict(compress='nop')), + ('snappy', dict(compress='snappy')), + ('zlib', dict(compress='zlib')), + ('none', dict(compress='none')), + ]) + scenarios = number_scenarios(multiply_scenarios('.', reopens, compress)) + + # Return the wiredtiger_open extension argument for a shared library. + def extensionArg(self, name): + if name == None or name == 'none': + return '' + + testdir = os.path.dirname(__file__) + extdir = os.path.join(run.wt_builddir, 'ext/compressors') + extfile = os.path.join( + extdir, name, '.libs', 'libwiredtiger_' + name + '.so') + if not os.path.exists(extfile): + self.skipTest('compression extension "' + extfile + '" not built') + return ',extensions=["' + extfile + '"]' + + # Overrides WiredTigerTestCase - add logging + def setUpConnectionOpen(self, dir): + self.home = dir + self.txn_sync = '(method=dsync,enabled)' + conn_params = \ + 'log=(archive=false,enabled,file_max=%s,' % self.logmax + \ + 'compressor=%s)' % self.compress + \ + ',create,error_prefix="%s: ",' % self.shortid() + \ + 'transaction_sync="%s",' % self.txn_sync + \ + self.extensionArg(self.compress) + # print "Creating conn at '%s' with config '%s'" % (dir, conn_params) + try: + conn = wiredtiger_open(dir, conn_params) + except WiredTigerError as e: + print "Failed conn at '%s' with config '%s'" % (dir, conn_params) + self.pr(`conn`) + self.session2 = conn.open_session() + return conn + + def test_log_cursor(self): + # print "Creating %s with config '%s'" % (self.uri, self.create_params) + create_params = 'key_format=i,value_format=S' + self.session.create(self.uri, create_params) + c = self.session.open_cursor(self.uri, None) + + # A binary value. + value = u'\u0001\u0002abcd\u0003\u0004' + + self.session.begin_transaction() + for k in range(self.nkeys): + c[k] = value + self.session.commit_transaction() + c.close() + + if self.reopen: + self.reopen_conn() + + # Check for these values via a log cursor + c = self.session.open_cursor("log:", None) + count = 0 + while c.next() == 0: + # lsn.file, lsn.offset, opcount + keys = c.get_key() + # txnid, rectype, optype, fileid, logrec_key, logrec_value + values = c.get_value() + try: + if value in str(values[5]): # logrec_value + count += 1 + except: + pass + c.close() + self.assertEqual(count, self.nkeys) + +if __name__ == '__main__': + wttest.run() diff --git a/test/windows/windows_shim.c b/test/windows/windows_shim.c index 8b0f05bfe2d..a59060d56e8 100644 --- a/test/windows/windows_shim.c +++ b/test/windows/windows_shim.c @@ -57,6 +57,24 @@ usleep(useconds_t useconds) } int +gettimeofday(struct timeval* tp, void* tzp) +{ + uint64_t ns100; + FILETIME time; + + tzp = tzp; + + GetSystemTimeAsFileTime(&time); + + ns100 = (((int64_t)time.dwHighDateTime << 32) + time.dwLowDateTime) + - 116444736000000000LL; + tp->tv_sec = ns100 / 10000000; + tp->tv_usec = (long)((ns100 % 10000000) / 10); + + return (0); +} + +int pthread_rwlock_destroy(pthread_rwlock_t *lock) { lock = lock; diff --git a/test/windows/windows_shim.h b/test/windows/windows_shim.h index 97d1e996eaa..c124cda6092 100644 --- a/test/windows/windows_shim.h +++ b/test/windows/windows_shim.h @@ -60,6 +60,16 @@ _Check_return_opt_ int __cdecl _wt_snprintf( #define mkdir(path, mode) _mkdir(path) /* + * Emulate <sys/time.h> + */ +struct timeval { + time_t tv_sec; + int64_t tv_usec; +}; + +int gettimeofday(struct timeval* tp, void* tzp); + +/* * Emulate <sched.h> */ int sched_yield(void); |