summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2015-01-14 02:44:49 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2015-01-14 02:44:49 +1100
commiteb1511f3f1fb3be31cce7c4b288608997dd77c3e (patch)
tree3f3ff1244c1ed1d3b1a809ba84703d28686a07f9
parent71355ac442db3e001c120fcfc398de71d34075e3 (diff)
parent9c4b6113e1bb6bc3398e32d9190ff2e5c5f415c5 (diff)
downloadmongo-eb1511f3f1fb3be31cce7c4b288608997dd77c3e.tar.gz
Merge branch 'develop' into cursor-reconfigure
-rw-r--r--LICENSE1
-rw-r--r--NEWS119
-rw-r--r--README6
-rw-r--r--RELEASE_INFO4
-rw-r--r--api/leveldb/leveldb_wt.h1
-rw-r--r--bench/wtperf/config.c1
-rw-r--r--bench/wtperf/config_opt.h1
-rw-r--r--bench/wtperf/doxy.c1
-rw-r--r--bench/wtperf/misc.c1
-rwxr-xr-xbench/wtperf/runners/get_ckpt.py1
-rw-r--r--bench/wtperf/track.c1
-rw-r--r--bench/wtperf/wtperf.c1
-rw-r--r--bench/wtperf/wtperf.h1
-rw-r--r--bench/wtperf/wtperf_opt.i1
-rw-r--r--build_posix/aclocal/version-set.m48
-rw-r--r--build_posix/aclocal/version.m42
-rw-r--r--build_posix/wiredtiger.pc.in4
-rw-r--r--dist/api_config.py2
-rw-r--r--dist/api_data.py15
-rw-r--r--dist/api_err.py84
-rw-r--r--dist/log.py9
-rw-r--r--dist/package/wiredtiger.spec2
-rwxr-xr-xdist/s_copyright39
-rw-r--r--dist/s_define.list2
-rw-r--r--dist/s_string.ok3
-rw-r--r--dist/s_symbols.list1
-rw-r--r--dist/s_tags13
-rw-r--r--dist/stat_data.py15
-rw-r--r--examples/c/ex_access.c1
-rw-r--r--examples/c/ex_all.c21
-rw-r--r--examples/c/ex_async.c1
-rw-r--r--examples/c/ex_backup.c1
-rw-r--r--examples/c/ex_call_center.c1
-rw-r--r--examples/c/ex_config.c1
-rw-r--r--examples/c/ex_config_parse.c1
-rw-r--r--examples/c/ex_cursor.c1
-rw-r--r--examples/c/ex_data_source.c1
-rw-r--r--examples/c/ex_extending.c1
-rw-r--r--examples/c/ex_extractor.c1
-rw-r--r--examples/c/ex_hello.c1
-rw-r--r--examples/c/ex_log.c1
-rw-r--r--examples/c/ex_pack.c1
-rw-r--r--examples/c/ex_process.c1
-rw-r--r--examples/c/ex_schema.c1
-rw-r--r--examples/c/ex_scope.c1
-rw-r--r--examples/c/ex_stat.c1
-rw-r--r--examples/c/ex_thread.c1
-rw-r--r--examples/java/com/wiredtiger/examples/ex_access.java1
-rw-r--r--examples/java/com/wiredtiger/examples/ex_all.java1
-rw-r--r--examples/java/com/wiredtiger/examples/ex_async.java13
-rw-r--r--examples/java/com/wiredtiger/examples/ex_call_center.java25
-rw-r--r--examples/java/com/wiredtiger/examples/ex_cursor.java15
-rw-r--r--examples/java/com/wiredtiger/examples/ex_log.java40
-rw-r--r--examples/java/com/wiredtiger/examples/ex_schema.java32
-rw-r--r--examples/java/com/wiredtiger/examples/ex_stat.java20
-rw-r--r--examples/java/com/wiredtiger/examples/ex_thread.java25
-rwxr-xr-xexamples/python/ex_access.py1
-rw-r--r--ext/collators/reverse/reverse_collator.c1
-rw-r--r--ext/compressors/bzip2/bzip2_compress.c1
-rw-r--r--ext/compressors/nop/nop_compress.c1
-rw-r--r--ext/compressors/snappy/snappy_compress.c1
-rw-r--r--ext/compressors/zlib/zlib_compress.c1
-rw-r--r--ext/datasources/helium/helium.c1
-rw-r--r--ext/test/kvs_bdb/kvs_bdb.c1
-rw-r--r--lang/java/src/com/wiredtiger/db/AsyncCallback.java1
-rw-r--r--lang/java/src/com/wiredtiger/db/PackFormatInputStream.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/PackInputStream.java9
-rw-r--r--lang/java/src/com/wiredtiger/db/PackOutputStream.java8
-rw-r--r--lang/java/src/com/wiredtiger/db/PackUtil.java1
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerException.java1
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java1
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java1
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java1
-rw-r--r--lang/java/wiredtiger.i94
-rw-r--r--lang/python/setup.py1
-rw-r--r--lang/python/wiredtiger.i16
-rw-r--r--lang/python/wiredtiger/fpacking.py1
-rw-r--r--lang/python/wiredtiger/intpack-test.py1
-rw-r--r--lang/python/wiredtiger/intpacking.py1
-rw-r--r--lang/python/wiredtiger/packing-test.py1
-rw-r--r--lang/python/wiredtiger/packing.py1
-rw-r--r--src/async/async_api.c1
-rw-r--r--src/async/async_op.c1
-rw-r--r--src/async/async_worker.c1
-rw-r--r--src/block/block_addr.c1
-rw-r--r--src/block/block_ckpt.c7
-rw-r--r--src/block/block_compact.c1
-rw-r--r--src/block/block_ext.c5
-rw-r--r--src/block/block_map.c1
-rw-r--r--src/block/block_mgr.c1
-rw-r--r--src/block/block_open.c5
-rw-r--r--src/block/block_read.c3
-rw-r--r--src/block/block_session.c1
-rw-r--r--src/block/block_slvg.c3
-rw-r--r--src/block/block_vrfy.c1
-rw-r--r--src/block/block_write.c1
-rw-r--r--src/bloom/bloom.c1
-rw-r--r--src/btree/bt_compact.c1
-rw-r--r--src/btree/bt_curnext.c1
-rw-r--r--src/btree/bt_curprev.c1
-rw-r--r--src/btree/bt_cursor.c1
-rw-r--r--src/btree/bt_debug.c23
-rw-r--r--src/btree/bt_delete.c1
-rw-r--r--src/btree/bt_discard.c1
-rw-r--r--src/btree/bt_handle.c1
-rw-r--r--src/btree/bt_huffman.c1
-rw-r--r--src/btree/bt_io.c7
-rw-r--r--src/btree/bt_misc.c1
-rw-r--r--src/btree/bt_ovfl.c3
-rw-r--r--src/btree/bt_page.c35
-rw-r--r--src/btree/bt_read.c1
-rw-r--r--src/btree/bt_ret.c1
-rw-r--r--src/btree/bt_slvg.c15
-rw-r--r--src/btree/bt_split.c21
-rw-r--r--src/btree/bt_stat.c1
-rw-r--r--src/btree/bt_sync.c1
-rw-r--r--src/btree/bt_upgrade.c1
-rw-r--r--src/btree/bt_vrfy.c9
-rw-r--r--src/btree/bt_vrfy_dsk.c7
-rw-r--r--src/btree/bt_walk.c1
-rw-r--r--src/btree/col_modify.c1
-rw-r--r--src/btree/col_srch.c1
-rw-r--r--src/btree/row_key.c7
-rw-r--r--src/btree/row_modify.c1
-rw-r--r--src/btree/row_srch.c1
-rw-r--r--src/config/config.c1
-rw-r--r--src/config/config_api.c1
-rw-r--r--src/config/config_check.c1
-rw-r--r--src/config/config_collapse.c9
-rw-r--r--src/config/config_concat.c3
-rw-r--r--src/config/config_def.c52
-rw-r--r--src/config/config_ext.c1
-rw-r--r--src/config/config_upgrade.c1
-rw-r--r--src/conn/api_strerror.c77
-rw-r--r--src/conn/api_version.c1
-rw-r--r--src/conn/conn_api.c8
-rw-r--r--src/conn/conn_cache.c3
-rw-r--r--src/conn/conn_cache_pool.c1
-rw-r--r--src/conn/conn_ckpt.c3
-rw-r--r--src/conn/conn_dhandle.c1
-rw-r--r--src/conn/conn_handle.c1
-rw-r--r--src/conn/conn_log.c36
-rw-r--r--src/conn/conn_open.c8
-rw-r--r--src/conn/conn_stat.c5
-rw-r--r--src/conn/conn_sweep.c1
-rw-r--r--src/cursor/cur_backup.c3
-rw-r--r--src/cursor/cur_bulk.c5
-rw-r--r--src/cursor/cur_config.c1
-rw-r--r--src/cursor/cur_ds.c2
-rw-r--r--src/cursor/cur_dump.c1
-rw-r--r--src/cursor/cur_file.c1
-rw-r--r--src/cursor/cur_index.c3
-rw-r--r--src/cursor/cur_json.c1
-rw-r--r--src/cursor/cur_log.c63
-rw-r--r--src/cursor/cur_metadata.c1
-rw-r--r--src/cursor/cur_stat.c1
-rw-r--r--src/cursor/cur_std.c1
-rw-r--r--src/cursor/cur_table.c15
-rwxr-xr-xsrc/docs/build-javadoc.sh2
-rw-r--r--src/docs/command-line.dox8
-rw-r--r--src/docs/style/footer.html4
-rwxr-xr-xsrc/docs/tools/doxfilter.py1
-rwxr-xr-xsrc/docs/tools/fixlinks.py1
-rw-r--r--src/docs/top/main.dox8
-rw-r--r--src/docs/upgrading.dox2
-rw-r--r--src/evict/evict_file.c1
-rw-r--r--src/evict/evict_lru.c1
-rw-r--r--src/evict/evict_page.c18
-rw-r--r--src/include/api.h1
-rw-r--r--src/include/async.h1
-rw-r--r--src/include/bitstring.i1
-rw-r--r--src/include/block.h1
-rw-r--r--src/include/bloom.h1
-rw-r--r--src/include/btmem.h1
-rw-r--r--src/include/btree.h1
-rw-r--r--src/include/btree.i1
-rw-r--r--src/include/buf.i10
-rw-r--r--src/include/cache.h3
-rw-r--r--src/include/cache.i1
-rw-r--r--src/include/cell.i1
-rw-r--r--src/include/column.i1
-rw-r--r--src/include/compact.h1
-rw-r--r--src/include/config.h1
-rw-r--r--src/include/connection.h6
-rw-r--r--src/include/cursor.h3
-rw-r--r--src/include/cursor.i1
-rw-r--r--src/include/dhandle.h1
-rw-r--r--src/include/dlh.h1
-rw-r--r--src/include/error.h1
-rw-r--r--src/include/extern.h9
-rw-r--r--src/include/gcc.h1
-rw-r--r--src/include/hardware.h1
-rw-r--r--src/include/intpack.i1
-rw-r--r--src/include/lint.h1
-rw-r--r--src/include/log.h20
-rw-r--r--src/include/lsm.h1
-rw-r--r--src/include/meta.h1
-rw-r--r--src/include/misc.h1
-rw-r--r--src/include/misc.i1
-rw-r--r--src/include/msvc.h1
-rw-r--r--src/include/mutex.h1
-rw-r--r--src/include/mutex.i1
-rw-r--r--src/include/os.h1
-rw-r--r--src/include/os_windows.h1
-rw-r--r--src/include/packing.i1
-rw-r--r--src/include/posix.h1
-rw-r--r--src/include/schema.h1
-rw-r--r--src/include/serial.i1
-rw-r--r--src/include/session.h2
-rw-r--r--src/include/stat.h7
-rw-r--r--src/include/txn.h2
-rw-r--r--src/include/txn.i1
-rw-r--r--src/include/verify_build.h1
-rw-r--r--src/include/wiredtiger.in247
-rw-r--r--src/include/wiredtiger_ext.h1
-rw-r--r--src/include/wt_internal.h1
-rw-r--r--src/log/log.c67
-rw-r--r--src/log/log_auto.c15
-rw-r--r--src/log/log_slot.c1
-rw-r--r--src/lsm/lsm_cursor.c10
-rw-r--r--src/lsm/lsm_manager.c1
-rw-r--r--src/lsm/lsm_merge.c1
-rw-r--r--src/lsm/lsm_meta.c3
-rw-r--r--src/lsm/lsm_stat.c3
-rw-r--r--src/lsm/lsm_tree.c7
-rw-r--r--src/lsm/lsm_work_unit.c1
-rw-r--r--src/lsm/lsm_worker.c1
-rw-r--r--src/meta/meta_apply.c1
-rw-r--r--src/meta/meta_ckpt.c5
-rw-r--r--src/meta/meta_ext.c1
-rw-r--r--src/meta/meta_table.c1
-rw-r--r--src/meta/meta_track.c1
-rw-r--r--src/meta/meta_turtle.c11
-rw-r--r--src/os_posix/os_abort.c1
-rw-r--r--src/os_posix/os_alloc.c1
-rw-r--r--src/os_posix/os_dir.c1
-rw-r--r--src/os_posix/os_dlopen.c1
-rw-r--r--src/os_posix/os_errno.c47
-rw-r--r--src/os_posix/os_exist.c1
-rw-r--r--src/os_posix/os_fallocate.c1
-rw-r--r--src/os_posix/os_filesize.c1
-rw-r--r--src/os_posix/os_flock.c1
-rw-r--r--src/os_posix/os_fsync.c1
-rw-r--r--src/os_posix/os_ftruncate.c1
-rw-r--r--src/os_posix/os_getenv.c1
-rw-r--r--src/os_posix/os_getline.c1
-rw-r--r--src/os_posix/os_getopt.c1
-rw-r--r--src/os_posix/os_map.c1
-rw-r--r--src/os_posix/os_mtx_cond.c1
-rw-r--r--src/os_posix/os_mtx_rw.c1
-rw-r--r--src/os_posix/os_once.c1
-rw-r--r--src/os_posix/os_open.c1
-rw-r--r--src/os_posix/os_path.c1
-rw-r--r--src/os_posix/os_priv.c1
-rw-r--r--src/os_posix/os_remove.c1
-rw-r--r--src/os_posix/os_rename.c1
-rw-r--r--src/os_posix/os_rw.c1
-rw-r--r--src/os_posix/os_sleep.c1
-rw-r--r--src/os_posix/os_strtouq.c1
-rw-r--r--src/os_posix/os_thread.c1
-rw-r--r--src/os_posix/os_time.c1
-rw-r--r--src/os_posix/os_yield.c1
-rw-r--r--src/os_win/os_dir.c3
-rw-r--r--src/os_win/os_dlopen.c1
-rw-r--r--src/os_win/os_errno.c99
-rw-r--r--src/os_win/os_exist.c1
-rw-r--r--src/os_win/os_fallocate.c1
-rw-r--r--src/os_win/os_filesize.c1
-rw-r--r--src/os_win/os_flock.c1
-rw-r--r--src/os_win/os_fsync.c1
-rw-r--r--src/os_win/os_ftruncate.c8
-rw-r--r--src/os_win/os_getenv.c1
-rw-r--r--src/os_win/os_map.c1
-rw-r--r--src/os_win/os_mtx_cond.c5
-rw-r--r--src/os_win/os_once.c1
-rw-r--r--src/os_win/os_open.c1
-rw-r--r--src/os_win/os_path.c1
-rw-r--r--src/os_win/os_priv.c1
-rw-r--r--src/os_win/os_remove.c1
-rw-r--r--src/os_win/os_rename.c5
-rw-r--r--src/os_win/os_rw.c1
-rw-r--r--src/os_win/os_sleep.c1
-rw-r--r--src/os_win/os_snprintf.c1
-rw-r--r--src/os_win/os_thread.c1
-rw-r--r--src/os_win/os_time.c1
-rw-r--r--src/os_win/os_vsnprintf.c1
-rw-r--r--src/os_win/os_yield.c1
-rw-r--r--src/packing/pack_api.c1
-rw-r--r--src/packing/pack_impl.c1
-rw-r--r--src/packing/pack_stream.c1
-rw-r--r--src/reconcile/rec_track.c7
-rw-r--r--src/reconcile/rec_write.c19
-rw-r--r--src/schema/schema_create.c3
-rw-r--r--src/schema/schema_drop.c1
-rw-r--r--src/schema/schema_list.c1
-rw-r--r--src/schema/schema_open.c18
-rw-r--r--src/schema/schema_plan.c1
-rw-r--r--src/schema/schema_project.c1
-rw-r--r--src/schema/schema_rename.c9
-rw-r--r--src/schema/schema_stat.c7
-rw-r--r--src/schema/schema_truncate.c1
-rw-r--r--src/schema/schema_util.c3
-rw-r--r--src/schema/schema_worker.c1
-rw-r--r--src/session/session_api.c1
-rw-r--r--src/session/session_compact.c3
-rw-r--r--src/session/session_dhandle.c1
-rw-r--r--src/session/session_salvage.c1
-rw-r--r--src/support/cksum.c1
-rw-r--r--src/support/err.c1
-rw-r--r--src/support/filename.c1
-rw-r--r--src/support/global.c1
-rw-r--r--src/support/hash_city.c1
-rw-r--r--src/support/hash_fnv.c1
-rw-r--r--src/support/hazard.c1
-rw-r--r--src/support/hex.c1
-rw-r--r--src/support/huffman.c5
-rw-r--r--src/support/mutex.c1
-rw-r--r--src/support/pow.c1
-rw-r--r--src/support/rand.c1
-rw-r--r--src/support/scratch.c7
-rw-r--r--src/support/stat.c18
-rw-r--r--src/txn/txn.c6
-rw-r--r--src/txn/txn_ckpt.c33
-rw-r--r--src/txn/txn_ext.c1
-rw-r--r--src/txn/txn_log.c43
-rw-r--r--src/txn/txn_recover.c36
-rw-r--r--src/utilities/util.h1
-rw-r--r--src/utilities/util_backup.c1
-rw-r--r--src/utilities/util_compact.c1
-rw-r--r--src/utilities/util_cpyright.c3
-rw-r--r--src/utilities/util_create.c1
-rw-r--r--src/utilities/util_drop.c1
-rw-r--r--src/utilities/util_dump.c1
-rw-r--r--src/utilities/util_list.c1
-rw-r--r--src/utilities/util_load.c1
-rw-r--r--src/utilities/util_load.h1
-rw-r--r--src/utilities/util_load_json.c1
-rw-r--r--src/utilities/util_loadtext.c1
-rw-r--r--src/utilities/util_main.c1
-rw-r--r--src/utilities/util_misc.c1
-rw-r--r--src/utilities/util_printlog.c1
-rw-r--r--src/utilities/util_read.c1
-rw-r--r--src/utilities/util_rename.c1
-rw-r--r--src/utilities/util_salvage.c1
-rw-r--r--src/utilities/util_stat.c28
-rw-r--r--src/utilities/util_upgrade.c1
-rw-r--r--src/utilities/util_verbose.c1
-rw-r--r--src/utilities/util_verify.c1
-rw-r--r--src/utilities/util_write.c1
-rw-r--r--test/bloom/test_bloom.c1
-rw-r--r--test/checkpoint/checkpointer.c1
-rw-r--r--test/checkpoint/test_checkpoint.c1
-rw-r--r--test/checkpoint/test_checkpoint.h1
-rw-r--r--test/checkpoint/workers.c1
-rw-r--r--test/fops/file.c1
-rw-r--r--test/fops/fops.c1
-rw-r--r--test/fops/t.c1
-rw-r--r--test/fops/thread.h1
-rw-r--r--test/format/backup.c1
-rw-r--r--test/format/bdb.c1
-rw-r--r--test/format/bulk.c1
-rw-r--r--test/format/compact.c1
-rw-r--r--test/format/config.c1
-rw-r--r--test/format/config.h1
-rw-r--r--test/format/format.h1
-rw-r--r--test/format/ops.c1
-rw-r--r--test/format/recover.sh19
-rw-r--r--test/format/salvage.c1
-rw-r--r--test/format/t.c1
-rw-r--r--test/format/util.c1
-rw-r--r--test/format/wts.c1
-rw-r--r--test/huge/huge.c1
-rw-r--r--test/java/com/wiredtiger/test/AsyncTest.java1
-rw-r--r--test/java/com/wiredtiger/test/AutoCloseTest.java1
-rw-r--r--test/java/com/wiredtiger/test/CursorTest.java1
-rw-r--r--test/java/com/wiredtiger/test/CursorTest02.java1
-rw-r--r--test/java/com/wiredtiger/test/ExceptionTest.java1
-rw-r--r--test/java/com/wiredtiger/test/PackTest.java1
-rw-r--r--test/java/com/wiredtiger/test/WiredTigerSuite.java1
-rw-r--r--test/mciproject.yml103
-rw-r--r--test/packing/intpack-test.c1
-rw-r--r--test/packing/intpack-test2.c1
-rw-r--r--test/packing/packing-test.c1
-rw-r--r--test/salvage/salvage.c1
-rw-r--r--test/suite/helper.py1
-rw-r--r--test/suite/run.py1
-rw-r--r--test/suite/suite_random.py1
-rw-r--r--test/suite/suite_subprocess.py1
-rw-r--r--test/suite/test_async01.py1
-rw-r--r--test/suite/test_async02.py1
-rw-r--r--test/suite/test_async03.py1
-rw-r--r--test/suite/test_autoclose.py1
-rw-r--r--test/suite/test_backup01.py1
-rw-r--r--test/suite/test_backup02.py1
-rw-r--r--test/suite/test_backup03.py1
-rw-r--r--test/suite/test_backup04.py1
-rw-r--r--test/suite/test_base01.py1
-rw-r--r--test/suite/test_base02.py1
-rw-r--r--test/suite/test_base03.py1
-rw-r--r--test/suite/test_base04.py1
-rw-r--r--test/suite/test_base05.py1
-rw-r--r--test/suite/test_bug001.py1
-rw-r--r--test/suite/test_bug003.py1
-rw-r--r--test/suite/test_bug004.py1
-rw-r--r--test/suite/test_bug005.py1
-rw-r--r--test/suite/test_bug006.py1
-rw-r--r--test/suite/test_bug007.py1
-rw-r--r--test/suite/test_bug008.py1
-rw-r--r--test/suite/test_bulk01.py1
-rw-r--r--test/suite/test_bulk02.py1
-rw-r--r--test/suite/test_checkpoint01.py1
-rw-r--r--test/suite/test_checkpoint02.py1
-rw-r--r--test/suite/test_compact.py1
-rw-r--r--test/suite/test_compress01.py1
-rw-r--r--test/suite/test_config01.py1
-rw-r--r--test/suite/test_config02.py5
-rw-r--r--test/suite/test_config03.py7
-rw-r--r--test/suite/test_config04.py1
-rw-r--r--test/suite/test_config05.py1
-rw-r--r--test/suite/test_cursor01.py1
-rw-r--r--test/suite/test_cursor02.py1
-rw-r--r--test/suite/test_cursor03.py1
-rw-r--r--test/suite/test_cursor04.py1
-rw-r--r--test/suite/test_cursor05.py1
-rw-r--r--test/suite/test_cursor_compare.py1
-rw-r--r--test/suite/test_cursor_random.py1
-rw-r--r--test/suite/test_cursor_tracker.py1
-rw-r--r--test/suite/test_drop.py1
-rw-r--r--test/suite/test_drop_create.py1
-rw-r--r--test/suite/test_dump.py1
-rw-r--r--test/suite/test_dupc.py1
-rw-r--r--test/suite/test_empty.py1
-rw-r--r--test/suite/test_excl.py1
-rw-r--r--test/suite/test_home.py1
-rw-r--r--test/suite/test_index01.py1
-rw-r--r--test/suite/test_jsondump01.py1
-rw-r--r--test/suite/test_jsondump02.py1
-rw-r--r--test/suite/test_lsm01.py1
-rw-r--r--test/suite/test_lsm02.py1
-rw-r--r--test/suite/test_metadata_cursor01.py1
-rw-r--r--test/suite/test_overwrite.py1
-rw-r--r--test/suite/test_perf001.py1
-rw-r--r--test/suite/test_priv01.py1
-rw-r--r--test/suite/test_reconfig.py1
-rw-r--r--test/suite/test_rename.py1
-rw-r--r--test/suite/test_salvage.py1
-rw-r--r--test/suite/test_schema01.py1
-rw-r--r--test/suite/test_schema02.py1
-rw-r--r--test/suite/test_schema03.py1
-rw-r--r--test/suite/test_shared_cache.py1
-rw-r--r--test/suite/test_stat01.py1
-rw-r--r--test/suite/test_stat02.py1
-rw-r--r--test/suite/test_stat_log01.py1
-rw-r--r--test/suite/test_sweep01.py1
-rw-r--r--test/suite/test_truncate01.py1
-rw-r--r--test/suite/test_truncate02.py1
-rw-r--r--test/suite/test_truncate03.py1
-rw-r--r--test/suite/test_txn01.py1
-rw-r--r--test/suite/test_txn02.py1
-rw-r--r--test/suite/test_txn03.py1
-rw-r--r--test/suite/test_txn04.py1
-rw-r--r--test/suite/test_txn05.py1
-rw-r--r--test/suite/test_txn06.py1
-rw-r--r--test/suite/test_txn07.py1
-rw-r--r--test/suite/test_txn08.py1
-rw-r--r--test/suite/test_txn09.py195
-rw-r--r--test/suite/test_unicode01.py1
-rw-r--r--test/suite/test_upgrade.py1
-rw-r--r--test/suite/test_util01.py1
-rw-r--r--test/suite/test_util02.py1
-rw-r--r--test/suite/test_util03.py1
-rw-r--r--test/suite/test_util04.py1
-rw-r--r--test/suite/test_util07.py1
-rw-r--r--test/suite/test_util08.py1
-rw-r--r--test/suite/test_util09.py1
-rw-r--r--test/suite/test_util11.py1
-rw-r--r--test/suite/test_util12.py1
-rw-r--r--test/suite/test_verify.py1
-rw-r--r--test/suite/test_version.py1
-rw-r--r--test/suite/wtscenario.py1
-rw-r--r--test/suite/wttest.py1
-rw-r--r--test/suite/wtthread.py1
-rw-r--r--test/thread/file.c1
-rw-r--r--test/thread/rw.c1
-rw-r--r--test/thread/stats.c1
-rw-r--r--test/thread/t.c1
-rw-r--r--test/thread/thread.h1
-rw-r--r--test/windows/windows_shim.c1
-rw-r--r--test/windows/windows_shim.h1
-rw-r--r--tools/stat_data.py2
-rw-r--r--tools/statlog.py1
-rw-r--r--tools/wt_nvd3_util.py1
-rw-r--r--tools/wtperf_graph.py1
-rw-r--r--tools/wtperf_stats.py1
-rw-r--r--tools/wtstats.py1
495 files changed, 2114 insertions, 579 deletions
diff --git a/LICENSE b/LICENSE
index 1b2196a4300..b8b3b2c2043 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,4 @@
+Copyright (c) 2014-2015 MongoDB, Inc.
Copyright (c) 2008-2014 WiredTiger, Inc.
All rights reserved.
diff --git a/NEWS b/NEWS
index 95b6813be71..a359edafabe 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,122 @@
+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
------------------------------------
diff --git a/README b/README
index 2059a3798f3..55c1097b339 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-WiredTiger 2.4.2: (November 6, 2014)
+WiredTiger 2.5.1: (December 24, 2014)
-This is version 2.4.2 of WiredTiger.
+This is version 2.5.1 of WiredTiger.
WiredTiger release packages and documentation can be found at:
@@ -9,7 +9,7 @@ WiredTiger release packages and documentation can be found at:
Information on configuring, building and installing WiredTiger can be
found at:
- http://source.wiredtiger.com/2.4.2/install.html
+ http://source.wiredtiger.com/2.5.1/install.html
WiredTiger licensing information can be found at:
diff --git a/RELEASE_INFO b/RELEASE_INFO
index b9c46a5ce5c..6c7da8cb961 100644
--- a/RELEASE_INFO
+++ b/RELEASE_INFO
@@ -1,6 +1,6 @@
WIREDTIGER_VERSION_MAJOR=2
-WIREDTIGER_VERSION_MINOR=4
-WIREDTIGER_VERSION_PATCH=2
+WIREDTIGER_VERSION_MINOR=5
+WIREDTIGER_VERSION_PATCH=1
WIREDTIGER_VERSION="$WIREDTIGER_VERSION_MAJOR.$WIREDTIGER_VERSION_MINOR.$WIREDTIGER_VERSION_PATCH"
WIREDTIGER_RELEASE_DATE=`date "+%B %e, %Y"`
diff --git a/api/leveldb/leveldb_wt.h b/api/leveldb/leveldb_wt.h
index 683482ad23c..0b0ad42cf95 100644
--- a/api/leveldb/leveldb_wt.h
+++ b/api/leveldb/leveldb_wt.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c
index 92623f59f85..4c072b85c70 100644
--- a/bench/wtperf/config.c
+++ b/bench/wtperf/config.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/config_opt.h b/bench/wtperf/config_opt.h
index 3de30e723b1..0fb1d988c3a 100644
--- a/bench/wtperf/config_opt.h
+++ b/bench/wtperf/config_opt.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/doxy.c b/bench/wtperf/doxy.c
index 50cba9191e2..2921caea76c 100644
--- a/bench/wtperf/doxy.c
+++ b/bench/wtperf/doxy.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/misc.c b/bench/wtperf/misc.c
index 0a9a1de73e2..1e47c76214c 100644
--- a/bench/wtperf/misc.c
+++ b/bench/wtperf/misc.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/runners/get_ckpt.py b/bench/wtperf/runners/get_ckpt.py
index 38688870e7f..95354ece190 100755
--- a/bench/wtperf/runners/get_ckpt.py
+++ b/bench/wtperf/runners/get_ckpt.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/bench/wtperf/track.c b/bench/wtperf/track.c
index 3919d0eb1ab..8ea4201246a 100644
--- a/bench/wtperf/track.c
+++ b/bench/wtperf/track.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index 74d9152f326..b9d72e45184 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h
index cc70e76bd5d..976847e9a21 100644
--- a/bench/wtperf/wtperf.h
+++ b/bench/wtperf/wtperf.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/wtperf_opt.i b/bench/wtperf/wtperf_opt.i
index 3fec9bddac9..58d56e512ce 100644
--- a/bench/wtperf/wtperf_opt.i
+++ b/bench/wtperf/wtperf_opt.i
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/build_posix/aclocal/version-set.m4 b/build_posix/aclocal/version-set.m4
index 5139880a8b9..205bb78e6f1 100644
--- a/build_posix/aclocal/version-set.m4
+++ b/build_posix/aclocal/version-set.m4
@@ -1,14 +1,14 @@
dnl build by dist/s_version
VERSION_MAJOR=2
-VERSION_MINOR=4
-VERSION_PATCH=2
-VERSION_STRING='"WiredTiger 2.4.2: (November 6, 2014)"'
+VERSION_MINOR=5
+VERSION_PATCH=1
+VERSION_STRING='"WiredTiger 2.5.1: (December 24, 2014)"'
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_PATCH)
AC_SUBST(VERSION_STRING)
-VERSION_NOPATCH=2.4
+VERSION_NOPATCH=2.5
AC_SUBST(VERSION_NOPATCH)
diff --git a/build_posix/aclocal/version.m4 b/build_posix/aclocal/version.m4
index 439d4d2675a..71598b276eb 100644
--- a/build_posix/aclocal/version.m4
+++ b/build_posix/aclocal/version.m4
@@ -1,2 +1,2 @@
dnl WiredTiger product version for AC_INIT. Maintained by dist/s_version
-2.4.2
+2.5.1
diff --git a/build_posix/wiredtiger.pc.in b/build_posix/wiredtiger.pc.in
index be257efcef3..fb45c74bb08 100644
--- a/build_posix/wiredtiger.pc.in
+++ b/build_posix/wiredtiger.pc.in
@@ -7,5 +7,5 @@ Name: WiredTiger
Description: The WiredTiger Data Engine
Requires:
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lwiredtiger-@VERSION_NOPATCH@
-Cflags: -I${includedir}/wiredtiger-@VERSION_NOPATCH@
+Libs: -L${libdir} -lwiredtiger
+Cflags: -I${includedir}
diff --git a/dist/api_config.py b/dist/api_config.py
index 8012a8a6be7..83a57ad4e0d 100644
--- a/dist/api_config.py
+++ b/dist/api_config.py
@@ -188,6 +188,8 @@ def get_default(c):
t = gettype(c)
if c.default == 'false':
return '0'
+ elif t == 'string' and c.default == 'none':
+ return ''
elif t == 'category':
return '(%s)' % (','.join('%s=%s' % (subc.name, get_default(subc))
for subc in sorted(c.subconfig)))
diff --git a/dist/api_data.py b/dist/api_data.py
index 62a1fa4a1a8..d356ee27ed4 100644
--- a/dist/api_data.py
+++ b/dist/api_data.py
@@ -124,7 +124,7 @@ file_config = format_meta + [
items, and the default value of 4KB is a good choice absent
requirements from the operating system or storage device''',
min='512B', max='128MB'),
- Config('block_compressor', '', r'''
+ Config('block_compressor', 'none', r'''
configure a compressor for file blocks. Permitted values are
\c "none" or custom compression engine name created with
WT_CONNECTION::add_compressor. If WiredTiger has builtin support
@@ -142,7 +142,7 @@ file_config = format_meta + [
applications which can rely on decompression to fail if a block
has been corrupted''',
choices=['on', 'off', 'uncompressed']),
- Config('collator', '', r'''
+ Config('collator', 'none', r'''
configure custom collation for keys. Permitted values are
\c "none" or a custom collator name created with
WT_CONNECTION::add_collator'''),
@@ -154,11 +154,11 @@ file_config = format_meta + [
Config('format', 'btree', r'''
the file format''',
choices=['btree']),
- Config('huffman_key', '', r'''
+ Config('huffman_key', 'none', r'''
configure Huffman encoding for keys. Permitted values are
\c "none", \c "english", \c "utf8<file>" or \c "utf16<file>".
See @ref huffman for more information'''),
- Config('huffman_value', '', r'''
+ Config('huffman_value', 'none', r'''
configure Huffman encoding for values. Permitted values are
\c "none", \c "english", \c "utf8<file>" or \c "utf16<file>".
See @ref huffman for more information'''),
@@ -273,7 +273,7 @@ table_only_config = [
]
index_only_config = [
- Config('extractor', '', r'''
+ Config('extractor', 'none', r'''
configure custom extractor for indices. Permitted values are
\c "none" or an extractor name created with
WT_CONNECTION::add_extractor'''),
@@ -510,7 +510,7 @@ common_wiredtiger_open = [
Config('archive', 'true', r'''
automatically archive unneeded log files''',
type='boolean'),
- Config('compressor', '', r'''
+ Config('compressor', 'none', r'''
configure a compressor for log records. Permitted values are
\c "none" or \c "bzip2", \c "snappy" or custom compression
engine \c "name" created with WT_CONNECTION::add_compressor.
@@ -541,6 +541,9 @@ common_wiredtiger_open = [
maximum expected number of sessions (including server
threads)''',
min='1'),
+ Config('session_scratch_max', '2MB', r'''
+ maximum memory to cache in each session''',
+ type='int', undoc=True),
Config('transaction_sync', '', r'''
how to sync log records when the transaction commits''',
type='category', subconfig=[
diff --git a/dist/api_err.py b/dist/api_err.py
index cb2c8cc588e..6c893c9af82 100644
--- a/dist/api_err.py
+++ b/dist/api_err.py
@@ -78,7 +78,7 @@ for line in open('../src/include/wiredtiger.in', 'r'):
tfile.close()
compare_srcfile(tmp_file, '../src/include/wiredtiger.in')
-# Output the wiredtiger_strerror code.
+# Output the wiredtiger_strerror and wiredtiger_sterror_r code.
tmp_file = '__tmp'
tfile = open(tmp_file, 'w')
tfile.write('''/* DO NOT EDIT: automatically built by dist/api_err.py. */
@@ -86,18 +86,22 @@ tfile.write('''/* DO NOT EDIT: automatically built by dist/api_err.py. */
#include "wt_internal.h"
/*
- * wiredtiger_strerror --
- *\tReturn a string for any error value.
+ * Historically, there was only the wiredtiger_strerror call because the POSIX
+ * port didn't need anything more complex; Windows requires memory allocation
+ * of error strings, so we added the wiredtiger_strerror_r call. Because we
+ * want wiredtiger_strerror to continue to be as thread-safe as possible, errors
+ * are split into three categories: WiredTiger constant strings, system constant
+ * strings and Everything Else, and we check constant strings before Everything
+ * Else.
*/
-const char *
-wiredtiger_strerror(int error)
-{
-\tstatic char errbuf[64];
-\tchar *p;
-
-\tif (error == 0)
-\t\treturn ("Successful return: 0");
+/*
+ * __wiredtiger_error --
+ *\tReturn a constant string for the WiredTiger errors.
+ */
+static const char *
+__wiredtiger_error(int error)
+{
\tswitch (error) {
''')
@@ -105,19 +109,51 @@ for err in errors:
tfile.write('\tcase ' + err.name + ':\n')
tfile.write('\t\treturn ("' + err.name + ': ' + err.desc + '");\n')
-tfile.write('''\
-\tdefault:
-\t\tif (error > 0 && (p = strerror(error)) != NULL)
-\t\t\treturn (p);
-\t\tbreak;
-\t}
-
-\t/*
-\t * !!!
-\t * Not thread-safe, but this is never supposed to happen.
-\t */
-\t(void)snprintf(errbuf, sizeof(errbuf), "Unknown error: %d", error);
-\treturn (errbuf);
+tfile.write('''\t}
+\treturn (NULL);
+}
+
+/*
+ * wiredtiger_strerror --
+ *\tReturn a string for any error value, non-thread-safe version.
+ */
+const char *
+wiredtiger_strerror(int error)
+{
+\tstatic char buf[128];
+\tconst char *p;
+
+\t/* Check for a constant string. */
+\tif ((p = __wiredtiger_error(error)) != NULL ||
+\t (p = __wt_strerror(error)) != NULL)
+\t\treturn (p);
+
+\t/* Else, fill in the non-thread-safe static buffer. */
+\tif (wiredtiger_strerror_r(error, buf, sizeof(buf)) != 0)
+\t\t(void)snprintf(buf, sizeof(buf), "error return: %d", error);
+
+\treturn (buf);
+}
+
+/*
+ * wiredtiger_strerror_r --
+ *\tReturn a string for any error value, thread-safe version.
+ */
+int
+wiredtiger_strerror_r(int error, char *buf, size_t buflen)
+{
+\tconst char *p;
+
+\t/* Require at least 2 bytes, printable character and trailing nul. */
+\tif (buflen < 2)
+\t\treturn (ENOMEM);
+
+\t/* Check for a constant string. */
+\tif ((p = __wiredtiger_error(error)) != NULL ||
+\t (p = __wt_strerror(error)) != NULL)
+\t\treturn (snprintf(buf, buflen, "%s", p) > 0 ? 0 : ENOMEM);
+
+\treturn (__wt_strerror_r(error, buf, buflen));
}
''')
tfile.close()
diff --git a/dist/log.py b/dist/log.py
index e9c0fd7850c..9091754ba0b 100644
--- a/dist/log.py
+++ b/dist/log.py
@@ -125,8 +125,7 @@ __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp)
void
__wt_logrec_free(WT_SESSION_IMPL *session, WT_ITEM **logrecp)
{
-\tWT_UNUSED(session);
-\t__wt_scr_free(logrecp);
+\t__wt_scr_free(session, logrecp);
}
int
@@ -250,6 +249,7 @@ __wt_logop_%(name)s_unpack(
'fmt' : op_pack_fmt(optype)
})
+ last_field = optype.fields[-1]
tfile.write('''
int
__wt_logop_%(name)s_print(
@@ -276,7 +276,10 @@ __wt_logop_%(name)s_print(
'print_args' : '\n\t'.join(
'%sfprintf(out, " \\"%s\\": \\"%s\\",\\n",%s);' %
(printf_setup(f), f[1], printf_fmt(f), printf_arg(f))
- for f in optype.fields),
+ for f in optype.fields[:-1]) + str(
+ '\n\t%sfprintf(out, " \\"%s\\": \\"%s\\"",%s);' %
+ (printf_setup(last_field), last_field[1],
+ printf_fmt(last_field), printf_arg(last_field))),
})
# Emit the printlog entry point
diff --git a/dist/package/wiredtiger.spec b/dist/package/wiredtiger.spec
index 54d83797f4e..ab762ef17fd 100644
--- a/dist/package/wiredtiger.spec
+++ b/dist/package/wiredtiger.spec
@@ -1,5 +1,5 @@
Name: wiredtiger
-Version: 2.4.2
+Version: 2.5.1
Release: 1%{?dist}
Summary: WiredTiger data storage engine
diff --git a/dist/s_copyright b/dist/s_copyright
index 15697ad4706..a0e3d588e18 100755
--- a/dist/s_copyright
+++ b/dist/s_copyright
@@ -11,7 +11,8 @@ trap 'rm -f $c1 $c2 $c3 $c4; exit 0' 0 1 2 3 13 15
year=`date +%Y`
cat > $c1 <<ENDOFTEXT
- * Copyright (c) 2008-$year WiredTiger, Inc.
+ * Copyright (c) 2014-$year MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
* See the file LICENSE for redistribution information.
@@ -19,20 +20,23 @@ ENDOFTEXT
# Copyright for files WiredTiger does not own.
cat > $c2 <<ENDOFTEXT
- * Public Domain 2008-$year WiredTiger, Inc.
+ * Public Domain 2014-$year MongoDB, Inc.
+ * Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
ENDOFTEXT
cat > $c3 <<ENDOFTEXT
-# Copyright (c) 2008-$year WiredTiger, Inc.
+# Copyright (c) 2014-$year MongoDB, Inc.
+# Copyright (c) 2008-2014 WiredTiger, Inc.
# All rights reserved.
#
# See the file LICENSE for redistribution information.
ENDOFTEXT
cat > $c4 <<ENDOFTEXT
-# Public Domain 2008-$year WiredTiger, Inc.
+# Public Domain 2014-$year MongoDB, Inc.
+# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
ENDOFTEXT
@@ -49,19 +53,19 @@ check()
test -f ../$i || return
# Check for a correct copyright header.
- if `sed -e 2,4p -e 5q -e d ../$1 | diff - $c1 > /dev/null` ; then
+ if `sed -e 2,5p -e 6q -e d ../$1 | diff - $c1 > /dev/null` ; then
return;
fi
- if `sed -e 2,3p -e 4q -e d ../$1 | diff - $c2 > /dev/null` ; then
+ if `sed -e 2,4p -e 5q -e d ../$1 | diff - $c2 > /dev/null` ; then
return;
fi
- if `sed -e 3,5p -e 6q -e d ../$1 | diff - $c3 > /dev/null` ; then
+ if `sed -e 3,6p -e 7q -e d ../$1 | diff - $c3 > /dev/null` ; then
return;
fi
- if `sed -e 3,4p -e 5q -e d ../$1 | diff - $c4 > /dev/null` ; then
+ if `sed -e 3,5p -e 6q -e d ../$1 | diff - $c4 > /dev/null` ; then
return;
fi
- if `sed -e 1,2p -e 3q -e d ../$1 | diff - $c4 > /dev/null` ; then
+ if `sed -e 1,3p -e 4q -e d ../$1 | diff - $c4 > /dev/null` ; then
return;
fi
@@ -86,17 +90,20 @@ do
done
# A few special cases: LICENSE, documentation, wt utility, some of which
-# have more than one copyright notice in the file.
-s="Copyright (c) 2008-$year WiredTiger, Inc."
+# have more than one copyright notice in the file. For files that have
+# only a single copyright notice, we give it to MongoDB, from 2008 to now.
+string1="Copyright \(c\) 2014-$year MongoDB, Inc."
+string2="Copyright \(c\) 2008-$year MongoDB, Inc."
+string3="printf.*Copyright \(c\) 2008-$year MongoDB, Inc."
special_copyright()
{
- cnt=`grep "$s" ../$1 | wc -l`
+ cnt=`egrep "$3" ../$1 | wc -l`
if test $cnt -ne $2; then
echo "$1: copyright information is incorrect"
fi
}
-special_copyright LICENSE 1
-special_copyright src/docs/build-javadoc.sh 1
-special_copyright src/docs/style/footer.html 2
-special_copyright src/utilities/util_cpyright.c 2
+special_copyright LICENSE 1 "$string1"
+special_copyright src/docs/build-javadoc.sh 1 "$string2"
+special_copyright src/docs/style/footer.html 2 "$string2"
+special_copyright src/utilities/util_cpyright.c 1 "$string3"
diff --git a/dist/s_define.list b/dist/s_define.list
index c8288425113..7803b628917 100644
--- a/dist/s_define.list
+++ b/dist/s_define.list
@@ -7,12 +7,10 @@ FLD_CLR
F_CAS_ATOMIC
F_CLR_ATOMIC
F_SET_ATOMIC
-IS_INIT_LSN
LF_CLR
LF_SET
LLONG_MAX
LLONG_MIN
-MAX_LSN
SIZE_CHECK
TXNID_LE
TXN_API_CALL
diff --git a/dist/s_string.ok b/dist/s_string.ok
index 94f3ea6b6a5..d3717d27331 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -181,6 +181,7 @@ KV
KVS
Kanowski's
Kounavis
+LANGID
LEX
LF
LIBBZ
@@ -225,6 +226,7 @@ Mellor
Metadata
Mewhort
Mitzenmacher
+MongoDB
MoveFile
Multi
Multithreaded
@@ -436,6 +438,7 @@ btmem
btree
btrees
buf
+buflen
bufs
bufsz
builtin
diff --git a/dist/s_symbols.list b/dist/s_symbols.list
index d3803bc3afa..8f469e94433 100644
--- a/dist/s_symbols.list
+++ b/dist/s_symbols.list
@@ -8,6 +8,7 @@ wiredtiger_pack_start
wiredtiger_pack_str
wiredtiger_pack_uint
wiredtiger_strerror
+wiredtiger_strerror_r
wiredtiger_struct_pack
wiredtiger_struct_size
wiredtiger_struct_unpack
diff --git a/dist/s_tags b/dist/s_tags
index 908b5eb7e0d..faed132d05b 100644
--- a/dist/s_tags
+++ b/dist/s_tags
@@ -35,10 +35,19 @@ ctags $flags ../src/include/*.in ../src/*/*.[chi] 2>/dev/null)
rm -f tags
ctags $flags ../include/*.in ../*/*.[chi] 2>/dev/null)
+# Link the tags file into place if we're at the right level.
+link_tag()
+{
+ if test -e ../include/tags; then
+ rm -f tags && ln -s ../include/tags .
+ fi
+}
+
# Link to the tags file from standard build and source directories.
dirs="`python -c 'import dist; dist.print_source_dirs()'` ../src/os_win"
for i in $dirs; do
- if ! expr "$i" : ".*/include" > /dev/null; then
- (cd $i && rm -f tags && ln -s ../include/tags .)
+ if expr "$i" : ".*/include" > /dev/null; then
+ continue
fi
+ (cd $i && link_tag)
done
diff --git a/dist/stat_data.py b/dist/stat_data.py
index 23243227892..ae442bcc463 100644
--- a/dist/stat_data.py
+++ b/dist/stat_data.py
@@ -77,6 +77,10 @@ class TxnStat(Stat):
prefix = 'transaction'
def __init__(self, name, desc, flags=''):
Stat.__init__(self, name, TxnStat.prefix, desc, flags)
+class YieldStat(Stat):
+ prefix = 'thread-yield'
+ def __init__(self, name, desc, flags=''):
+ Stat.__init__(self, name, YieldStat.prefix, desc, flags)
##########################################
# Groupings of useful statistics:
@@ -162,6 +166,8 @@ connection_stats = [
'failed eviction of pages that exceeded the in-memory maximum'),
CacheStat('cache_eviction_hazard', 'hazard pointer blocked page eviction'),
CacheStat('cache_eviction_internal', 'internal pages evicted'),
+ CacheStat('cache_eviction_maximum_page_size',
+ 'maximum page size at eviction', 'max_aggregate,no_scale'),
CacheStat('cache_eviction_queue_empty',
'eviction server candidate queue empty when topping up'),
CacheStat('cache_eviction_queue_not_empty',
@@ -301,6 +307,15 @@ connection_stats = [
CursorStat('cursor_search', 'cursor search calls'),
CursorStat('cursor_search_near', 'cursor search near calls'),
CursorStat('cursor_update', 'cursor update calls'),
+
+ ##########################################
+ # Yield statistics
+ ##########################################
+ YieldStat('page_busy_blocked', 'page acquire busy blocked'),
+ YieldStat('page_forcible_evict_blocked', 'page acquire eviction blocked'),
+ YieldStat('page_locked_blocked', 'page acquire locked blocked'),
+ YieldStat('page_read_blocked', 'page acquire read blocked'),
+ YieldStat('page_sleep', 'page acquire time sleeping (usecs)'),
]
connection_stats = sorted(connection_stats, key=attrgetter('name'))
diff --git a/examples/c/ex_access.c b/examples/c/ex_access.c
index 522db567d71..58861267408 100644
--- a/examples/c/ex_access.c
+++ b/examples/c/ex_access.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index cf5fb363c2f..16d22eccebe 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -338,6 +339,22 @@ cursor_ops(WT_SESSION *session)
/*! [Display an error] */
}
+ {
+ /*! [Display an error thread safe] */
+ const char *key = "non-existent key";
+ cursor->set_key(cursor, key);
+ if ((ret = cursor->remove(cursor)) != 0) {
+ char buf[128];
+
+ if (wiredtiger_strerror_r(ret, buf, sizeof(buf)) != 0)
+ (void)snprintf(
+ buf, sizeof(buf), "error value: %d\n", ret);
+ fprintf(stderr, "cursor.remove: %s\n", buf);
+ return (ret);
+ }
+ /*! [Display an error thread safe] */
+ }
+
/*! [Close the cursor] */
ret = cursor->close(cursor);
/*! [Close the cursor] */
@@ -526,14 +543,14 @@ session_ops(WT_SESSION *session)
/*! [Create a table and configure the page size] */
ret = session->create(session,
- "table:mytable", "key_format=S,value_format=S"
+ "table:mytable", "key_format=S,value_format=S,"
"internal_page_max=16KB,leaf_page_max=1MB,leaf_value_max=64KB");
/*! [Create a table and configure the page size] */
ret = session->drop(session, "table:mytable", NULL);
/*! [Create a table and configure a large leaf value max] */
ret = session->create(session,
- "table:mytable", "key_format=S,value_format=S"
+ "table:mytable", "key_format=S,value_format=S,"
"leaf_page_max=16KB,leaf_value_max=256KB");
/*! [Create a table and configure a large leaf value max] */
ret = session->drop(session, "table:mytable", NULL);
diff --git a/examples/c/ex_async.c b/examples/c/ex_async.c
index 0c8f83e4aac..f40e0ea4c5a 100644
--- a/examples/c/ex_async.c
+++ b/examples/c/ex_async.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_backup.c b/examples/c/ex_backup.c
index ea572c8810b..6088c4d6473 100644
--- a/examples/c/ex_backup.c
+++ b/examples/c/ex_backup.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_call_center.c b/examples/c/ex_call_center.c
index 14ab8f37f56..37f5e3a4547 100644
--- a/examples/c/ex_call_center.c
+++ b/examples/c/ex_call_center.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_config.c b/examples/c/ex_config.c
index cb8ab02b393..0086621fccf 100644
--- a/examples/c/ex_config.c
+++ b/examples/c/ex_config.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_config_parse.c b/examples/c/ex_config_parse.c
index 543c53f508c..77e5bb48607 100644
--- a/examples/c/ex_config_parse.c
+++ b/examples/c/ex_config_parse.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_cursor.c b/examples/c/ex_cursor.c
index e8f9b7fa9e8..33a4d67fc3c 100644
--- a/examples/c/ex_cursor.c
+++ b/examples/c/ex_cursor.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_data_source.c b/examples/c/ex_data_source.c
index 83d6c13ee4f..5043fa1b67d 100644
--- a/examples/c/ex_data_source.c
+++ b/examples/c/ex_data_source.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_extending.c b/examples/c/ex_extending.c
index f043dd5b383..62901afbb16 100644
--- a/examples/c/ex_extending.c
+++ b/examples/c/ex_extending.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_extractor.c b/examples/c/ex_extractor.c
index 0e40d5ea21d..1bfe21cb452 100644
--- a/examples/c/ex_extractor.c
+++ b/examples/c/ex_extractor.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_hello.c b/examples/c/ex_hello.c
index c94c1072f61..b92d363d824 100644
--- a/examples/c/ex_hello.c
+++ b/examples/c/ex_hello.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_log.c b/examples/c/ex_log.c
index c58c8997c66..ece776b8e5e 100644
--- a/examples/c/ex_log.c
+++ b/examples/c/ex_log.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_pack.c b/examples/c/ex_pack.c
index 29d645f6cfc..19be35119af 100644
--- a/examples/c/ex_pack.c
+++ b/examples/c/ex_pack.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_process.c b/examples/c/ex_process.c
index a25d9084965..16bf0d7746f 100644
--- a/examples/c/ex_process.c
+++ b/examples/c/ex_process.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_schema.c b/examples/c/ex_schema.c
index deca01b558f..8b74500acd3 100644
--- a/examples/c/ex_schema.c
+++ b/examples/c/ex_schema.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_scope.c b/examples/c/ex_scope.c
index 334745f7e37..827be7e92b3 100644
--- a/examples/c/ex_scope.c
+++ b/examples/c/ex_scope.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_stat.c b/examples/c/ex_stat.c
index 31037e364f7..4d27e2dd535 100644
--- a/examples/c/ex_stat.c
+++ b/examples/c/ex_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_thread.c b/examples/c/ex_thread.c
index 5ea3a0a4894..1c6314515df 100644
--- a/examples/c/ex_thread.c
+++ b/examples/c/ex_thread.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_access.java b/examples/java/com/wiredtiger/examples/ex_access.java
index d4046495df5..3c10efd5662 100644
--- a/examples/java/com/wiredtiger/examples/ex_access.java
+++ b/examples/java/com/wiredtiger/examples/ex_access.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_all.java b/examples/java/com/wiredtiger/examples/ex_all.java
index 8648d95a185..4c30b893e06 100644
--- a/examples/java/com/wiredtiger/examples/ex_all.java
+++ b/examples/java/com/wiredtiger/examples/ex_all.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_async.java b/examples/java/com/wiredtiger/examples/ex_async.java
index c6cb0550571..a822b5b8ea9 100644
--- a/examples/java/com/wiredtiger/examples/ex_async.java
+++ b/examples/java/com/wiredtiger/examples/ex_async.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -59,6 +60,7 @@ class AsyncKeys implements AsyncCallback {
long id = op.getId();
/*! [async get identifier] */
+ /* If doing a search, retrieve the key/value pair. */
if (optype == AsyncOpType.WT_AOP_SEARCH) {
/*! [async get the operation's string key] */
String key = op.getKeyString();
@@ -72,10 +74,6 @@ class AsyncKeys implements AsyncCallback {
System.out.println("Id " + id + " got record: " + key +
" : " + value);
}
- else {
- notifyError("unexpected optype");
- ret = 1;
- }
}
catch (Exception e) {
System.err.println("ERROR: exception in notify: " + e.toString() +
@@ -208,15 +206,16 @@ public class ex_async {
return (ret);
}
- public static int
+ public static void
main(String[] argv)
{
try {
- return (asyncExample());
+ System.exit(asyncExample());
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
}
diff --git a/examples/java/com/wiredtiger/examples/ex_call_center.java b/examples/java/com/wiredtiger/examples/ex_call_center.java
index 553f63612bd..c0fc018952e 100644
--- a/examples/java/com/wiredtiger/examples/ex_call_center.java
+++ b/examples/java/com/wiredtiger/examples/ex_call_center.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -125,10 +126,11 @@ public class ex_call_center {
while(br.ready())
System.out.println(br.readLine());
br.close();
+ proc.waitFor();
new File("WT_HOME").mkdir();
- } catch (IOException ioe) {
- System.err.println("IOException: WT_HOME: " + ioe);
- return(1);
+ } catch (Exception ex) {
+ System.err.println("Exception: " + ex);
+ return (1);
}
} else
home = null;
@@ -196,8 +198,8 @@ public class ex_call_center {
cursor = session.open_cursor("table:calls", null, "append");
for (Call call : callSample) {
cursor.putValueLong(call.call_date);
- cursor.putValueLong(call.cust_id);
- cursor.putValueLong(call.emp_id);
+ cursor.putValueRecord(call.cust_id);
+ cursor.putValueRecord(call.emp_id);
cursor.putValueString(call.call_type);
cursor.putValueString(call.notes);
ret = cursor.insert();
@@ -223,7 +225,7 @@ public class ex_call_center {
ret = cursor.search();
if (ret == 0) {
Customer cust = new Customer();
- cust.id = cursor.getValueLong();
+ cust.id = cursor.getValueRecord();
cust.name = cursor.getValueString();
System.out.println("Read customer record for " + cust.name +
" (ID " + cust.id + ")");
@@ -253,7 +255,7 @@ public class ex_call_center {
* backwards.
*/
long custid = 1;
- cursor.putKeyLong(custid + 1);
+ cursor.putKeyRecord(custid + 1);
cursor.putKeyLong(0);
nearstatus = cursor.search_near();
@@ -268,7 +270,7 @@ public class ex_call_center {
ret = cursor.prev();
for (count = 0; ret == 0 && count < 3; ++count) {
Call call = new Call();
- call.cust_id = cursor.getValueLong();
+ call.cust_id = cursor.getValueRecord();
call.call_type = cursor.getValueString();
call.notes = cursor.getValueString();
if (call.cust_id != custid)
@@ -285,15 +287,16 @@ public class ex_call_center {
return (ret);
}
- public static int
+ public static void
main(String[] argv)
{
try {
- return (callCenterExample());
+ System.exit(callCenterExample());
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
}
diff --git a/examples/java/com/wiredtiger/examples/ex_cursor.java b/examples/java/com/wiredtiger/examples/ex_cursor.java
index 7b8de7739d2..38af04d5849 100644
--- a/examples/java/com/wiredtiger/examples/ex_cursor.java
+++ b/examples/java/com/wiredtiger/examples/ex_cursor.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -177,10 +178,11 @@ public class ex_cursor {
while(br.ready())
System.out.println(br.readLine());
br.close();
+ proc.waitFor();
new File("WT_HOME").mkdir();
- } catch (IOException ioe) {
- System.err.println("IOException: WT_HOME: " + ioe);
- return(1);
+ } catch (Exception ex) {
+ System.err.println("Exception: " + ex);
+ return (1);
}
} else
home = null;
@@ -225,15 +227,16 @@ public class ex_cursor {
return (ret);
}
- public static int
+ public static void
main(String[] argv)
{
try {
- return (cursorExample());
+ System.exit(cursorExample());
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
}
diff --git a/examples/java/com/wiredtiger/examples/ex_log.java b/examples/java/com/wiredtiger/examples/ex_log.java
index d7bc6987878..4a721d2a275 100644
--- a/examples/java/com/wiredtiger/examples/ex_log.java
+++ b/examples/java/com/wiredtiger/examples/ex_log.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -56,7 +57,7 @@ public class ex_log {
conn = wiredtiger.open(home2, CONN_CONFIG);
Session session = conn.open_session(null);
- session.create(uri, "key_format=S,value_format=S");
+ session.create(uri, "key_format=U,value_format=U");
return (session);
}
@@ -71,16 +72,17 @@ public class ex_log {
while ((ret = cursor.next()) == 0) {
ret = curs_copy.next();
- String key = cursor.getKeyString();
- String value = cursor.getValueString();
- String key_copy = curs_copy.getKeyString();
- String value_copy = curs_copy.getValueString();
- if (!key.equals(key_copy) || !value.equals(value_copy)) {
+ byte[] key = cursor.getKeyByteArray();
+ byte[] value = cursor.getValueByteArray();
+ byte[] key_copy = curs_copy.getKeyByteArray();
+ byte[] value_copy = curs_copy.getValueByteArray();
+ if (!Arrays.equals(key, key_copy) ||
+ !Arrays.equals(value, value_copy)) {
System.err.println(
- "Mismatched: key " + key +
- ", key_copy " + key_copy +
- " value " + value +
- " value_copy " + value_copy);
+ "Mismatched: key " + new String(key) +
+ ", key_copy " + new String(key_copy) +
+ ", value " + new String(value) +
+ ", value_copy " + new String(value_copy));
return (1);
}
}
@@ -109,7 +111,7 @@ public class ex_log {
": record type " + rectype + " optype " + optype +
" txnid " + txnid + " fileid " + fileid);
System.out.println(" key size " + key.length +
- "value size " + value.length);
+ " value size " + value.length);
if (rectype == wiredtiger.WT_LOGREC_MESSAGE)
System.out.println("Application Record: " + new String(value));
}
@@ -301,10 +303,11 @@ public class ex_log {
while(br.ready())
System.out.println(br.readLine());
br.close();
+ proc.waitFor();
new File(home1).mkdir();
new File(home2).mkdir();
- } catch (IOException ioe) {
- System.err.println("IOException: " + ioe);
+ } catch (Exception ex) {
+ System.err.println("Exception: " + ex);
return (1);
}
if ((wt_conn = wiredtiger.open(home1, CONN_CONFIG)) == null) {
@@ -344,6 +347,7 @@ public class ex_log {
ret = session.log_printf("Wrote " + record_count + " records");
/*! [log cursor printf] */
+ session.close(null);
/*
* Close and reopen the connection so that the log ends up with
* a variety of records such as file sync and checkpoint. We
@@ -358,19 +362,21 @@ public class ex_log {
session = wt_conn.open_session(null);
ret = simple_walk_log(session);
ret = walk_log(session);
+ ret = session.close(null);
ret = wt_conn.close(null);
return (ret);
}
- public static int
- main()
+ public static void
+ main(String[] args)
{
try {
- return (logExample());
+ System.exit(logExample());
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
}
diff --git a/examples/java/com/wiredtiger/examples/ex_schema.java b/examples/java/com/wiredtiger/examples/ex_schema.java
index 18926f47008..5b849ecf430 100644
--- a/examples/java/com/wiredtiger/examples/ex_schema.java
+++ b/examples/java/com/wiredtiger/examples/ex_schema.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -91,10 +92,11 @@ public class ex_schema {
while(br.ready())
System.out.println(br.readLine());
br.close();
+ proc.waitFor();
new File("WT_HOME").mkdir();
- } catch (IOException ioe) {
- System.err.println("IOException: WT_HOME: " + ioe);
- return(1);
+ } catch (Exception ex) {
+ System.err.println("Exception: " + ex);
+ return (1);
}
} else
home = null;
@@ -158,10 +160,23 @@ public class ex_schema {
}
ret = cursor.close();
+ /* Update records in the table. */
+ cursor = session.open_cursor("table:poptable", null, null);
+ while ((ret = cursor.next()) == 0) {
+ recno = cursor.getKeyRecord();
+ country = cursor.getValueString();
+ year = cursor.getValueShort();
+ population = cursor.getValueLong();
+ cursor.putValueString(country);
+ cursor.putValueShort(year);
+ cursor.putValueLong(population + 1);
+ }
+ ret = cursor.close();
+
/* List the records in the table. */
cursor = session.open_cursor("table:poptable", null, null);
while ((ret = cursor.next()) == 0) {
- recno = cursor.getKeyLong();
+ recno = cursor.getKeyRecord();
country = cursor.getValueString();
year = cursor.getValueShort();
population = cursor.getValueLong();
@@ -281,7 +296,7 @@ public class ex_schema {
while ((ret = cursor.next()) == 0) {
country = cursor.getKeyString();
year = cursor.getKeyShort();
- recno = cursor.getValueLong();
+ recno = cursor.getValueRecord();
System.out.println("row ID " + recno + ": country " + country +
", year " + year);
}
@@ -325,15 +340,16 @@ public class ex_schema {
return (ret);
}
- public static int
+ public static void
main(String[] argv)
{
try {
- return (schemaExample());
+ System.exit(schemaExample());
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
}
diff --git a/examples/java/com/wiredtiger/examples/ex_stat.java b/examples/java/com/wiredtiger/examples/ex_stat.java
index c81bb64c22a..2e932e1027f 100644
--- a/examples/java/com/wiredtiger/examples/ex_stat.java
+++ b/examples/java/com/wiredtiger/examples/ex_stat.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -200,16 +201,18 @@ public class ex_stat {
if (System.getenv("WIREDTIGER_HOME") == null) {
home = "WT_HOME";
try {
- Process proc = Runtime.getRuntime().exec("/bin/rm -rf WT_HOME");
+ Process proc = Runtime.getRuntime().exec("/bin/rm -rf " + home);
BufferedReader br = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
while(br.ready())
System.out.println(br.readLine());
br.close();
- new File("WT_HOME").mkdir();
- } catch (IOException ioe) {
- System.err.println("IOException: WT_HOME: " + ioe);
- return(1);
+ proc.waitFor();
+ if (!(new File(home)).mkdir())
+ System.err.println("mkdir: failed");
+ } catch (Exception ex) {
+ System.err.println("Exception: " + home + ": " + ex);
+ System.exit(1);
}
} else
home = null;
@@ -238,15 +241,16 @@ public class ex_stat {
return (conn.close(null) == 0 ? ret : -1);
}
- public static int
+ public static void
main(String[] argv)
{
try {
- return ((new ex_stat()).statExample());
+ System.exit((new ex_stat()).statExample());
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
}
diff --git a/examples/java/com/wiredtiger/examples/ex_thread.java b/examples/java/com/wiredtiger/examples/ex_thread.java
index c6b9a5479a9..59ab9c40b34 100644
--- a/examples/java/com/wiredtiger/examples/ex_thread.java
+++ b/examples/java/com/wiredtiger/examples/ex_thread.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -59,6 +60,8 @@ class ScanThread extends Thread {
if (ret != wiredtiger.WT_NOTFOUND)
System.err.println("Cursor.next: " +
wiredtiger.wiredtiger_strerror(ret));
+ cursor.close();
+ session.close(null);
} catch (WiredTigerException wte) {
System.err.println("Exception " + wte);
}
@@ -73,7 +76,7 @@ public class ex_thread {
public static final int NUM_THREADS = 10;
/*! [thread main] */
- static int main(String[] argv)
+ public static void main(String[] argv)
{
try {
Thread[] threads = new Thread[NUM_THREADS];
@@ -85,7 +88,7 @@ public class ex_thread {
* environment variable isn't already set (as is done by make check).
*/
if (System.getenv("WIREDTIGER_HOME") == null) {
- home = "WT_HOME";
+ home = "WT_HOME";
try {
Process proc = Runtime.getRuntime().exec("/bin/rm -rf " + home);
BufferedReader br = new BufferedReader(
@@ -93,17 +96,19 @@ public class ex_thread {
while(br.ready())
System.out.println(br.readLine());
br.close();
- new File(home).mkdir();
- } catch (IOException ioe) {
- System.err.println("IOException: " + home + ": " + ioe);
- return(1);
+ proc.waitFor();
+ if (!(new File(home)).mkdir())
+ System.err.println("mkdir: failed");
+ } catch (Exception ex) {
+ System.err.println("Exception: " + home + ": " + ex);
+ System.exit(1);
}
} else
home = null;
if ((conn = wiredtiger.open(home, "create")) == null) {
System.err.println("Error connecting to " + home);
- return(1);
+ System.exit(1);
}
/* Note: further error checking omitted for clarity. */
@@ -114,6 +119,7 @@ public class ex_thread {
cursor.putKeyString("key1");
cursor.putValueString("value1");
ret = cursor.insert();
+ cursor.close();
ret = session.close(null);
for (i = 0; i < NUM_THREADS; i++) {
@@ -130,11 +136,12 @@ public class ex_thread {
}
ret = conn.close(null);
- return (ret);
+ System.exit(ret);
}
catch (WiredTigerException wte) {
System.err.println("Exception: " + wte);
- return (-1);
+ wte.printStackTrace();
+ System.exit(1);
}
}
/*! [thread main] */
diff --git a/examples/python/ex_access.py b/examples/python/ex_access.py
index addc7386f03..7789f932d19 100755
--- a/examples/python/ex_access.py
+++ b/examples/python/ex_access.py
@@ -1,3 +1,4 @@
+# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/ext/collators/reverse/reverse_collator.c b/ext/collators/reverse/reverse_collator.c
index 0ccebba7919..336519fe661 100644
--- a/ext/collators/reverse/reverse_collator.c
+++ b/ext/collators/reverse/reverse_collator.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/bzip2/bzip2_compress.c b/ext/compressors/bzip2/bzip2_compress.c
index cd73b237387..3f2e09de2f6 100644
--- a/ext/compressors/bzip2/bzip2_compress.c
+++ b/ext/compressors/bzip2/bzip2_compress.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/nop/nop_compress.c b/ext/compressors/nop/nop_compress.c
index e536c8fefd8..6b640adf777 100644
--- a/ext/compressors/nop/nop_compress.c
+++ b/ext/compressors/nop/nop_compress.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/snappy/snappy_compress.c b/ext/compressors/snappy/snappy_compress.c
index 7ed759e6807..63f6f87f7f6 100644
--- a/ext/compressors/snappy/snappy_compress.c
+++ b/ext/compressors/snappy/snappy_compress.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/zlib/zlib_compress.c b/ext/compressors/zlib/zlib_compress.c
index 8dd619d695c..8cf8ab4792e 100644
--- a/ext/compressors/zlib/zlib_compress.c
+++ b/ext/compressors/zlib/zlib_compress.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/datasources/helium/helium.c b/ext/datasources/helium/helium.c
index 4191163f20b..d62ecb846e9 100644
--- a/ext/datasources/helium/helium.c
+++ b/ext/datasources/helium/helium.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/test/kvs_bdb/kvs_bdb.c b/ext/test/kvs_bdb/kvs_bdb.c
index 4f61606f74d..48305937236 100644
--- a/ext/test/kvs_bdb/kvs_bdb.c
+++ b/ext/test/kvs_bdb/kvs_bdb.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/AsyncCallback.java b/lang/java/src/com/wiredtiger/db/AsyncCallback.java
index 4f6fb5df133..c3640c1a47d 100644
--- a/lang/java/src/com/wiredtiger/db/AsyncCallback.java
+++ b/lang/java/src/com/wiredtiger/db/AsyncCallback.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java b/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
index fc4b99ae435..c53938d0a58 100644
--- a/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
+++ b/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -84,7 +85,6 @@ public class PackFormatInputStream {
protected char getType()
throws WiredTigerPackingException {
if (formatOff >= format.length()) {
- System.err.println("Raw format is: " + format);
throw new WiredTigerPackingException(
"No more fields in format.");
}
diff --git a/lang/java/src/com/wiredtiger/db/PackInputStream.java b/lang/java/src/com/wiredtiger/db/PackInputStream.java
index f0e5bb9663d..a49b2e01f17 100644
--- a/lang/java/src/com/wiredtiger/db/PackInputStream.java
+++ b/lang/java/src/com/wiredtiger/db/PackInputStream.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -224,6 +225,7 @@ public class PackInputStream {
public String getString()
throws WiredTigerPackingException {
int stringLength = 0;
+ int skipnull = 0;
format.checkType('S', false);
// Get the length for a fixed length string
if (format.getType() != 'S') {
@@ -234,10 +236,11 @@ public class PackInputStream {
// string length.
for (; valueOff + stringLength < value.length &&
value[valueOff + stringLength] != 0; stringLength++) {}
+ skipnull = 1;
}
format.consume();
String result = new String(value, valueOff, stringLength);
- valueOff += stringLength + 1;
+ valueOff += stringLength + skipnull;
return result;
}
@@ -249,7 +252,7 @@ public class PackInputStream {
private short unpackShort(boolean signed)
throws WiredTigerPackingException {
long ret = unpackLong(true);
- if ((signed && (ret > Short.MAX_VALUE || ret > Short.MIN_VALUE)) ||
+ if ((signed && (ret > Short.MAX_VALUE || ret < Short.MIN_VALUE)) ||
(!signed && (short)ret < 0)) {
throw new WiredTigerPackingException("Overflow unpacking short.");
}
@@ -264,7 +267,7 @@ public class PackInputStream {
private int unpackInt(boolean signed)
throws WiredTigerPackingException {
long ret = unpackLong(true);
- if ((signed && (ret > Integer.MAX_VALUE || ret > Integer.MIN_VALUE)) ||
+ if ((signed && (ret > Integer.MAX_VALUE || ret < Integer.MIN_VALUE)) ||
(!signed && (int)ret < 0)) {
throw new WiredTigerPackingException("Overflow unpacking integer.");
}
diff --git a/lang/java/src/com/wiredtiger/db/PackOutputStream.java b/lang/java/src/com/wiredtiger/db/PackOutputStream.java
index 185068d2093..e79b4c63498 100644
--- a/lang/java/src/com/wiredtiger/db/PackOutputStream.java
+++ b/lang/java/src/com/wiredtiger/db/PackOutputStream.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -173,13 +174,16 @@ public class PackOutputStream {
char fieldFormat = format.getType();
int stringLen = 0;
int padBytes = 0;
+ int valLen = 0;
// Strings have two possible encodings. A lower case 's' is not null
// terminated, and has a length define in the format (default 1). An
// upper case 'S' is variable length and has a null terminator.
if (fieldFormat == 's') {
stringLen = format.getLengthFromFormat(true);
- if (stringLen > value.length()) {
- padBytes = stringLen - value.length();
+ valLen = value.length();
+ if (stringLen > valLen) {
+ padBytes = stringLen - valLen;
+ stringLen = valLen;
}
} else {
stringLen = value.length();
diff --git a/lang/java/src/com/wiredtiger/db/PackUtil.java b/lang/java/src/com/wiredtiger/db/PackUtil.java
index c8804891da5..bfc13d9a586 100644
--- a/lang/java/src/com/wiredtiger/db/PackUtil.java
+++ b/lang/java/src/com/wiredtiger/db/PackUtil.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerException.java b/lang/java/src/com/wiredtiger/db/WiredTigerException.java
index b437ab98eee..69ce031b6ef 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerException.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java b/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
index 4f08f60b956..2af1c5ccc9f 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java b/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
index 2b10beda752..8535af5d316 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java b/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
index 0521b43aac9..2f620d95da3 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/wiredtiger.i b/lang/java/wiredtiger.i
index 0b2b4cdd1d2..09290a70c67 100644
--- a/lang/java/wiredtiger.i
+++ b/lang/java/wiredtiger.i
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -651,6 +652,19 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Append a record number to the async_op's key.
+ *
+ * \param value The value to append
+ * \return This async_op object, so put calls can be chained.
+ */
+ public AsyncOp putKeyRecord(long value)
+ throws WiredTigerPackingException {
+ keyUnpacker = null;
+ keyPacker.addRecord(value);
+ return this;
+ }
+
+ /**
* Append a short integer to the async_op's key.
*
* \param value The value to append
@@ -743,6 +757,19 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Append a record number to the async_op's value.
+ *
+ * \param value The value to append
+ * \return This async_op object, so put calls can be chained.
+ */
+ public AsyncOp putValueRecord(long value)
+ throws WiredTigerPackingException {
+ valueUnpacker = null;
+ valuePacker.addRecord(value);
+ return this;
+ }
+
+ /**
* Append a short integer to the async_op's value.
*
* \param value The value to append
@@ -834,6 +861,16 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Retrieve a record number from the async_op's key.
+ *
+ * \return The requested value.
+ */
+ public long getKeyRecord()
+ throws WiredTigerPackingException {
+ return getKeyUnpacker().getRecord();
+ }
+
+ /**
* Retrieve a short integer from the async_op's key.
*
* \return The requested value.
@@ -919,6 +956,16 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Retrieve a record number from the async_op's value.
+ *
+ * \return The requested value.
+ */
+ public long getValueRecord()
+ throws WiredTigerPackingException {
+ return getValueUnpacker().getRecord();
+ }
+
+ /**
* Retrieve a short integer from the async_op's value.
*
* \return The requested value.
@@ -1201,6 +1248,18 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Append a record number to the cursor's key.
+ *
+ * \param value The value to append
+ * \return This cursor object, so put calls can be chained.
+ */
+ public Cursor putKeyRecord(long value)
+ throws WiredTigerPackingException {
+ keyPacker.addRecord(value);
+ return this;
+ }
+
+ /**
* Append a short integer to the cursor's key.
*
* \param value The value to append
@@ -1287,6 +1346,18 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Append a record number to the cursor's value.
+ *
+ * \param value The value to append
+ * \return This cursor object, so put calls can be chained.
+ */
+ public Cursor putValueRecord(long value)
+ throws WiredTigerPackingException {
+ valuePacker.addRecord(value);
+ return this;
+ }
+
+ /**
* Append a short integer to the cursor's value.
*
* \param value The value to append
@@ -1376,6 +1447,16 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Retrieve a record number from the cursor's key.
+ *
+ * \return The requested value.
+ */
+ public long getKeyRecord()
+ throws WiredTigerPackingException {
+ return keyUnpacker.getRecord();
+ }
+
+ /**
* Retrieve a short integer from the cursor's key.
*
* \return The requested value.
@@ -1461,6 +1542,16 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
}
/**
+ * Retrieve a record number from the cursor's value.
+ *
+ * \return The requested value.
+ */
+ public long getValueRecord()
+ throws WiredTigerPackingException {
+ return valueUnpacker.getRecord();
+ }
+
+ /**
* Retrieve a short integer from the cursor's value.
*
* \return The requested value.
@@ -1800,7 +1891,8 @@ err: if (ret != 0)
if ((ret = $self->open_cursor($self, uri, to_dup, config, &cursor)) != 0)
goto err;
- cursor->flags |= WT_CURSTD_RAW;
+ if ((cursor->flags & WT_CURSTD_DUMP_JSON) == 0)
+ cursor->flags |= WT_CURSTD_RAW;
if ((ret = __wt_calloc_def((WT_SESSION_IMPL *)cursor->session,
1, &jcb)) != 0)
diff --git a/lang/python/setup.py b/lang/python/setup.py
index 7d99c872bc3..28bbe4d07e8 100644
--- a/lang/python/setup.py
+++ b/lang/python/setup.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i
index 5e88855276a..de5afb0a0fa 100644
--- a/lang/python/wiredtiger.i
+++ b/lang/python/wiredtiger.i
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -338,7 +339,9 @@ retry:
if (result != 0 && result != EBUSY)
SWIG_ERROR_IF_NOT_SET(result);
else if (result == EBUSY) {
+ SWIG_PYTHON_THREAD_BEGIN_ALLOW;
__wt_sleep(0, 10000);
+ SWIG_PYTHON_THREAD_END_ALLOW;
goto retry;
}
}
@@ -360,10 +363,19 @@ retry:
}
%enddef
-/* Cursor compare can return any of -1, 0, 1 or WT_NOTFOUND. */
+/* Cursor compare can return any of -1, 0, 1. */
%define COMPARE_OK(m)
%exception m {
$action
+ if (result < -1 || result > 1)
+ SWIG_ERROR_IF_NOT_SET(result);
+}
+%enddef
+
+/* Cursor compare can return any of -1, 0, 1 or WT_NOTFOUND. */
+%define COMPARE_NOTFOUND_OK(m)
+%exception m {
+ $action
if ((result < -1 || result > 1) && result != WT_NOTFOUND)
SWIG_ERROR_IF_NOT_SET(result);
}
@@ -378,7 +390,7 @@ NOTFOUND_OK(__wt_cursor::search)
NOTFOUND_OK(__wt_cursor::update)
COMPARE_OK(__wt_cursor::compare)
-COMPARE_OK(__wt_cursor::search_near)
+COMPARE_NOTFOUND_OK(__wt_cursor::search_near)
/* Lastly, some methods need no (additional) error checking. */
%exception __wt_connection::get_home;
diff --git a/lang/python/wiredtiger/fpacking.py b/lang/python/wiredtiger/fpacking.py
index 632c5c5a1c5..62d7af739b8 100644
--- a/lang/python/wiredtiger/fpacking.py
+++ b/lang/python/wiredtiger/fpacking.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/lang/python/wiredtiger/intpack-test.py b/lang/python/wiredtiger/intpack-test.py
index 6c1c991ddfd..8855dc4e72d 100644
--- a/lang/python/wiredtiger/intpack-test.py
+++ b/lang/python/wiredtiger/intpack-test.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/lang/python/wiredtiger/intpacking.py b/lang/python/wiredtiger/intpacking.py
index fefdb0dca1f..239bc84069d 100644
--- a/lang/python/wiredtiger/intpacking.py
+++ b/lang/python/wiredtiger/intpacking.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/lang/python/wiredtiger/packing-test.py b/lang/python/wiredtiger/packing-test.py
index 4b06b2bc608..2eb0baa1d47 100644
--- a/lang/python/wiredtiger/packing-test.py
+++ b/lang/python/wiredtiger/packing-test.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/lang/python/wiredtiger/packing.py b/lang/python/wiredtiger/packing.py
index ee12434cabd..103c0471724 100644
--- a/lang/python/wiredtiger/packing.py
+++ b/lang/python/wiredtiger/packing.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/src/async/async_api.c b/src/async/async_api.c
index 6aeb404bccd..e211f2352a4 100644
--- a/src/async/async_api.c
+++ b/src/async/async_api.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/async/async_op.c b/src/async/async_op.c
index 9dba2b2b5f3..86797af635b 100644
--- a/src/async/async_op.c
+++ b/src/async/async_op.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/async/async_worker.c b/src/async/async_worker.c
index ecf052fc3bf..c68d0e8a838 100644
--- a/src/async/async_worker.c
+++ b/src/async/async_worker.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_addr.c b/src/block/block_addr.c
index bbd52359157..6b5610eb17c 100644
--- a/src/block/block_addr.c
+++ b/src/block/block_addr.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_ckpt.c b/src/block/block_ckpt.c
index 83c3a40e8e1..bb0a0543053 100644
--- a/src/block/block_ckpt.c
+++ b/src/block/block_ckpt.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -154,7 +155,7 @@ err: /*
if (checkpoint && ci != NULL)
__wt_block_ckpt_destroy(session, ci);
- __wt_scr_free(&tmp);
+ __wt_scr_free(session, &tmp);
return (ret);
}
@@ -657,7 +658,7 @@ err: if (locked)
if ((ci = ckpt->bpriv) != NULL)
__wt_block_ckpt_destroy(session, ci);
- __wt_scr_free(&tmp);
+ __wt_scr_free(session, &tmp);
return (ret);
}
@@ -741,7 +742,7 @@ __ckpt_update(WT_SESSION_IMPL *session,
block->name, ckpt->name, (const char *)tmp->data));
}
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/block/block_compact.c b/src/block/block_compact.c
index 007c77f3291..c7f2b09aa23 100644
--- a/src/block/block_compact.c
+++ b/src/block/block_compact.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_ext.c b/src/block/block_ext.c
index 28c39c71a08..e5b3a9e5d98 100644
--- a/src/block/block_ext.c
+++ b/src/block/block_ext.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -1199,7 +1200,7 @@ corrupted: WT_PANIC_RET(session, WT_ERROR,
if (WT_VERBOSE_ISSET(session, WT_VERB_BLOCK))
WT_ERR(__block_extlist_dump(session, "read extlist", el, 0));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -1295,7 +1296,7 @@ __wt_block_extlist_write(WT_SESSION_IMPL *session,
"%s written %" PRIdMAX "/%" PRIu32,
el->name, (intmax_t)el->offset, el->size));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/block/block_map.c b/src/block/block_map.c
index 68fb75179d9..6dc270760d6 100644
--- a/src/block/block_map.c
+++ b/src/block/block_map.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_mgr.c b/src/block/block_mgr.c
index a9b3b07904d..13e6ec73b32 100644
--- a/src/block/block_mgr.c
+++ b/src/block/block_mgr.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_open.c b/src/block/block_open.c
index 0abe9cffc5f..7c42c0b2bc9 100644
--- a/src/block/block_open.c
+++ b/src/block/block_open.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -254,7 +255,7 @@ __wt_desc_init(WT_SESSION_IMPL *session, WT_FH *fh, uint32_t allocsize)
ret = __wt_write(session, fh, (wt_off_t)0, (size_t)allocsize, desc);
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
@@ -312,7 +313,7 @@ __desc_read(WT_SESSION_IMPL *session, WT_BLOCK *block)
WT_BLOCK_MAJOR_VERSION, WT_BLOCK_MINOR_VERSION,
desc->majorv, desc->minorv);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/block/block_read.c b/src/block/block_read.c
index c8a26e77341..ef944fcb152 100644
--- a/src/block/block_read.c
+++ b/src/block/block_read.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -43,7 +44,7 @@ __wt_bm_preload(WT_BM *bm,
WT_RET(__wt_scr_alloc(session, size, &tmp));
ret = __wt_block_read_off(
session, block, tmp, offset, size, cksum);
- __wt_scr_free(&tmp);
+ __wt_scr_free(session, &tmp);
WT_RET(ret);
}
}
diff --git a/src/block/block_session.c b/src/block/block_session.c
index 90fe0af562a..6683fdd20ce 100644
--- a/src/block/block_session.c
+++ b/src/block/block_session.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_slvg.c b/src/block/block_slvg.c
index 349daa620f5..98722a83178 100644
--- a/src/block/block_slvg.c
+++ b/src/block/block_slvg.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -154,7 +155,7 @@ __wt_block_salvage_next(WT_SESSION_IMPL *session,
*addr_sizep = WT_PTRDIFF(endp, addr);
done:
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/block/block_vrfy.c b/src/block/block_vrfy.c
index db4e42b79e7..ac49f24553b 100644
--- a/src/block/block_vrfy.c
+++ b/src/block/block_vrfy.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_write.c b/src/block/block_write.c
index 7c91a28451c..aafe18615c6 100644
--- a/src/block/block_write.c
+++ b/src/block/block_write.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/bloom/bloom.c b/src/bloom/bloom.c
index 5f7a8f47c21..06d0b7478dd 100644
--- a/src/bloom/bloom.c
+++ b/src/bloom/bloom.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_compact.c b/src/btree/bt_compact.c
index e81c951e9f6..405410c6a1c 100644
--- a/src/btree/bt_compact.c
+++ b/src/btree/bt_compact.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_curnext.c b/src/btree/bt_curnext.c
index 9cd7f0241fc..6140dca1fad 100644
--- a/src/btree/bt_curnext.c
+++ b/src/btree/bt_curnext.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_curprev.c b/src/btree/bt_curprev.c
index 851b01d3732..880cb777954 100644
--- a/src/btree/bt_curprev.c
+++ b/src/btree/bt_curprev.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_cursor.c b/src/btree/bt_cursor.c
index 390c6819ca2..4aee1883ae0 100644
--- a/src/btree/bt_cursor.c
+++ b/src/btree/bt_cursor.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c
index 05407537a53..4de94277364 100644
--- a/src/btree/bt_debug.c
+++ b/src/btree/bt_debug.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -118,7 +119,7 @@ __dmsg_wrapup(WT_DBG *ds)
session = ds->session;
msg = ds->msg;
- __wt_scr_free(&ds->tmp);
+ __wt_scr_free(session, &ds->tmp);
/*
* Discard the buffer -- it shouldn't have anything in it, but might
@@ -127,7 +128,7 @@ __dmsg_wrapup(WT_DBG *ds)
if (msg != NULL) {
if (msg->size != 0)
(void)__wt_msg(session, "%s", (char *)msg->mem);
- __wt_scr_free(&ds->msg);
+ __wt_scr_free(session, &ds->msg);
}
/* Close any file we opened. */
@@ -207,7 +208,7 @@ __wt_debug_addr_print(
WT_RET(__wt_scr_alloc(session, 128, &buf));
fprintf(stderr, "%s\n",
__wt_addr_string(session, addr, addr_size, buf));
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (0);
}
@@ -230,7 +231,7 @@ __wt_debug_addr(WT_SESSION_IMPL *session,
WT_ERR(bm->read(bm, session, buf, addr, addr_size));
ret = __wt_debug_disk(session, buf->mem, ofile);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
@@ -257,7 +258,7 @@ __wt_debug_offset_blind(
session, S2BT(session)->bm->block, buf, offset));
ret = __wt_debug_disk(session, buf->mem, ofile);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
@@ -295,7 +296,7 @@ __wt_debug_offset(WT_SESSION_IMPL *session,
WT_ERR(__wt_bt_read(session, buf, addr, WT_PTRDIFF(endp, addr)));
ret = __wt_debug_disk(session, buf->mem, ofile);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
@@ -315,6 +316,8 @@ __wt_debug_disk(
__dmsg(ds, "%s page", __wt_page_type_string(dsk->type));
switch (dsk->type) {
+ case WT_PAGE_BLOCK_MANAGER:
+ break;
case WT_PAGE_COL_FIX:
case WT_PAGE_COL_INT:
case WT_PAGE_COL_VAR:
@@ -331,6 +334,8 @@ __wt_debug_disk(
}
switch (dsk->type) {
+ case WT_PAGE_BLOCK_MANAGER:
+ break;
case WT_PAGE_COL_FIX:
__debug_dsk_col_fix(ds, dsk);
break;
@@ -851,7 +856,7 @@ __debug_page_row_leaf(WT_DBG *ds, WT_PAGE *page)
__debug_row_skip(ds, insert);
}
-err: __wt_scr_free(&key);
+err: __wt_scr_free(session, &key);
return (ret);
}
@@ -1019,7 +1024,7 @@ __debug_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk, WT_CELL_UNPACK *unpack)
addr: WT_RET(__wt_scr_alloc(session, 128, &buf));
__dmsg(ds, ", %s %s", type,
__wt_addr_string(session, unpack->data, unpack->size, buf));
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
WT_RET(ret);
break;
}
@@ -1078,7 +1083,7 @@ __debug_cell_data(WT_DBG *ds,
__wt_page_cell_data_ref(session, page, unpack, buf);
if (ret == 0)
__debug_item(ds, tag, buf->data, buf->size);
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
break;
WT_ILLEGAL_VALUE(session);
}
diff --git a/src/btree/bt_delete.c b/src/btree/bt_delete.c
index a58ed5d66e9..c97ea176c97 100644
--- a/src/btree/bt_delete.c
+++ b/src/btree/bt_delete.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_discard.c b/src/btree/bt_discard.c
index a162e2dc841..05a54ad643e 100644
--- a/src/btree/bt_discard.c
+++ b/src/btree/bt_discard.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c
index 69c9ab27656..943a8573f29 100644
--- a/src/btree/bt_handle.c
+++ b/src/btree/bt_handle.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_huffman.c b/src/btree/bt_huffman.c
index 80da16f2a62..c1cf3431c3b 100644
--- a/src/btree/bt_huffman.c
+++ b/src/btree/bt_huffman.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_io.c b/src/btree/bt_io.c
index 9d154311a8c..3ff395dbbfd 100644
--- a/src/btree/bt_io.c
+++ b/src/btree/bt_io.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -116,7 +117,7 @@ __wt_bt_read(WT_SESSION_IMPL *session,
WT_STAT_FAST_CONN_INCRV(session, cache_bytes_read, dsk->mem_size);
WT_STAT_FAST_DATA_INCRV(session, cache_bytes_read, dsk->mem_size);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -173,7 +174,7 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
ip = buf;
}
WT_ERR(__wt_verify_dsk(session, "[write-check]", ip));
- __wt_scr_free(&tmp);
+ __wt_scr_free(session, &tmp);
#endif
/*
@@ -298,6 +299,6 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
WT_STAT_FAST_CONN_INCRV(session, cache_bytes_write, dsk->mem_size);
WT_STAT_FAST_DATA_INCRV(session, cache_bytes_write, dsk->mem_size);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/btree/bt_misc.c b/src/btree/bt_misc.c
index cba1c0c61aa..e2f0eb8f4cf 100644
--- a/src/btree/bt_misc.c
+++ b/src/btree/bt_misc.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_ovfl.c b/src/btree/bt_ovfl.c
index 4cd317f1e8f..d8456c5b61f 100644
--- a/src/btree/bt_ovfl.c
+++ b/src/btree/bt_ovfl.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -141,7 +142,7 @@ __ovfl_cache(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK *unpack)
WT_ERR(__wt_ovfl_txnc_add(
session, page, addr, addr_size, tmp->data, tmp->size));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c
index 799f0cca3ee..181ffdb3736 100644
--- a/src/btree/bt_page.c
+++ b/src/btree/bt_page.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -67,9 +68,10 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
{
WT_DECL_RET;
WT_PAGE *page;
+ u_int sleep_cnt, wait_cnt;
int busy, force_attempts, oldgen;
- for (force_attempts = oldgen = 0;;) {
+ for (force_attempts = oldgen = 0, wait_cnt = 0;;) {
switch (ref->state) {
case WT_REF_DISK:
case WT_REF_DELETED:
@@ -88,11 +90,14 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
case WT_REF_READING:
if (LF_ISSET(WT_READ_CACHE))
return (WT_NOTFOUND);
- /* FALLTHROUGH */
+ if (LF_ISSET(WT_READ_NO_WAIT))
+ return (WT_NOTFOUND);
+ WT_STAT_FAST_CONN_INCR(session, page_read_blocked);
+ break;
case WT_REF_LOCKED:
if (LF_ISSET(WT_READ_NO_WAIT))
return (WT_NOTFOUND);
- /* The page is busy -- wait. */
+ WT_STAT_FAST_CONN_INCR(session, page_locked_blocked);
break;
case WT_REF_SPLIT:
return (WT_RESTART);
@@ -109,8 +114,11 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
#else
WT_RET(__wt_hazard_set(session, ref, &busy));
#endif
- if (busy)
+ if (busy) {
+ WT_STAT_FAST_CONN_INCR(
+ session, page_busy_blocked);
break;
+ }
page = ref->page;
WT_ASSERT(session, page != NULL);
@@ -121,6 +129,8 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
__evict_force_check(session, page)) {
++force_attempts;
WT_RET(__wt_page_release(session, ref, flags));
+ WT_STAT_FAST_CONN_INCR(
+ session, page_forcible_evict_blocked);
break;
}
@@ -148,8 +158,19 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
WT_ILLEGAL_VALUE(session);
}
- /* We failed to get the page -- yield before retrying. */
- __wt_yield();
+ /*
+ * We failed to get the page -- yield before retrying, and if
+ * we've yielded enough times, start sleeping so we don't burn
+ * CPU to no purpose.
+ */
+ if (++wait_cnt < 1000)
+ __wt_yield();
+ else {
+ sleep_cnt = WT_MIN(wait_cnt, 10000);
+ wait_cnt *= 2;
+ WT_STAT_FAST_CONN_INCRV(session, page_sleep, sleep_cnt);
+ __wt_sleep(0, sleep_cnt);
+ }
}
}
@@ -622,7 +643,7 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep)
}
}
-err: __wt_scr_free(&current);
+err: __wt_scr_free(session, &current);
return (ret);
}
diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c
index 9cd6f8310af..6a564e74f3f 100644
--- a/src/btree/bt_read.c
+++ b/src/btree/bt_read.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_ret.c b/src/btree/bt_ret.c
index 25b4bfc3005..c37ff6dc809 100644
--- a/src/btree/bt_ret.c
+++ b/src/btree/bt_ret.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c
index 9d98d0db739..fbc3890f23b 100644
--- a/src/btree/bt_slvg.c
+++ b/src/btree/bt_slvg.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -341,8 +342,8 @@ err: WT_TRET(bm->salvage_end(bm, session));
WT_TRET(__slvg_cleanup(session, ss));
/* Discard temporary buffers. */
- __wt_scr_free(&ss->tmp1);
- __wt_scr_free(&ss->tmp2);
+ __wt_scr_free(session, &ss->tmp1);
+ __wt_scr_free(session, &ss->tmp2);
/* Wrap up reporting. */
WT_TRET(__wt_progress(session, NULL, ss->fcnt));
@@ -471,8 +472,8 @@ __slvg_read(WT_SESSION_IMPL *session, WT_STUFF *ss)
}
}
-err: __wt_scr_free(&as);
- __wt_scr_free(&buf);
+err: __wt_scr_free(session, &as);
+ __wt_scr_free(session, &buf);
return (ret);
}
@@ -1785,8 +1786,8 @@ __slvg_row_trk_update_start(
err: if (page != NULL)
__wt_page_out(session, &page);
- __wt_scr_free(&dsk);
- __wt_scr_free(&key);
+ __wt_scr_free(session, &dsk);
+ __wt_scr_free(session, &key);
return (ret);
}
@@ -2023,7 +2024,7 @@ __slvg_row_build_leaf(
if (0) {
err: WT_TRET(__wt_page_release(session, ref, 0));
}
- __wt_scr_free(&key);
+ __wt_scr_free(session, &key);
return (ret);
}
diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c
index a14e82d980d..911a38e4be6 100644
--- a/src/btree/bt_split.c
+++ b/src/btree/bt_split.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -716,15 +717,16 @@ __split_multi_inmem(
/*
* We modified the page above, which will have set the first dirty
* transaction to the last transaction current running. However, the
- * updates we installed may be older than that. Inherit the first
- * dirty transaction from the original page.
+ * updates we installed may be older than that. Set the first dirty
+ * transaction to an impossibly old value so this page is never skipped
+ * in a checkpoint.
*/
- page->modify->first_dirty_txn = orig->modify->first_dirty_txn;
+ page->modify->first_dirty_txn = WT_TXN_FIRST;
err: /* Free any resources that may have been cached in the cursor. */
WT_TRET(__wt_btcur_close(&cbt));
- __wt_scr_free(&key);
+ __wt_scr_free(session, &key);
return (ret);
}
@@ -1107,7 +1109,7 @@ __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref, int *splitp)
WT_ERR(__wt_row_ikey(
session, 0, key->data, key->size, &child->key.ikey));
- __wt_scr_free(&key);
+ __wt_scr_free(session, &key);
/*
* The second page in the split is a new WT_REF/page pair.
@@ -1136,10 +1138,11 @@ __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref, int *splitp)
/*
* We modified the page above, which will have set the first dirty
* transaction to the last transaction current running. However, the
- * updates we installed may be older than that. Inherit the first
- * dirty transaction from the original page.
+ * updates we installed may be older than that. Set the first dirty
+ * transaction to an impossibly old value so this page is never skipped
+ * in a checkpoint.
*/
- right->modify->first_dirty_txn = page->modify->first_dirty_txn;
+ right->modify->first_dirty_txn = WT_TXN_FIRST;
/*
* Calculate how much memory we're moving: figure out how deep the skip
@@ -1317,7 +1320,7 @@ err: if (split_ref[0] != NULL) {
}
if (right != NULL)
__wt_page_out(session, &right);
- __wt_scr_free(&key);
+ __wt_scr_free(session, &key);
return (ret);
}
diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c
index c08e9d9218b..d9ff2a6af1e 100644
--- a/src/btree/bt_stat.c
+++ b/src/btree/bt_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c
index 7e6493a9fbb..f038ebf3ecc 100644
--- a/src/btree/bt_sync.c
+++ b/src/btree/bt_sync.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_upgrade.c b/src/btree/bt_upgrade.c
index d65c8793fbb..6b403595ecc 100644
--- a/src/btree/bt_upgrade.c
+++ b/src/btree/bt_upgrade.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_vrfy.c b/src/btree/bt_vrfy.c
index 869fa2bb696..fafb4b58fc4 100644
--- a/src/btree/bt_vrfy.c
+++ b/src/btree/bt_vrfy.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -146,10 +147,10 @@ err: /* Inform the underlying block manager we're done. */
WT_TRET(__wt_progress(session, NULL, vs->fcnt));
/* Free allocated memory. */
- __wt_scr_free(&vs->max_key);
- __wt_scr_free(&vs->max_addr);
- __wt_scr_free(&vs->tmp1);
- __wt_scr_free(&vs->tmp2);
+ __wt_scr_free(session, &vs->max_key);
+ __wt_scr_free(session, &vs->max_addr);
+ __wt_scr_free(session, &vs->tmp1);
+ __wt_scr_free(session, &vs->tmp2);
return (ret);
}
diff --git a/src/btree/bt_vrfy_dsk.c b/src/btree/bt_vrfy_dsk.c
index 85eebad58e0..d6c300d200a 100644
--- a/src/btree/bt_vrfy_dsk.c
+++ b/src/btree/bt_vrfy_dsk.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -453,9 +454,9 @@ eof: ret = __err_eof(session, cell_num, addr);
err: if (ret == 0)
ret = WT_ERROR;
}
- __wt_scr_free(&current);
- __wt_scr_free(&last_pfx);
- __wt_scr_free(&last_ovfl);
+ __wt_scr_free(session, &current);
+ __wt_scr_free(session, &last_pfx);
+ __wt_scr_free(session, &last_ovfl);
return (ret);
}
diff --git a/src/btree/bt_walk.c b/src/btree/bt_walk.c
index ef35d215ec0..c74a7177401 100644
--- a/src/btree/bt_walk.c
+++ b/src/btree/bt_walk.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/col_modify.c b/src/btree/col_modify.c
index 3a4a2a2987d..2143325e2ab 100644
--- a/src/btree/col_modify.c
+++ b/src/btree/col_modify.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/col_srch.c b/src/btree/col_srch.c
index e4083e2282f..4c418f91de0 100644
--- a/src/btree/col_srch.c
+++ b/src/btree/col_srch.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/row_key.c b/src/btree/row_key.c
index 308bc1f0dc5..92cfd1e4273 100644
--- a/src/btree/row_key.c
+++ b/src/btree/row_key.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -64,8 +65,8 @@ __wt_row_leaf_keys(WT_SESSION_IMPL *session, WT_PAGE *page)
F_SET_ATOMIC(page, WT_PAGE_BUILD_KEYS);
-err: __wt_scr_free(&key);
- __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &key);
+ __wt_scr_free(session, &tmp);
return (ret);
}
@@ -456,7 +457,7 @@ next: switch (direction) {
}
done:
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/btree/row_modify.c b/src/btree/row_modify.c
index e7fb75dc8cb..136029f41aa 100644
--- a/src/btree/row_modify.c
+++ b/src/btree/row_modify.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/row_srch.c b/src/btree/row_srch.c
index b190aaaded5..036e11bec6d 100644
--- a/src/btree/row_srch.c
+++ b/src/btree/row_srch.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config.c b/src/config/config.c
index c33cae594da..751bbbd289b 100644
--- a/src/config/config.c
+++ b/src/config/config.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_api.c b/src/config/config_api.c
index 0c920af0d0e..d956b2d677d 100644
--- a/src/config/config_api.c
+++ b/src/config/config_api.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_check.c b/src/config/config_check.c
index 18300da8282..97f46e4211c 100644
--- a/src/config/config_check.c
+++ b/src/config/config_check.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_collapse.c b/src/config/config_collapse.c
index b914b485a46..f54e4fc2074 100644
--- a/src/config/config_collapse.c
+++ b/src/config/config_collapse.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -72,7 +73,7 @@ __wt_config_collapse(
--tmp->size;
ret = __wt_strndup(session, tmp->data, tmp->size, config_ret);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -196,8 +197,8 @@ __config_merge_scan(WT_SESSION_IMPL *session,
}
WT_ERR_NOTFOUND_OK(ret);
-err: __wt_scr_free(&kb);
- __wt_scr_free(&vb);
+err: __wt_scr_free(session, &kb);
+ __wt_scr_free(session, &vb);
return (ret);
}
@@ -305,7 +306,7 @@ __config_merge_format(
ret = __wt_strndup(session, build->data, build->size, config_ret);
-err: __wt_scr_free(&build);
+err: __wt_scr_free(session, &build);
return (ret);
}
diff --git a/src/config/config_concat.c b/src/config/config_concat.c
index 2faed21bfec..e872722a272 100644
--- a/src/config/config_concat.c
+++ b/src/config/config_concat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -66,6 +67,6 @@ __wt_config_concat(
--tmp->size;
ret = __wt_strndup(session, tmp->data, tmp->size, config_ret);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/config/config_def.c b/src/config/config_def.c
index e422f3cea6c..bf806ea6101 100644
--- a/src/config/config_def.c
+++ b/src/config/config_def.c
@@ -352,6 +352,7 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = {
{ "mmap", "boolean", NULL, NULL },
{ "multiprocess", "boolean", NULL, NULL },
{ "session_max", "int", "min=1", NULL },
+ { "session_scratch_max", "int", NULL, NULL },
{ "shared_cache", "category", NULL,
confchk_shared_cache_subconfigs },
{ "statistics", "list",
@@ -400,6 +401,7 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = {
{ "mmap", "boolean", NULL, NULL },
{ "multiprocess", "boolean", NULL, NULL },
{ "session_max", "int", "min=1", NULL },
+ { "session_scratch_max", "int", NULL, NULL },
{ "shared_cache", "category", NULL,
confchk_shared_cache_subconfigs },
{ "statistics", "list",
@@ -446,6 +448,7 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = {
{ "mmap", "boolean", NULL, NULL },
{ "multiprocess", "boolean", NULL, NULL },
{ "session_max", "int", "min=1", NULL },
+ { "session_scratch_max", "int", NULL, NULL },
{ "shared_cache", "category", NULL,
confchk_shared_cache_subconfigs },
{ "statistics", "list",
@@ -491,6 +494,7 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = {
{ "mmap", "boolean", NULL, NULL },
{ "multiprocess", "boolean", NULL, NULL },
{ "session_max", "int", "min=1", NULL },
+ { "session_scratch_max", "int", NULL, NULL },
{ "shared_cache", "category", NULL,
confchk_shared_cache_subconfigs },
{ "statistics", "list",
@@ -554,7 +558,7 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"error_prefix=,eviction=(threads_max=1,threads_min=1),"
"eviction_dirty_target=80,eviction_target=80,eviction_trigger=95,"
"lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,"
- "shared_cache=(chunk=10MB,name=none,reserve=0,size=500MB),"
+ "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
"statistics=none,statistics_log=(on_close=0,"
"path=\"WiredTigerStat.%d.%H\",sources=,"
"timestamp=\"%b %d %H:%M:%S\",wait=0),verbose=",
@@ -677,11 +681,12 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"file_extend=,hazard_max=1000,log=(archive=,compressor=,enabled=0"
",file_max=100MB,path=,prealloc=),lsm_manager=(merge=,"
"worker_thread_max=4),lsm_merge=,mmap=,multiprocess=0,"
- "session_max=100,shared_cache=(chunk=10MB,name=none,reserve=0,"
- "size=500MB),statistics=none,statistics_log=(on_close=0,"
- "path=\"WiredTigerStat.%d.%H\",sources=,"
- "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
- ",method=fsync),use_environment_priv=0,verbose=",
+ "session_max=100,session_scratch_max=2MB,shared_cache=(chunk=10MB"
+ ",name=,reserve=0,size=500MB),statistics=none,"
+ "statistics_log=(on_close=0,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
},
{ "wiredtiger_open_all",
@@ -694,12 +699,12 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"file_extend=,hazard_max=1000,log=(archive=,compressor=,enabled=0"
",file_max=100MB,path=,prealloc=),lsm_manager=(merge=,"
"worker_thread_max=4),lsm_merge=,mmap=,multiprocess=0,"
- "session_max=100,shared_cache=(chunk=10MB,name=none,reserve=0,"
- "size=500MB),statistics=none,statistics_log=(on_close=0,"
- "path=\"WiredTigerStat.%d.%H\",sources=,"
- "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
- ",method=fsync),use_environment_priv=0,verbose=,version=(major=0,"
- "minor=0)",
+ "session_max=100,session_scratch_max=2MB,shared_cache=(chunk=10MB"
+ ",name=,reserve=0,size=500MB),statistics=none,"
+ "statistics_log=(on_close=0,path=\"WiredTigerStat.%d.%H\","
+ "sources=,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
},
{ "wiredtiger_open_basecfg",
@@ -711,12 +716,12 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"extensions=,file_extend=,hazard_max=1000,log=(archive=,"
"compressor=,enabled=0,file_max=100MB,path=,prealloc=),"
"lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,mmap=,"
- "multiprocess=0,session_max=100,shared_cache=(chunk=10MB,"
- "name=none,reserve=0,size=500MB),statistics=none,"
- "statistics_log=(on_close=0,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)",
+ "multiprocess=0,session_max=100,session_scratch_max=2MB,"
+ "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
+ "statistics=none,statistics_log=(on_close=0,"
+ "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
},
{ "wiredtiger_open_usercfg",
@@ -728,11 +733,12 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"extensions=,file_extend=,hazard_max=1000,log=(archive=,"
"compressor=,enabled=0,file_max=100MB,path=,prealloc=),"
"lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,mmap=,"
- "multiprocess=0,session_max=100,shared_cache=(chunk=10MB,"
- "name=none,reserve=0,size=500MB),statistics=none,"
- "statistics_log=(on_close=0,path=\"WiredTigerStat.%d.%H\","
- "sources=,timestamp=\"%b %d %H:%M:%S\",wait=0),"
- "transaction_sync=(enabled=0,method=fsync),verbose=",
+ "multiprocess=0,session_max=100,session_scratch_max=2MB,"
+ "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
+ "statistics=none,statistics_log=(on_close=0,"
+ "path=\"WiredTigerStat.%d.%H\",sources=,"
+ "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
+ ",method=fsync),verbose=",
confchk_wiredtiger_open_usercfg
},
{ NULL, NULL, NULL }
diff --git a/src/config/config_ext.c b/src/config/config_ext.c
index 26b3799d61c..5102f354b02 100644
--- a/src/config/config_ext.c
+++ b/src/config/config_ext.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_upgrade.c b/src/config/config_upgrade.c
index 24297df839b..0bca1392b51 100644
--- a/src/config/config_upgrade.c
+++ b/src/config/config_upgrade.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/api_strerror.c b/src/conn/api_strerror.c
index caf536b24f7..396ae7a3e0f 100644
--- a/src/conn/api_strerror.c
+++ b/src/conn/api_strerror.c
@@ -3,18 +3,22 @@
#include "wt_internal.h"
/*
- * wiredtiger_strerror --
- * Return a string for any error value.
+ * Historically, there was only the wiredtiger_strerror call because the POSIX
+ * port didn't need anything more complex; Windows requires memory allocation
+ * of error strings, so we added the wiredtiger_strerror_r call. Because we
+ * want wiredtiger_strerror to continue to be as thread-safe as possible, errors
+ * are split into three categories: WiredTiger constant strings, system constant
+ * strings and Everything Else, and we check constant strings before Everything
+ * Else.
*/
-const char *
-wiredtiger_strerror(int error)
-{
- static char errbuf[64];
- char *p;
-
- if (error == 0)
- return ("Successful return: 0");
+/*
+ * __wiredtiger_error --
+ * Return a constant string for the WiredTiger errors.
+ */
+static const char *
+__wiredtiger_error(int error)
+{
switch (error) {
case WT_ROLLBACK:
return ("WT_ROLLBACK: conflict between concurrent operations");
@@ -28,16 +32,49 @@ wiredtiger_strerror(int error)
return ("WT_PANIC: WiredTiger library panic");
case WT_RESTART:
return ("WT_RESTART: restart the operation (internal)");
- default:
- if (error > 0 && (p = strerror(error)) != NULL)
- return (p);
- break;
}
+ return (NULL);
+}
+
+/*
+ * wiredtiger_strerror --
+ * Return a string for any error value, non-thread-safe version.
+ */
+const char *
+wiredtiger_strerror(int error)
+{
+ static char buf[128];
+ const char *p;
+
+ /* Check for a constant string. */
+ if ((p = __wiredtiger_error(error)) != NULL ||
+ (p = __wt_strerror(error)) != NULL)
+ return (p);
+
+ /* Else, fill in the non-thread-safe static buffer. */
+ if (wiredtiger_strerror_r(error, buf, sizeof(buf)) != 0)
+ (void)snprintf(buf, sizeof(buf), "error return: %d", error);
+
+ return (buf);
+}
+
+/*
+ * wiredtiger_strerror_r --
+ * Return a string for any error value, thread-safe version.
+ */
+int
+wiredtiger_strerror_r(int error, char *buf, size_t buflen)
+{
+ const char *p;
+
+ /* Require at least 2 bytes, printable character and trailing nul. */
+ if (buflen < 2)
+ return (ENOMEM);
+
+ /* Check for a constant string. */
+ if ((p = __wiredtiger_error(error)) != NULL ||
+ (p = __wt_strerror(error)) != NULL)
+ return (snprintf(buf, buflen, "%s", p) > 0 ? 0 : ENOMEM);
- /*
- * !!!
- * Not thread-safe, but this is never supposed to happen.
- */
- (void)snprintf(errbuf, sizeof(errbuf), "Unknown error: %d", error);
- return (errbuf);
+ return (__wt_strerror_r(error, buf, buflen));
}
diff --git a/src/conn/api_version.c b/src/conn/api_version.c
index 1355220c585..6293d221417 100644
--- a/src/conn/api_version.c
+++ b/src/conn/api_version.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c
index c878024edb4..5be55a77f24 100644
--- a/src/conn/conn_api.c
+++ b/src/conn/conn_api.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -263,8 +264,8 @@ __conn_load_extensions(WT_SESSION_IMPL *session, const char *cfg[])
}
WT_ERR_NOTFOUND_OK(ret);
-err: __wt_scr_free(&expath);
- __wt_scr_free(&exconfig);
+err: __wt_scr_free(session, &expath);
+ __wt_scr_free(session, &exconfig);
return (ret);
}
@@ -1576,6 +1577,9 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
WT_ERR(__wt_config_gets(session, cfg, "session_max", &cval));
conn->session_size = (uint32_t)cval.val + WT_NUM_INTERNAL_SESSIONS;
+ WT_ERR(__wt_config_gets(session, cfg, "session_scratch_max", &cval));
+ conn->session_scratch_max = (size_t)cval.val;
+
WT_ERR(__wt_config_gets(session, cfg, "checkpoint_sync", &cval));
if (cval.val)
F_SET(conn, WT_CONN_CKPT_SYNC);
diff --git a/src/conn/conn_cache.c b/src/conn/conn_cache.c
index 61bd4447abf..91f82a5105b 100644
--- a/src/conn/conn_cache.c
+++ b/src/conn/conn_cache.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -143,6 +144,8 @@ __wt_cache_stats_update(WT_SESSION_IMPL *session)
WT_STAT_SET(stats, cache_bytes_inuse, __wt_cache_bytes_inuse(cache));
WT_STAT_SET(stats, cache_pages_inuse, __wt_cache_pages_inuse(cache));
WT_STAT_SET(stats, cache_bytes_dirty, cache->bytes_dirty);
+ WT_STAT_SET(stats,
+ cache_eviction_maximum_page_size, cache->evict_max_page_size);
WT_STAT_SET(stats, cache_pages_dirty, cache->pages_dirty);
}
diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c
index edd6f01d52c..861bafed900 100644
--- a/src/conn/conn_cache_pool.c
+++ b/src/conn/conn_cache_pool.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_ckpt.c b/src/conn/conn_ckpt.c
index 40b103d6f24..fa3dfacad7e 100644
--- a/src/conn/conn_ckpt.c
+++ b/src/conn/conn_ckpt.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -60,7 +61,7 @@ __ckpt_server_config(WT_SESSION_IMPL *session, const char **cfg, int *startp)
conn->ckpt_config = p;
}
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index 184fac26d7c..8ed656d6416 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_handle.c b/src/conn/conn_handle.c
index a29453b962a..69d0f0fcba7 100644
--- a/src/conn/conn_handle.c
+++ b/src/conn/conn_handle.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c
index a0e46c96291..2799a58f327 100644
--- a/src/conn/conn_log.c
+++ b/src/conn/conn_log.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -223,7 +224,7 @@ __log_prealloc_once(WT_SESSION_IMPL *session)
*/
for (i = reccount; i < (u_int)conn->log_prealloc; i++) {
WT_ERR(__wt_log_allocfile(
- session, ++log->prep_fileid, WT_LOG_PREPNAME));
+ session, ++log->prep_fileid, WT_LOG_PREPNAME, 1));
WT_STAT_FAST_CONN_INCR(session, log_prealloc_files);
}
@@ -328,7 +329,7 @@ err: __wt_err(session, ret, "log archive server error");
/*
* __wt_logmgr_create --
- * Start the log subsystem and archive server thread.
+ * Initialize the log subsystem (before running recovery).
*/
int
__wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[])
@@ -362,24 +363,39 @@ __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[])
WT_MAX((uint32_t)conn->buffer_alignment, LOG_ALIGN);
else
log->allocsize = LOG_ALIGN;
- INIT_LSN(&log->alloc_lsn);
- INIT_LSN(&log->ckpt_lsn);
- INIT_LSN(&log->first_lsn);
- INIT_LSN(&log->sync_lsn);
+ WT_INIT_LSN(&log->alloc_lsn);
+ WT_INIT_LSN(&log->ckpt_lsn);
+ WT_INIT_LSN(&log->first_lsn);
+ WT_INIT_LSN(&log->sync_lsn);
/*
* We only use file numbers for directory sync, so this needs to
* initialized to zero.
*/
- ZERO_LSN(&log->sync_dir_lsn);
- INIT_LSN(&log->trunc_lsn);
- INIT_LSN(&log->write_lsn);
+ WT_ZERO_LSN(&log->sync_dir_lsn);
+ WT_INIT_LSN(&log->trunc_lsn);
+ WT_INIT_LSN(&log->write_lsn);
log->fileid = 0;
WT_RET(__wt_cond_alloc(session, "log sync", 0, &log->log_sync_cond));
WT_RET(__wt_log_open(session));
WT_RET(__wt_log_slot_init(session));
+ return (0);
+}
+
+/*
+ * __wt_logmgr_open --
+ * Start the log subsystem and archive server thread.
+ */
+int
+__wt_logmgr_open(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+
+ conn = S2C(session);
+
/* If no log thread services are configured, we're done. */
- if (!FLD_ISSET(conn->log_flags,
+ if (!FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED) ||
+ !FLD_ISSET(conn->log_flags,
(WT_CONN_LOG_ARCHIVE | WT_CONN_LOG_PREALLOC)))
return (0);
diff --git a/src/conn/conn_open.c b/src/conn/conn_open.c
index 97ced7d5263..b425376d6ae 100644
--- a/src/conn/conn_open.c
+++ b/src/conn/conn_open.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -241,12 +242,17 @@ __wt_connection_workers(WT_SESSION_IMPL *session, const char *cfg[])
/* Start the optional async threads. */
WT_RET(__wt_async_create(session, cfg));
+ WT_RET(__wt_logmgr_create(session, cfg));
+
+ /* Run recovery. */
+ WT_RET(__wt_txn_recover(session));
+
/*
* Start the optional logging/archive thread.
* NOTE: The log manager must be started before checkpoints so that the
* checkpoint server knows if logging is enabled.
*/
- WT_RET(__wt_logmgr_create(session, cfg));
+ WT_RET(__wt_logmgr_open(session));
/* Start the optional checkpoint thread. */
WT_RET(__wt_checkpoint_server_create(session, cfg));
diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c
index d296b58780e..2d8395c0517 100644
--- a/src/conn/conn_stat.c
+++ b/src/conn/conn_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -180,7 +181,7 @@ __statlog_dump(WT_SESSION_IMPL *session, const char *name, int conn_stats)
break;
}
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -371,7 +372,7 @@ __wt_statlog_log_one(WT_SESSION_IMPL *session)
WT_RET(__wt_scr_alloc(session, strlen(conn->stat_path) + 128, &tmp));
WT_ERR(__statlog_log_one(session, NULL, tmp));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c
index 5916043e44f..01f08aa5f07 100644
--- a/src/conn/conn_sweep.c
+++ b/src/conn/conn_sweep.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c
index 9c5884a475f..d43b649041f 100644
--- a/src/cursor/cur_backup.c
+++ b/src/cursor/cur_backup.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -448,7 +449,7 @@ __backup_uri(WT_SESSION_IMPL *session,
}
WT_ERR_NOTFOUND_OK(ret);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/cursor/cur_bulk.c b/src/cursor/cur_bulk.c
index 96a45a7e629..b38821f99ff 100644
--- a/src/cursor/cur_bulk.c
+++ b/src/cursor/cur_bulk.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -126,8 +127,8 @@ __bulk_row_keycmp_err(WT_CURSOR_BULK *cbulk)
(int)a->size, (const char *)a->data,
(int)b->size, (const char *)b->data);
-err: __wt_scr_free(&a);
- __wt_scr_free(&b);
+err: __wt_scr_free(session, &a);
+ __wt_scr_free(session, &b);
return (ret);
}
diff --git a/src/cursor/cur_config.c b/src/cursor/cur_config.c
index b37736d1b43..99ccfe66a92 100644
--- a/src/cursor/cur_config.c
+++ b/src/cursor/cur_config.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_ds.c b/src/cursor/cur_ds.c
index f16cc9b33f0..fb63d6ebb43 100644
--- a/src/cursor/cur_ds.c
+++ b/src/cursor/cur_ds.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -478,7 +479,6 @@ __wt_curds_open(
cursor = &data_source->iface;
*cursor = iface;
cursor->session = &session->iface;
- F_SET(cursor, WT_CURSTD_DATA_SOURCE);
/*
* XXX
diff --git a/src/cursor/cur_dump.c b/src/cursor/cur_dump.c
index 55b47d13a6d..dde08b5a43d 100644
--- a/src/cursor/cur_dump.c
+++ b/src/cursor/cur_dump.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_file.c b/src/cursor/cur_file.c
index c833dfa0677..c46f3cd6f62 100644
--- a/src/cursor/cur_file.c
+++ b/src/cursor/cur_file.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_index.c b/src/cursor/cur_index.c
index 2b31f75cf08..08ba53d76c4 100644
--- a/src/cursor/cur_index.c
+++ b/src/cursor/cur_index.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -443,6 +444,6 @@ err: WT_TRET(__curindex_close(cursor));
*cursorp = NULL;
}
- __wt_scr_free(&tmp);
+ __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/cursor/cur_json.c b/src/cursor/cur_json.c
index f4459819259..67daf377f88 100644
--- a/src/cursor/cur_json.c
+++ b/src/cursor/cur_json.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_log.c b/src/cursor/cur_log.c
index 0d375ee4a52..c0cc038a119 100644
--- a/src/cursor/cur_log.c
+++ b/src/cursor/cur_log.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -12,12 +13,13 @@
* Callback function from log_scan to get a log record.
*/
static int
-__curlog_logrec(
- WT_SESSION_IMPL *session, WT_ITEM *logrec, WT_LSN *lsnp, void *cookie)
+__curlog_logrec(WT_SESSION_IMPL *session,
+ WT_ITEM *logrec, WT_LSN *lsnp, void *cookie, int firstrecord)
{
WT_CURSOR_LOG *cl;
cl = cookie;
+ WT_UNUSED(firstrecord);
/* Set up the LSNs and take a copy of the log record for the cursor. */
*cl->cur_lsn = *lsnp;
@@ -148,6 +150,7 @@ static int
__curlog_kv(WT_SESSION_IMPL *session, WT_CURSOR *cursor)
{
WT_CURSOR_LOG *cl;
+ WT_ITEM item;
uint32_t fileid, key_count, opsize, optype;
cl = (WT_CURSOR_LOG *)cursor;
@@ -178,11 +181,37 @@ __curlog_kv(WT_SESSION_IMPL *session, WT_CURSOR *cursor)
* The log cursor sets the LSN and step count as the cursor key and
* and log record related data in the value. The data in the value
* contains any operation key/value that was in the log record.
+ * For the special case that the caller needs the result in raw form,
+ * we create packed versions of the key/value.
*/
- __wt_cursor_set_key(cursor, cl->cur_lsn->file, cl->cur_lsn->offset,
- key_count);
- __wt_cursor_set_value(cursor, cl->txnid, cl->rectype, optype,
- fileid, cl->opkey, cl->opvalue);
+ if (FLD_ISSET(cursor->flags, WT_CURSTD_RAW)) {
+ memset(&item, 0, sizeof(item));
+ WT_RET(wiredtiger_struct_size((WT_SESSION *)session,
+ &item.size, LOGC_KEY_FORMAT, cl->cur_lsn->file,
+ cl->cur_lsn->offset, key_count));
+ WT_RET(__wt_realloc(session, NULL, item.size, &cl->packed_key));
+ item.data = cl->packed_key;
+ WT_RET(wiredtiger_struct_pack((WT_SESSION *)session,
+ cl->packed_key, item.size, LOGC_KEY_FORMAT,
+ cl->cur_lsn->file, cl->cur_lsn->offset, key_count));
+ __wt_cursor_set_key(cursor, &item);
+
+ WT_RET(wiredtiger_struct_size((WT_SESSION *)session,
+ &item.size, LOGC_VALUE_FORMAT, cl->txnid, cl->rectype,
+ optype, fileid, cl->opkey, cl->opvalue));
+ WT_RET(__wt_realloc(session, NULL, item.size,
+ &cl->packed_value));
+ item.data = cl->packed_value;
+ WT_RET(wiredtiger_struct_pack((WT_SESSION *)session,
+ cl->packed_value, item.size, LOGC_VALUE_FORMAT, cl->txnid,
+ cl->rectype, optype, fileid, cl->opkey, cl->opvalue));
+ __wt_cursor_set_value(cursor, &item);
+ } else {
+ __wt_cursor_set_key(cursor, cl->cur_lsn->file,
+ cl->cur_lsn->offset, key_count);
+ __wt_cursor_set_value(cursor, cl->txnid, cl->rectype, optype,
+ fileid, cl->opkey, cl->opvalue);
+ }
return (0);
}
@@ -263,8 +292,8 @@ __curlog_reset(WT_CURSOR *cursor)
cl = (WT_CURSOR_LOG *)cursor;
cl->stepp = cl->stepp_end = NULL;
cl->step_count = 0;
- INIT_LSN(cl->cur_lsn);
- INIT_LSN(cl->next_lsn);
+ WT_INIT_LSN(cl->cur_lsn);
+ WT_INIT_LSN(cl->next_lsn);
return (0);
}
@@ -290,9 +319,11 @@ __curlog_close(WT_CURSOR *cursor)
WT_TRET(__curlog_reset(cursor));
__wt_free(session, cl->cur_lsn);
__wt_free(session, cl->next_lsn);
- __wt_scr_free(&cl->logrec);
- __wt_scr_free(&cl->opkey);
- __wt_scr_free(&cl->opvalue);
+ __wt_scr_free(session, &cl->logrec);
+ __wt_scr_free(session, &cl->opkey);
+ __wt_scr_free(session, &cl->opvalue);
+ __wt_free(session, cl->packed_key);
+ __wt_free(session, cl->packed_value);
WT_TRET(__wt_cursor_close(cursor));
err: API_END_RET(session, ret);
@@ -348,8 +379,8 @@ __wt_curlog_open(WT_SESSION_IMPL *session,
cursor->key_format = LOGC_KEY_FORMAT;
cursor->value_format = LOGC_VALUE_FORMAT;
- INIT_LSN(cl->cur_lsn);
- INIT_LSN(cl->next_lsn);
+ WT_INIT_LSN(cl->cur_lsn);
+ WT_INIT_LSN(cl->next_lsn);
WT_ERR(__wt_cursor_init(cursor, uri, NULL, cfg, cursorp));
@@ -362,9 +393,9 @@ err: if (F_ISSET(cursor, WT_CURSTD_OPEN))
else {
__wt_free(session, cl->cur_lsn);
__wt_free(session, cl->next_lsn);
- __wt_scr_free(&cl->logrec);
- __wt_scr_free(&cl->opkey);
- __wt_scr_free(&cl->opvalue);
+ __wt_scr_free(session, &cl->logrec);
+ __wt_scr_free(session, &cl->opkey);
+ __wt_scr_free(session, &cl->opvalue);
/*
* NOTE: We cannot get on the error path with the
* readlock held. No need to unlock it unless that
diff --git a/src/cursor/cur_metadata.c b/src/cursor/cur_metadata.c
index a24c3289a7c..ae92a6ee371 100644
--- a/src/cursor/cur_metadata.c
+++ b/src/cursor/cur_metadata.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c
index 74237c6ffdc..6aefbc47307 100644
--- a/src/cursor/cur_stat.c
+++ b/src/cursor/cur_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_std.c b/src/cursor/cur_std.c
index f0eb5a4ec73..176e9d9efdf 100644
--- a/src/cursor/cur_std.c
+++ b/src/cursor/cur_std.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_table.c b/src/cursor/cur_table.c
index d994c44357f..6a02dda65f5 100644
--- a/src/cursor/cur_table.c
+++ b/src/cursor/cur_table.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -580,7 +581,7 @@ __curtable_update(WT_CURSOR *cursor)
WT_ERR(__apply_idx(ctable, offsetof(WT_CURSOR, insert), 1));
err: CURSOR_UPDATE_API_END(session, ret);
- __wt_scr_free(&value_copy);
+ __wt_scr_free(session, &value_copy);
return (ret);
}
@@ -689,7 +690,7 @@ __wt_table_range_truncate(WT_CURSOR_TABLE *start, WT_CURSOR_TABLE *stop)
(start == NULL) ? NULL : start->cg_cursors[i],
(stop == NULL) ? NULL : stop->cg_cursors[i]));
-err: __wt_scr_free(&key);
+err: __wt_scr_free(session, &key);
return (ret);
}
@@ -726,9 +727,11 @@ __curtable_close(WT_CURSOR *cursor)
if (ctable->plan != ctable->table->plan)
__wt_free(session, ctable->plan);
- for (i = 0; ctable->cfg[i] != NULL; ++i)
- __wt_free(session, ctable->cfg[i]);
- __wt_free(session, ctable->cfg);
+ if (ctable->cfg != NULL) {
+ for (i = 0; ctable->cfg[i] != NULL; ++i)
+ __wt_free(session, ctable->cfg[i]);
+ __wt_free(session, ctable->cfg);
+ }
if (cursor->value_format != ctable->table->value_format)
__wt_free(session, cursor->value_format);
__wt_free(session, ctable->cg_cursors);
@@ -962,6 +965,6 @@ err: WT_TRET(__curtable_close(cursor));
*cursorp = NULL;
}
- __wt_scr_free(&tmp);
+ __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/docs/build-javadoc.sh b/src/docs/build-javadoc.sh
index fa2a21efd3f..39c9d989b6c 100755
--- a/src/docs/build-javadoc.sh
+++ b/src/docs/build-javadoc.sh
@@ -8,5 +8,5 @@ CLASSPATH=$THRIFT_HOME/libthrift.jar:$SLF4J_JAR javadoc -public -d $DOCS/java \
-stylesheetfile $DOCS/style/javadoc.css \
-use -link http://java.sun.com/j2se/1.5.0/docs/api/ \
-header '<b>WiredTiger API</b><br><font size="-1"> version '$WT_VERSION'</font>' \
- -windowtitle 'WiredTiger Java API' -bottom '<font size=1>Copyright (c) 2008-2014 WiredTiger, Inc. All rights reserved.</font>' \
+ -windowtitle 'WiredTiger Java API' -bottom '<font size=1>Copyright (c) 2008-2015 MongoDB, Inc. All rights reserved.</font>' \
com.wiredtiger com.wiredtiger.util
diff --git a/src/docs/command-line.dox b/src/docs/command-line.dox
index 230561a5ead..ea83b3f58be 100644
--- a/src/docs/command-line.dox
+++ b/src/docs/command-line.dox
@@ -295,14 +295,14 @@ The \c stat command outputs run-time statistics for the WiredTiger
engine, or, if specified, for the URI on the command-line.
@subsection util_stat_synopsis Synopsis
-<code>wt [-Vv] [-C config] [-h directory] stat [-a] [uri]</code>
+<code>wt [-Vv] [-C config] [-h directory] stat [-f] [uri]</code>
@subsection util_stat_options Options
The following are command-specific options for the \c stat command:
-@par <code>-a</code>
-Include all statistics in the output (equivalent to passing
-<code>statistics=(all)</code>) to WT_SESSION::open_cursor.
+@par <code>-f</code>
+Include only "fast" statistics in the output (equivalent to passing
+<code>statistics=(fast)</code>) to WT_SESSION::open_cursor.
<hr>
@section util_upgrade wt upgrade
diff --git a/src/docs/style/footer.html b/src/docs/style/footer.html
index 47a814860da..83f1254fa42 100644
--- a/src/docs/style/footer.html
+++ b/src/docs/style/footer.html
@@ -3,13 +3,13 @@
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
- <li class="footer">Copyright (c) 2008-2014 WiredTiger, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.</li>
+ <li class="footer">Copyright (c) 2008-2015 MongoDB, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.</li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
-Copyright (c) 2008-2014 WiredTiger, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.
+Copyright (c) 2008-2015 MongoDB, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
diff --git a/src/docs/tools/doxfilter.py b/src/docs/tools/doxfilter.py
index d98a106ad3d..8ca68c0a1fe 100755
--- a/src/docs/tools/doxfilter.py
+++ b/src/docs/tools/doxfilter.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/src/docs/tools/fixlinks.py b/src/docs/tools/fixlinks.py
index cad28944ca8..84f56d219f8 100755
--- a/src/docs/tools/fixlinks.py
+++ b/src/docs/tools/fixlinks.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/src/docs/top/main.dox b/src/docs/top/main.dox
index 7fd04457ec9..9b3e5fe48f8 100644
--- a/src/docs/top/main.dox
+++ b/src/docs/top/main.dox
@@ -6,12 +6,12 @@ WiredTiger is an high performance, scalable, production quality, NoSQL,
@section releases Releases
<table>
-@row{<b>WiredTiger 2.4.1</b> (current),
+@row{<b>WiredTiger 2.5.0</b> (current),
+ <a href="releases/wiredtiger-2.5.0.tar.bz2"><b>[Release package]</b></a>,
+ <a href="2.5.0/index.html"><b>[Documentation]</b></a>}
+@row{<b>WiredTiger 2.4.1</b> (previous),
<a href="releases/wiredtiger-2.4.1.tar.bz2"><b>[Release package]</b></a>,
<a href="2.4.1/index.html"><b>[Documentation]</b></a>}
-@row{<b>WiredTiger 2.3.1</b> (previous),
- <a href="releases/wiredtiger-2.3.1.tar.bz2"><b>[Release package]</b></a>,
- <a href="2.3.1/index.html"><b>[Documentation]</b></a>}
@row{<b>Development branch</b>,
<a href="https://github.com/wiredtiger/wiredtiger"><b>[Source code]</b></a>,
<a href="develop/index.html"><b>[Documentation]</b></a>}
diff --git a/src/docs/upgrading.dox b/src/docs/upgrading.dox
index 0fb858643fd..49f112a0bb2 100644
--- a/src/docs/upgrading.dox
+++ b/src/docs/upgrading.dox
@@ -1,6 +1,6 @@
/*! @page upgrading Upgrading WiredTiger applications
-@section version_242 Upgrading to Version 2.4.2
+@section version_250 Upgrading to Version 2.5.0
<dl>
<dt>WT_STAT_CONN_LOG_BYTES_USER renamed WT_STAT_CONN_LOG_BYTES_PAYLOAD</dt>
diff --git a/src/evict/evict_file.c b/src/evict/evict_file.c
index 0750135dcec..553acc988f0 100644
--- a/src/evict/evict_file.c
+++ b/src/evict/evict_file.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 69fa1f85c93..60a5f82f233 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c
index 4e96898fd92..b3a6f718ca2 100644
--- a/src/evict/evict_page.c
+++ b/src/evict/evict_page.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -20,12 +21,15 @@ static void __evict_excl_clear(WT_SESSION_IMPL *);
int
__wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive)
{
+ WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
WT_PAGE *page;
WT_PAGE_MODIFY *mod;
WT_TXN_STATE *txn_state;
int forced_eviction, inmem_split, istree;
+ conn = S2C(session);
+
page = ref->page;
forced_eviction = (page->read_gen == WT_READGEN_OLDEST);
inmem_split = istree = 0;
@@ -39,7 +43,7 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive)
*/
txn_state = WT_SESSION_TXN_STATE(session);
if (txn_state->snap_min == WT_TXN_NONE)
- txn_state->snap_min = S2C(session)->txn_global.oldest_id;
+ txn_state->snap_min = conn->txn_global.oldest_id;
else
txn_state = NULL;
@@ -74,6 +78,14 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive)
WT_STAT_FAST_DATA_INCR(session, cache_eviction_internal);
}
+ /*
+ * Track the largest page size seen at eviction, it tells us something
+ * about our ability to force pages out before they're larger than the
+ * cache.
+ */
+ if (page->memory_footprint > conn->cache->evict_max_page_size)
+ conn->cache->evict_max_page_size = page->memory_footprint;
+
/* Discard any subtree rooted in this page. */
if (istree)
WT_WITH_PAGE_INDEX(session,
@@ -118,8 +130,8 @@ done: session->excl_next = 0;
txn_state->snap_min = WT_TXN_NONE;
if ((inmem_split || (forced_eviction && ret == EBUSY)) &&
- !F_ISSET(S2C(session)->cache, WT_EVICT_WOULD_BLOCK)) {
- F_SET(S2C(session)->cache, WT_EVICT_WOULD_BLOCK);
+ !F_ISSET(conn->cache, WT_EVICT_WOULD_BLOCK)) {
+ F_SET(conn->cache, WT_EVICT_WOULD_BLOCK);
WT_TRET(__wt_evict_server_wake(session));
}
diff --git a/src/include/api.h b/src/include/api.h
index 1362f65750d..e610b3b3e1b 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/async.h b/src/include/async.h
index 8565874c2f3..88ecad6eb2c 100644
--- a/src/include/async.h
+++ b/src/include/async.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/bitstring.i b/src/include/bitstring.i
index 95af6731bf9..c548c12761d 100644
--- a/src/include/bitstring.i
+++ b/src/include/bitstring.i
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/include/block.h b/src/include/block.h
index 10fa51243ac..f4677236d8b 100644
--- a/src/include/block.h
+++ b/src/include/block.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/bloom.h b/src/include/bloom.h
index baf7ec72f47..a673ee9add2 100644
--- a/src/include/bloom.h
+++ b/src/include/bloom.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/btmem.h b/src/include/btmem.h
index 72feb3dce8f..e1fc72677c5 100644
--- a/src/include/btmem.h
+++ b/src/include/btmem.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/btree.h b/src/include/btree.h
index e7c1826bda9..fa01dd5edc2 100644
--- a/src/include/btree.h
+++ b/src/include/btree.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/btree.i b/src/include/btree.i
index 6c42155fefb..a333e4af565 100644
--- a/src/include/btree.i
+++ b/src/include/btree.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/buf.i b/src/include/buf.i
index 09bee9ff831..b8849396f01 100644
--- a/src/include/buf.i
+++ b/src/include/buf.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -119,13 +120,20 @@ __wt_buf_free(WT_SESSION_IMPL *session, WT_ITEM *buf)
* Release a scratch buffer.
*/
static inline void
-__wt_scr_free(WT_ITEM **bufp)
+__wt_scr_free(WT_SESSION_IMPL *session, WT_ITEM **bufp)
{
WT_ITEM *buf;
if ((buf = *bufp) != NULL) {
*bufp = NULL;
+ if (session->scratch_cached + buf->memsize >=
+ S2C(session)->session_scratch_max) {
+ __wt_free(session, buf->mem);
+ buf->memsize = 0;
+ } else
+ session->scratch_cached += buf->memsize;
+
buf->data = NULL;
buf->size = 0;
F_CLR(buf, WT_ITEM_INUSE);
diff --git a/src/include/cache.h b/src/include/cache.h
index cf688b3993f..deccd676e26 100644
--- a/src/include/cache.h
+++ b/src/include/cache.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -60,6 +61,8 @@ struct __wt_cache {
uint64_t bytes_dirty; /* Bytes/pages currently dirty */
uint64_t pages_dirty;
+ uint64_t evict_max_page_size; /* Largest page seen at eviction */
+
/*
* Read information.
*/
diff --git a/src/include/cache.i b/src/include/cache.i
index 9c444fae1ee..b997781272a 100644
--- a/src/include/cache.i
+++ b/src/include/cache.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/cell.i b/src/include/cell.i
index 42c7c07a30c..77e9fa1e3c1 100644
--- a/src/include/cell.i
+++ b/src/include/cell.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/column.i b/src/include/column.i
index 42c3664323d..bf12a48a3e4 100644
--- a/src/include/column.i
+++ b/src/include/column.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/compact.h b/src/include/compact.h
index aa34eab4d24..0698bf7b1a4 100644
--- a/src/include/compact.h
+++ b/src/include/compact.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/config.h b/src/include/config.h
index 27872fc7c4a..65757c2ef6d 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/connection.h b/src/include/connection.h
index 82b6b78f52b..c8a3ae6e291 100644
--- a/src/include/connection.h
+++ b/src/include/connection.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -186,6 +187,8 @@ struct __wt_connection_impl {
uint32_t session_size; /* Session array size */
uint32_t session_cnt; /* Session count */
+ size_t session_scratch_max; /* Max scratch memory per session */
+
/*
* WiredTiger allocates space for a fixed number of hazard pointers
* in each thread of control.
@@ -273,7 +276,8 @@ struct __wt_connection_impl {
#define WT_CONN_LOG_ARCHIVE 0x01 /* Archive is enabled */
#define WT_CONN_LOG_ENABLED 0x02 /* Logging is enabled */
-#define WT_CONN_LOG_PREALLOC 0x04 /* Pre-allocation is enabled */
+#define WT_CONN_LOG_EXISTED 0x04 /* Log files found */
+#define WT_CONN_LOG_PREALLOC 0x08 /* Pre-allocation is enabled */
uint32_t log_flags; /* Global logging configuration */
WT_CONDVAR *log_cond; /* Log archive wait mutex */
WT_SESSION_IMPL *log_session; /* Log archive session */
diff --git a/src/include/cursor.h b/src/include/cursor.h
index 082f3ee86e9..0a563b879c9 100644
--- a/src/include/cursor.h
+++ b/src/include/cursor.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -268,6 +269,8 @@ struct __wt_cursor_log {
WT_ITEM *logrec; /* Copy of record for cursor */
WT_ITEM *opkey, *opvalue; /* Op key/value copy */
const uint8_t *stepp, *stepp_end; /* Pointer within record */
+ uint8_t *packed_key; /* Packed key for 'raw' interface */
+ uint8_t *packed_value; /* Packed value for 'raw' interface */
uint32_t step_count; /* Intra-record count */
uint32_t rectype; /* Record type */
uint64_t txnid; /* Record txnid */
diff --git a/src/include/cursor.i b/src/include/cursor.i
index 737ac8dcdba..ae6aafdd638 100644
--- a/src/include/cursor.i
+++ b/src/include/cursor.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/dhandle.h b/src/include/dhandle.h
index 1a6839b11fe..423bb84d00d 100644
--- a/src/include/dhandle.h
+++ b/src/include/dhandle.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/dlh.h b/src/include/dlh.h
index 3974ae2792c..c374ec36fb0 100644
--- a/src/include/dlh.h
+++ b/src/include/dlh.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/error.h b/src/include/error.h
index 9bccc80faec..b732776badf 100644
--- a/src/include/error.h
+++ b/src/include/error.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/extern.h b/src/include/extern.h
index b5a38c8d37e..bc842595528 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -227,6 +227,7 @@ extern int __wt_connection_init(WT_CONNECTION_IMPL *conn);
extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn);
extern int __wt_log_truncate_files( WT_SESSION_IMPL *session, WT_CURSOR *cursor, const char *cfg[]);
extern int __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[]);
+extern int __wt_logmgr_open(WT_SESSION_IMPL *session);
extern int __wt_logmgr_destroy(WT_SESSION_IMPL *session);
extern int __wt_connection_open(WT_CONNECTION_IMPL *conn, const char *cfg[]);
extern int __wt_connection_close(WT_CONNECTION_IMPL *conn);
@@ -304,13 +305,13 @@ extern void __wt_log_written_reset(WT_SESSION_IMPL *session);
extern int __wt_log_get_all_files(WT_SESSION_IMPL *session, char ***filesp, u_int *countp, uint32_t *maxid, int active_only);
extern void __wt_log_files_free(WT_SESSION_IMPL *session, char **files, u_int count);
extern int __wt_log_extract_lognum( WT_SESSION_IMPL *session, const char *name, uint32_t *id);
-extern int __wt_log_allocfile(WT_SESSION_IMPL *session, uint32_t lognum, const char *dest);
+extern int __wt_log_allocfile( WT_SESSION_IMPL *session, uint32_t lognum, const char *dest, int prealloc);
extern int __wt_log_remove(WT_SESSION_IMPL *session, const char *file_prefix, uint32_t lognum);
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), 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, 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);
@@ -431,6 +432,8 @@ extern int __wt_dlopen(WT_SESSION_IMPL *session, const char *path, WT_DLH **dlhp
extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, int fail, void *sym_ret);
extern int __wt_dlclose(WT_SESSION_IMPL *session, WT_DLH *dlh);
extern int __wt_errno(void);
+extern const char *__wt_strerror(int error);
+extern int __wt_strerror_r(int error, char *buf, size_t buflen);
extern int __wt_exist(WT_SESSION_IMPL *session, const char *filename, int *existp);
extern void __wt_fallocate_config(WT_SESSION_IMPL *session, WT_FH *fh);
extern int __wt_fallocate( WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len);
@@ -658,4 +661,4 @@ extern int __wt_txn_checkpoint_log( WT_SESSION_IMPL *session, int full, uint32_t
extern int __wt_txn_truncate_log( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop);
extern int __wt_txn_truncate_end(WT_SESSION_IMPL *session);
extern int __wt_txn_printlog(WT_SESSION *wt_session, FILE *out);
-extern int __wt_txn_recover(WT_CONNECTION_IMPL *conn);
+extern int __wt_txn_recover(WT_SESSION_IMPL *session);
diff --git a/src/include/gcc.h b/src/include/gcc.h
index 008b19b743d..7b606ca80b1 100644
--- a/src/include/gcc.h
+++ b/src/include/gcc.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/hardware.h b/src/include/hardware.h
index 720f512cf2d..1c3fb287e86 100644
--- a/src/include/hardware.h
+++ b/src/include/hardware.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/intpack.i b/src/include/intpack.i
index 928e94a7dba..e1bcdb42ebd 100644
--- a/src/include/intpack.i
+++ b/src/include/intpack.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/lint.h b/src/include/lint.h
index 7c0a103a8ee..9c560339e03 100644
--- a/src/include/lint.h
+++ b/src/include/lint.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/log.h b/src/include/log.h
index e8c9fe8897b..17a3fd5a23a 100644
--- a/src/include/log.h
+++ b/src/include/log.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -13,17 +14,25 @@
#define LOG_ALIGN 128
#define WT_LOG_SLOT_BUF_INIT_SIZE 64 * 1024
-#define INIT_LSN(l) do { \
+#define WT_INIT_LSN(l) do { \
(l)->file = 1; \
(l)->offset = 0; \
} while (0)
-#define ZERO_LSN(l) do { \
+#define WT_MAX_LSN(l) do { \
+ (l)->file = UINT32_MAX; \
+ (l)->offset = INT64_MAX; \
+} while (0)
+
+#define WT_ZERO_LSN(l) do { \
(l)->file = 0; \
(l)->offset = 0; \
} while (0)
-#define IS_INIT_LSN(l) ((l)->file == 1 && (l)->offset == 0)
+#define WT_IS_INIT_LSN(l) \
+ ((l)->file == 1 && (l)->offset == 0)
+#define WT_IS_MAX_LSN(l) \
+ ((l)->file == UINT32_MAX && (l)->offset == INT64_MAX)
/*
* Both of the macros below need to change if the content of __wt_lsn
@@ -38,11 +47,6 @@
#define LOG_REC_SIZE(size) \
((size) - offsetof(WT_LOG_RECORD, record))
-#define MAX_LSN(l) do { \
- (l)->file = UINT32_MAX; \
- (l)->offset = INT64_MAX; \
-} while (0)
-
/*
* Compare 2 LSNs, return -1 if lsn0 < lsn1, 0 if lsn0 == lsn1
* and 1 if lsn0 > lsn1.
diff --git a/src/include/lsm.h b/src/include/lsm.h
index cf923236278..8038e5a34ab 100644
--- a/src/include/lsm.h
+++ b/src/include/lsm.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/meta.h b/src/include/meta.h
index 56b0450ac0e..d40b2d836bf 100644
--- a/src/include/meta.h
+++ b/src/include/meta.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/misc.h b/src/include/misc.h
index c2abaa08057..97fc2a47f20 100644
--- a/src/include/misc.h
+++ b/src/include/misc.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/misc.i b/src/include/misc.i
index 73caed09c8c..53f08b3cbeb 100644
--- a/src/include/misc.i
+++ b/src/include/misc.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/msvc.h b/src/include/msvc.h
index 17a4f1cb3ae..f176a40f2bf 100644
--- a/src/include/msvc.h
+++ b/src/include/msvc.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/mutex.h b/src/include/mutex.h
index d1373b3d1ad..c5b7587303d 100644
--- a/src/include/mutex.h
+++ b/src/include/mutex.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/mutex.i b/src/include/mutex.i
index 0d5a8586051..03450322616 100644
--- a/src/include/mutex.i
+++ b/src/include/mutex.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/os.h b/src/include/os.h
index 810b7adfa48..8306d8db75f 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/os_windows.h b/src/include/os_windows.h
index aa39f1f44ab..49dbc694895 100644
--- a/src/include/os_windows.h
+++ b/src/include/os_windows.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/packing.i b/src/include/packing.i
index 15cdfaf0a70..9caa58ed2e1 100644
--- a/src/include/packing.i
+++ b/src/include/packing.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/posix.h b/src/include/posix.h
index 36d69fb3ef5..14249e3ed37 100644
--- a/src/include/posix.h
+++ b/src/include/posix.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/schema.h b/src/include/schema.h
index ac95a273fef..4d722a0068b 100644
--- a/src/include/schema.h
+++ b/src/include/schema.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/serial.i b/src/include/serial.i
index 70dc6b8764d..5d1d37915d2 100644
--- a/src/include/serial.i
+++ b/src/include/serial.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/session.h b/src/include/session.h
index e381ded8d16..c2ed3473dfb 100644
--- a/src/include/session.h
+++ b/src/include/session.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -96,6 +97,7 @@ struct __wt_session_impl {
WT_ITEM **scratch; /* Temporary memory for any function */
u_int scratch_alloc; /* Currently allocated */
+ size_t scratch_cached; /* Scratch bytes cached */
#ifdef HAVE_DIAGNOSTIC
/*
* It's hard to figure out from where a buffer was allocated after it's
diff --git a/src/include/stat.h b/src/include/stat.h
index 20b7ff9c1d4..cbd22c7b9d0 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -166,6 +167,7 @@ struct __wt_connection_stats {
WT_STATS cache_eviction_force_fail;
WT_STATS cache_eviction_hazard;
WT_STATS cache_eviction_internal;
+ WT_STATS cache_eviction_maximum_page_size;
WT_STATS cache_eviction_queue_empty;
WT_STATS cache_eviction_queue_not_empty;
WT_STATS cache_eviction_server_evicting;
@@ -236,6 +238,11 @@ struct __wt_connection_stats {
WT_STATS memory_allocation;
WT_STATS memory_free;
WT_STATS memory_grow;
+ WT_STATS page_busy_blocked;
+ WT_STATS page_forcible_evict_blocked;
+ WT_STATS page_locked_blocked;
+ WT_STATS page_read_blocked;
+ WT_STATS page_sleep;
WT_STATS read_io;
WT_STATS rec_pages;
WT_STATS rec_pages_eviction;
diff --git a/src/include/txn.h b/src/include/txn.h
index c28a9231750..8380e55effb 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -6,6 +7,7 @@
*/
#define WT_TXN_NONE 0 /* No txn running in a session. */
+#define WT_TXN_FIRST 1 /* First transaction to run. */
#define WT_TXN_ABORTED UINT64_MAX /* Update rolled back, ignore. */
/*
diff --git a/src/include/txn.i b/src/include/txn.i
index 40ccf0ee59c..745a8f75a99 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/verify_build.h b/src/include/verify_build.h
index 5f05db11c4b..6a97def12be 100644
--- a/src/include/verify_build.h
+++ b/src/include/verify_build.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 9b77249367f..f582186f54c 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -541,18 +542,17 @@ struct __wt_cursor {
#define WT_CURSTD_APPEND 0x0001
#define WT_CURSTD_BULK 0x0002
-#define WT_CURSTD_DATA_SOURCE 0x0004
-#define WT_CURSTD_DUMP_HEX 0x0008
-#define WT_CURSTD_DUMP_JSON 0x0010
-#define WT_CURSTD_DUMP_PRINT 0x0020
-#define WT_CURSTD_KEY_EXT 0x0040 /* Key points out of the tree. */
-#define WT_CURSTD_KEY_INT 0x0080 /* Key points into the tree. */
+#define WT_CURSTD_DUMP_HEX 0x0004
+#define WT_CURSTD_DUMP_JSON 0x0008
+#define WT_CURSTD_DUMP_PRINT 0x0010
+#define WT_CURSTD_KEY_EXT 0x0020 /* Key points out of the tree. */
+#define WT_CURSTD_KEY_INT 0x0040 /* Key points into the tree. */
#define WT_CURSTD_KEY_SET (WT_CURSTD_KEY_EXT | WT_CURSTD_KEY_INT)
-#define WT_CURSTD_OPEN 0x0100
-#define WT_CURSTD_OVERWRITE 0x0200
-#define WT_CURSTD_RAW 0x0400
-#define WT_CURSTD_VALUE_EXT 0x0800 /* Value points out of the tree. */
-#define WT_CURSTD_VALUE_INT 0x1000 /* Value points into the tree. */
+#define WT_CURSTD_OPEN 0x0080
+#define WT_CURSTD_OVERWRITE 0x0100
+#define WT_CURSTD_RAW 0x0200
+#define WT_CURSTD_VALUE_EXT 0x0400 /* Value points out of the tree. */
+#define WT_CURSTD_VALUE_INT 0x0800 /* Value points into the tree. */
#define WT_CURSTD_VALUE_SET (WT_CURSTD_VALUE_EXT | WT_CURSTD_VALUE_INT)
uint32_t flags;
#endif
@@ -959,7 +959,7 @@ struct __wt_session {
* created with WT_CONNECTION::add_compressor. If WiredTiger has
* builtin support for \c "snappy" or \c "zlib" compression\, these
* names are also available. See @ref compression for more
- * information., a string; default empty.}
+ * information., a string; default \c none.}
* @config{cache_resident, do not ever evict the object's pages; see
* @ref tuning_cache_resident for more information., a boolean flag;
* default \c false.}
@@ -979,7 +979,7 @@ struct __wt_session {
* strings; default empty.}
* @config{collator, configure custom collation for keys. Permitted
* values are \c "none" or a custom collator name created with
- * WT_CONNECTION::add_collator., a string; default empty.}
+ * WT_CONNECTION::add_collator., a string; default \c none.}
* @config{columns, list of the column names. Comma-separated list of
* the form <code>(column[\,...])</code>. For tables\, the number of
* entries must match the total number of values in \c key_format and \c
@@ -995,17 +995,17 @@ struct __wt_session {
* specified configuration., a boolean flag; default \c false.}
* @config{extractor, configure custom extractor for indices. Permitted
* values are \c "none" or an extractor name created with
- * WT_CONNECTION::add_extractor., a string; default empty.}
+ * WT_CONNECTION::add_extractor., a string; default \c none.}
* @config{format, the file format., a string\, chosen from the
* following options: \c "btree"; default \c btree.}
* @config{huffman_key, configure Huffman encoding for keys. Permitted
* values are \c "none"\, \c "english"\, \c "utf8<file>" or \c
* "utf16<file>". See @ref huffman for more information., a string;
- * default empty.}
+ * default \c none.}
* @config{huffman_value, configure Huffman encoding for values.
* Permitted values are \c "none"\, \c "english"\, \c "utf8<file>" or \c
* "utf16<file>". See @ref huffman for more information., a string;
- * default empty.}
+ * default \c none.}
* @config{immutable, configure the index to be immutable - that is an
* index is not changed by any update to a record in the table., a
* boolean flag; default \c false.}
@@ -1918,7 +1918,7 @@ struct __wt_connection {
* records. Permitted values are \c "none" or \c "bzip2"\, \c "snappy" or
* custom compression engine \c "name" created with
* WT_CONNECTION::add_compressor. See @ref compression for more information., a
- * string; default empty.}
+ * string; default \c none.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;enabled, enable
* logging subsystem., a boolean flag; default \c false.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;file_max, the maximum size of log files., an
@@ -2032,15 +2032,26 @@ int wiredtiger_open(const char *home,
WT_CONNECTION **connectionp);
/*!
- * Return information about an error as a string; wiredtiger_strerror is a
- * superset of the ISO C99/POSIX 1003.1-2001 function strerror.
+ * Return information about a WiredTiger error as a string, not thread-safe.
*
* @snippet ex_all.c Display an error
*
- * @param err a return value from a WiredTiger, C library or POSIX function
+ * @param error a return value from a WiredTiger call
* @returns a string representation of the error
*/
-const char *wiredtiger_strerror(int err);
+const char *wiredtiger_strerror(int error);
+
+/*!
+ * Return information about a WiredTiger error as a string, thread-safe version.
+ *
+ * @snippet ex_all.c Display an error thread safe
+ *
+ * @param error a return value from a WiredTiger call
+ * @param buf a buffer of at least \c buflen bytes
+ * @param buflen the length of the buffer
+ * @returns zero for success, non-zero to indicate an error.
+ */
+int wiredtiger_strerror_r(int error, char *buf, size_t buflen);
#if !defined(SWIG)
/*!
@@ -3173,188 +3184,200 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1033
/*! cache: internal pages evicted */
#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1034
+/*! cache: maximum page size at eviction */
+#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1035
/*! cache: eviction server candidate queue empty when topping up */
-#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1035
+#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1036
/*! cache: eviction server candidate queue not empty when topping up */
-#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1036
+#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1037
/*! cache: eviction server evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1037
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1038
/*! cache: eviction server populating queue, but not evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1038
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1039
/*! cache: eviction server unable to reach eviction goal */
-#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1039
+#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1040
/*! cache: pages split during eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_SPLIT 1040
+#define WT_STAT_CONN_CACHE_EVICTION_SPLIT 1041
/*! cache: pages walked for eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_WALK 1041
+#define WT_STAT_CONN_CACHE_EVICTION_WALK 1042
/*! cache: in-memory page splits */
-#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1042
+#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1043
/*! cache: tracked dirty pages in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1043
+#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1044
/*! cache: pages currently held in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_INUSE 1044
+#define WT_STAT_CONN_CACHE_PAGES_INUSE 1045
/*! cache: pages read into cache */
-#define WT_STAT_CONN_CACHE_READ 1045
+#define WT_STAT_CONN_CACHE_READ 1046
/*! cache: pages written from cache */
-#define WT_STAT_CONN_CACHE_WRITE 1046
+#define WT_STAT_CONN_CACHE_WRITE 1047
/*! connection: pthread mutex condition wait calls */
-#define WT_STAT_CONN_COND_WAIT 1047
+#define WT_STAT_CONN_COND_WAIT 1048
/*! cursor: cursor create calls */
-#define WT_STAT_CONN_CURSOR_CREATE 1048
+#define WT_STAT_CONN_CURSOR_CREATE 1049
/*! cursor: cursor insert calls */
-#define WT_STAT_CONN_CURSOR_INSERT 1049
+#define WT_STAT_CONN_CURSOR_INSERT 1050
/*! cursor: cursor next calls */
-#define WT_STAT_CONN_CURSOR_NEXT 1050
+#define WT_STAT_CONN_CURSOR_NEXT 1051
/*! cursor: cursor prev calls */
-#define WT_STAT_CONN_CURSOR_PREV 1051
+#define WT_STAT_CONN_CURSOR_PREV 1052
/*! cursor: cursor remove calls */
-#define WT_STAT_CONN_CURSOR_REMOVE 1052
+#define WT_STAT_CONN_CURSOR_REMOVE 1053
/*! cursor: cursor reset calls */
-#define WT_STAT_CONN_CURSOR_RESET 1053
+#define WT_STAT_CONN_CURSOR_RESET 1054
/*! cursor: cursor search calls */
-#define WT_STAT_CONN_CURSOR_SEARCH 1054
+#define WT_STAT_CONN_CURSOR_SEARCH 1055
/*! cursor: cursor search near calls */
-#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1055
+#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1056
/*! cursor: cursor update calls */
-#define WT_STAT_CONN_CURSOR_UPDATE 1056
+#define WT_STAT_CONN_CURSOR_UPDATE 1057
/*! data-handle: connection dhandles swept */
-#define WT_STAT_CONN_DH_CONN_HANDLES 1057
+#define WT_STAT_CONN_DH_CONN_HANDLES 1058
/*! data-handle: connection candidate referenced */
-#define WT_STAT_CONN_DH_CONN_REF 1058
+#define WT_STAT_CONN_DH_CONN_REF 1059
/*! data-handle: connection sweeps */
-#define WT_STAT_CONN_DH_CONN_SWEEPS 1059
+#define WT_STAT_CONN_DH_CONN_SWEEPS 1060
/*! data-handle: connection time-of-death sets */
-#define WT_STAT_CONN_DH_CONN_TOD 1060
+#define WT_STAT_CONN_DH_CONN_TOD 1061
/*! data-handle: session dhandles swept */
-#define WT_STAT_CONN_DH_SESSION_HANDLES 1061
+#define WT_STAT_CONN_DH_SESSION_HANDLES 1062
/*! data-handle: session sweep attempts */
-#define WT_STAT_CONN_DH_SESSION_SWEEPS 1062
+#define WT_STAT_CONN_DH_SESSION_SWEEPS 1063
/*! connection: files currently open */
-#define WT_STAT_CONN_FILE_OPEN 1063
+#define WT_STAT_CONN_FILE_OPEN 1064
/*! log: log buffer size increases */
-#define WT_STAT_CONN_LOG_BUFFER_GROW 1064
+#define WT_STAT_CONN_LOG_BUFFER_GROW 1065
/*! log: total log buffer size */
-#define WT_STAT_CONN_LOG_BUFFER_SIZE 1065
+#define WT_STAT_CONN_LOG_BUFFER_SIZE 1066
/*! log: log bytes of payload data */
-#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1066
+#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1067
/*! log: log bytes written */
-#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1067
+#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1068
/*! log: yields waiting for previous log file close */
-#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1068
+#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1069
/*! log: total size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_LEN 1069
+#define WT_STAT_CONN_LOG_COMPRESS_LEN 1070
/*! log: total in-memory size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_MEM 1070
+#define WT_STAT_CONN_LOG_COMPRESS_MEM 1071
/*! log: log records too small to compress */
-#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1071
+#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1072
/*! log: log records not compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1072
+#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1073
/*! log: log records compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1073
+#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1074
/*! log: maximum log file size */
-#define WT_STAT_CONN_LOG_MAX_FILESIZE 1074
+#define WT_STAT_CONN_LOG_MAX_FILESIZE 1075
/*! log: pre-allocated log files prepared */
-#define WT_STAT_CONN_LOG_PREALLOC_FILES 1075
+#define WT_STAT_CONN_LOG_PREALLOC_FILES 1076
/*! log: number of pre-allocated log files to create */
-#define WT_STAT_CONN_LOG_PREALLOC_MAX 1076
+#define WT_STAT_CONN_LOG_PREALLOC_MAX 1077
/*! log: pre-allocated log files used */
-#define WT_STAT_CONN_LOG_PREALLOC_USED 1077
+#define WT_STAT_CONN_LOG_PREALLOC_USED 1078
/*! log: log read operations */
-#define WT_STAT_CONN_LOG_READS 1078
+#define WT_STAT_CONN_LOG_READS 1079
/*! log: records processed by log scan */
-#define WT_STAT_CONN_LOG_SCAN_RECORDS 1079
+#define WT_STAT_CONN_LOG_SCAN_RECORDS 1080
/*! log: log scan records requiring two reads */
-#define WT_STAT_CONN_LOG_SCAN_REREADS 1080
+#define WT_STAT_CONN_LOG_SCAN_REREADS 1081
/*! log: log scan operations */
-#define WT_STAT_CONN_LOG_SCANS 1081
+#define WT_STAT_CONN_LOG_SCANS 1082
/*! log: consolidated slot closures */
-#define WT_STAT_CONN_LOG_SLOT_CLOSES 1082
+#define WT_STAT_CONN_LOG_SLOT_CLOSES 1083
/*! log: logging bytes consolidated */
-#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1083
+#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1084
/*! log: consolidated slot joins */
-#define WT_STAT_CONN_LOG_SLOT_JOINS 1084
+#define WT_STAT_CONN_LOG_SLOT_JOINS 1085
/*! log: consolidated slot join races */
-#define WT_STAT_CONN_LOG_SLOT_RACES 1085
+#define WT_STAT_CONN_LOG_SLOT_RACES 1086
/*! log: slots selected for switching that were unavailable */
-#define WT_STAT_CONN_LOG_SLOT_SWITCH_FAILS 1086
+#define WT_STAT_CONN_LOG_SLOT_SWITCH_FAILS 1087
/*! log: record size exceeded maximum */
-#define WT_STAT_CONN_LOG_SLOT_TOOBIG 1087
+#define WT_STAT_CONN_LOG_SLOT_TOOBIG 1088
/*! log: failed to find a slot large enough for record */
-#define WT_STAT_CONN_LOG_SLOT_TOOSMALL 1088
+#define WT_STAT_CONN_LOG_SLOT_TOOSMALL 1089
/*! log: consolidated slot join transitions */
-#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1089
+#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1090
/*! log: log sync operations */
-#define WT_STAT_CONN_LOG_SYNC 1090
+#define WT_STAT_CONN_LOG_SYNC 1091
/*! log: log write operations */
-#define WT_STAT_CONN_LOG_WRITES 1091
+#define WT_STAT_CONN_LOG_WRITES 1092
/*! LSM: sleep for LSM checkpoint throttle */
-#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1092
+#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1093
/*! LSM: sleep for LSM merge throttle */
-#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1093
+#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1094
/*! LSM: rows merged in an LSM tree */
-#define WT_STAT_CONN_LSM_ROWS_MERGED 1094
+#define WT_STAT_CONN_LSM_ROWS_MERGED 1095
/*! LSM: application work units currently queued */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_APP 1095
+#define WT_STAT_CONN_LSM_WORK_QUEUE_APP 1096
/*! LSM: merge work units currently queued */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_MANAGER 1096
+#define WT_STAT_CONN_LSM_WORK_QUEUE_MANAGER 1097
/*! LSM: tree queue hit maximum */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_MAX 1097
+#define WT_STAT_CONN_LSM_WORK_QUEUE_MAX 1098
/*! LSM: switch work units currently queued */
-#define WT_STAT_CONN_LSM_WORK_QUEUE_SWITCH 1098
+#define WT_STAT_CONN_LSM_WORK_QUEUE_SWITCH 1099
/*! LSM: tree maintenance operations scheduled */
-#define WT_STAT_CONN_LSM_WORK_UNITS_CREATED 1099
+#define WT_STAT_CONN_LSM_WORK_UNITS_CREATED 1100
/*! LSM: tree maintenance operations discarded */
-#define WT_STAT_CONN_LSM_WORK_UNITS_DISCARDED 1100
+#define WT_STAT_CONN_LSM_WORK_UNITS_DISCARDED 1101
/*! LSM: tree maintenance operations executed */
-#define WT_STAT_CONN_LSM_WORK_UNITS_DONE 1101
+#define WT_STAT_CONN_LSM_WORK_UNITS_DONE 1102
/*! connection: memory allocations */
-#define WT_STAT_CONN_MEMORY_ALLOCATION 1102
+#define WT_STAT_CONN_MEMORY_ALLOCATION 1103
/*! connection: memory frees */
-#define WT_STAT_CONN_MEMORY_FREE 1103
+#define WT_STAT_CONN_MEMORY_FREE 1104
/*! connection: memory re-allocations */
-#define WT_STAT_CONN_MEMORY_GROW 1104
+#define WT_STAT_CONN_MEMORY_GROW 1105
+/*! thread-yield: page acquire busy blocked */
+#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1106
+/*! thread-yield: page acquire eviction blocked */
+#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1107
+/*! thread-yield: page acquire locked blocked */
+#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1108
+/*! thread-yield: page acquire read blocked */
+#define WT_STAT_CONN_PAGE_READ_BLOCKED 1109
+/*! thread-yield: page acquire time sleeping (usecs) */
+#define WT_STAT_CONN_PAGE_SLEEP 1110
/*! connection: total read I/Os */
-#define WT_STAT_CONN_READ_IO 1105
+#define WT_STAT_CONN_READ_IO 1111
/*! reconciliation: page reconciliation calls */
-#define WT_STAT_CONN_REC_PAGES 1106
+#define WT_STAT_CONN_REC_PAGES 1112
/*! reconciliation: page reconciliation calls for eviction */
-#define WT_STAT_CONN_REC_PAGES_EVICTION 1107
+#define WT_STAT_CONN_REC_PAGES_EVICTION 1113
/*! reconciliation: split bytes currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1108
+#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1114
/*! reconciliation: split objects currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1109
+#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1115
/*! connection: pthread mutex shared lock read-lock calls */
-#define WT_STAT_CONN_RWLOCK_READ 1110
+#define WT_STAT_CONN_RWLOCK_READ 1116
/*! connection: pthread mutex shared lock write-lock calls */
-#define WT_STAT_CONN_RWLOCK_WRITE 1111
+#define WT_STAT_CONN_RWLOCK_WRITE 1117
/*! session: open cursor count */
-#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1112
+#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1118
/*! session: open session count */
-#define WT_STAT_CONN_SESSION_OPEN 1113
+#define WT_STAT_CONN_SESSION_OPEN 1119
/*! transaction: transaction begins */
-#define WT_STAT_CONN_TXN_BEGIN 1114
+#define WT_STAT_CONN_TXN_BEGIN 1120
/*! transaction: transaction checkpoints */
-#define WT_STAT_CONN_TXN_CHECKPOINT 1115
+#define WT_STAT_CONN_TXN_CHECKPOINT 1121
/*! transaction: transaction checkpoint currently running */
-#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1116
+#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1122
/*! transaction: transaction checkpoint max time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1117
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1123
/*! transaction: transaction checkpoint min time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1118
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1124
/*! transaction: transaction checkpoint most recent time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1119
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1125
/*! transaction: transaction checkpoint total time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1120
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1126
/*! transaction: transactions committed */
-#define WT_STAT_CONN_TXN_COMMIT 1121
+#define WT_STAT_CONN_TXN_COMMIT 1127
/*! transaction: transaction failures due to cache overflow */
-#define WT_STAT_CONN_TXN_FAIL_CACHE 1122
+#define WT_STAT_CONN_TXN_FAIL_CACHE 1128
/*! transaction: transaction range of IDs currently pinned */
-#define WT_STAT_CONN_TXN_PINNED_RANGE 1123
+#define WT_STAT_CONN_TXN_PINNED_RANGE 1129
/*! transaction: transactions rolled back */
-#define WT_STAT_CONN_TXN_ROLLBACK 1124
+#define WT_STAT_CONN_TXN_ROLLBACK 1130
/*! connection: total write I/Os */
-#define WT_STAT_CONN_WRITE_IO 1125
+#define WT_STAT_CONN_WRITE_IO 1131
/*!
* @}
diff --git a/src/include/wiredtiger_ext.h b/src/include/wiredtiger_ext.h
index 32661869311..ee27b32ddf7 100644
--- a/src/include/wiredtiger_ext.h
+++ b/src/include/wiredtiger_ext.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/wt_internal.h b/src/include/wt_internal.h
index a6ea257a3ea..138b64a6e27 100644
--- a/src/include/wt_internal.h
+++ b/src/include/wt_internal.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/log/log.c b/src/log/log.c
index e7a7998f47d..944e748a6a8 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -415,7 +416,7 @@ __log_file_header(
if (end_lsn != NULL)
*end_lsn = tmp.slot_end_lsn;
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
@@ -440,7 +441,7 @@ __log_openfile(WT_SESSION_IMPL *session,
* XXX - if we are not creating the file, we should verify the
* log file header record for the magic number and versions here.
*/
-err: __wt_scr_free(&path);
+err: __wt_scr_free(session, &path);
return (ret);
}
@@ -488,8 +489,8 @@ __log_alloc_prealloc(WT_SESSION_IMPL *session, uint32_t to_num)
*/
WT_ERR(__wt_rename(session, from_path->data, to_path->data));
-err: __wt_scr_free(&from_path);
- __wt_scr_free(&to_path);
+err: __wt_scr_free(session, &from_path);
+ __wt_scr_free(session, &to_path);
if (logfiles != NULL)
__wt_log_files_free(session, logfiles, logcount);
return (ret);
@@ -569,7 +570,8 @@ err: if (log_fh != NULL)
* pre-allocating the file and moving it to the destination name.
*/
int
-__wt_log_allocfile(WT_SESSION_IMPL *session, uint32_t lognum, const char *dest)
+__wt_log_allocfile(
+ WT_SESSION_IMPL *session, uint32_t lognum, const char *dest, int prealloc)
{
WT_CONNECTION_IMPL *conn;
WT_DECL_ITEM(from_path);
@@ -598,7 +600,8 @@ __wt_log_allocfile(WT_SESSION_IMPL *session, uint32_t lognum, const char *dest)
WT_ERR(__log_openfile(session, 1, &log_fh, WT_LOG_TMPNAME, lognum));
WT_ERR(__log_file_header(session, log_fh, NULL, 1));
WT_ERR(__wt_ftruncate(session, log_fh, LOG_FIRST_RECORD));
- WT_ERR(__log_prealloc(session, log_fh));
+ if (prealloc)
+ WT_ERR(__log_prealloc(session, log_fh));
tmp_fh = log_fh;
log_fh = NULL;
WT_ERR(__wt_close(session, tmp_fh));
@@ -610,8 +613,8 @@ __wt_log_allocfile(WT_SESSION_IMPL *session, uint32_t lognum, const char *dest)
*/
WT_ERR(__wt_rename(session, from_path->data, to_path->data));
-err: __wt_scr_free(&from_path);
- __wt_scr_free(&to_path);
+err: __wt_scr_free(session, &from_path);
+ __wt_scr_free(session, &to_path);
if (log_fh != NULL)
WT_TRET(__wt_close(session, log_fh));
return (ret);
@@ -633,7 +636,7 @@ __wt_log_remove(WT_SESSION_IMPL *session,
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
"log_remove: remove log %s", (char *)path->data));
WT_ERR(__wt_remove(session, path->data));
-err: __wt_scr_free(&path);
+err: __wt_scr_free(session, &path);
return (ret);
}
@@ -713,13 +716,10 @@ __wt_log_open(WT_SESSION_IMPL *session)
*/
WT_ERR(__wt_log_newfile(session, 1, NULL));
- /*
- * If there were log files, run recovery.
- * XXX belongs at a higher level than this.
- */
+ /* If we found log files, save the new state. */
if (logcount > 0) {
log->trunc_lsn = log->alloc_lsn;
- WT_ERR(__wt_txn_recover(conn));
+ FLD_SET(conn->log_flags, WT_CONN_LOG_EXISTED);
}
err: if (logfiles != NULL)
@@ -957,10 +957,14 @@ __log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot)
&slot->slot_buf, slot->slot_buf.memsize * 2));
}
/*
- * If we have a file to close, close it now.
+ * If we have a file to close, close it now. First fsync so
+ * that a later sync will be assured all earlier transactions
+ * in earlier log files are also on disk.
*/
- if (close_fh)
+ if (close_fh) {
+ WT_ERR(__wt_fsync(session, close_fh));
WT_ERR(__wt_close(session, close_fh));
+ }
err: if (locked)
__wt_spin_unlock(session, &log->log_sync_lock);
@@ -1025,7 +1029,7 @@ __wt_log_newfile(WT_SESSION_IMPL *session, int conn_create, int *created)
* If we need to create the log file, do so now.
*/
if (create_log && (ret = __wt_log_allocfile(
- session, log->fileid, WT_LOG_FILENAME)) != 0)
+ session, log->fileid, WT_LOG_FILENAME, 0)) != 0)
return (ret);
WT_RET(__log_openfile(session,
0, &log->log_fh, WT_LOG_FILENAME, log->fileid));
@@ -1076,7 +1080,7 @@ __wt_log_read(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp,
*uncitem = swap;
}
-err: __wt_scr_free(&uncitem);
+err: __wt_scr_free(session, &uncitem);
return (ret);
}
@@ -1160,7 +1164,7 @@ 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), void *cookie)
+ WT_ITEM *record, WT_LSN *lsnp, void *cookie, int firstrecord), void *cookie)
{
WT_CONNECTION_IMPL *conn;
WT_DECL_ITEM(uncitem);
@@ -1174,6 +1178,7 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags,
uint32_t allocsize, cksum, firstlog, lastlog, lognum, rdup_len, reclen;
u_int i, logcount;
int eol;
+ int firstrecord;
char **logfiles;
conn = S2C(session);
@@ -1181,6 +1186,7 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags,
log_fh = NULL;
logcount = 0;
logfiles = NULL;
+ firstrecord = 1;
eol = 0;
WT_CLEAR(buf);
@@ -1218,11 +1224,11 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags,
/*
* Log cursors may not know the starting LSN. If an
- * LSN pointer is passed in, but it is the INIT_LSN,
- * start from the first_lsn.
+ * LSN is passed in that it is equal to the smallest
+ * LSN, start from the beginning of the log.
*/
start_lsn = *lsnp;
- if (IS_INIT_LSN(&start_lsn))
+ if (WT_IS_INIT_LSN(&start_lsn))
start_lsn = log->first_lsn;
}
end_lsn = log->alloc_lsn;
@@ -1364,10 +1370,13 @@ advance:
WT_ERR(__log_decompress(session, &buf,
&uncitem));
WT_ERR((*func)(session, uncitem, &rd_lsn,
- cookie));
- __wt_scr_free(&uncitem);
+ cookie, firstrecord));
+ __wt_scr_free(session, &uncitem);
} else
- WT_ERR((*func)(session, &buf, &rd_lsn, cookie));
+ WT_ERR((*func)(session, &buf, &rd_lsn, cookie,
+ firstrecord));
+
+ firstrecord = 0;
if (LF_ISSET(WT_LOGSCAN_ONE))
break;
@@ -1385,7 +1394,7 @@ err: WT_STAT_FAST_CONN_INCR(session, log_scans);
if (logfiles != NULL)
__wt_log_files_free(session, logfiles, logcount);
__wt_buf_free(session, &buf);
- __wt_scr_free(&uncitem);
+ __wt_scr_free(session, &uncitem);
/*
* If the caller wants one record and it is at the end of log,
* return WT_NOTFOUND.
@@ -1534,7 +1543,7 @@ __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp,
}
ret = __log_write_internal(session, ip, lsnp, flags);
-err: __wt_scr_free(&citem);
+err: __wt_scr_free(session, &citem);
return (ret);
}
@@ -1558,7 +1567,7 @@ __log_write_internal(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp,
conn = S2C(session);
log = conn->log;
locked = 0;
- INIT_LSN(&lsn);
+ WT_INIT_LSN(&lsn);
myslot.slot = NULL;
/*
* Assume the WT_ITEM the caller passed is a WT_LOG_RECORD, which has a
@@ -1712,6 +1721,6 @@ __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap)
logrec->size += len;
WT_ERR(__wt_log_write(session, logrec, NULL, 0));
-err: __wt_scr_free(&logrec);
+err: __wt_scr_free(session, &logrec);
return (ret);
}
diff --git a/src/log/log_auto.c b/src/log/log_auto.c
index c175c47830b..37ad8a370f9 100644
--- a/src/log/log_auto.c
+++ b/src/log/log_auto.c
@@ -18,8 +18,7 @@ __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp)
void
__wt_logrec_free(WT_SESSION_IMPL *session, WT_ITEM **logrecp)
{
- WT_UNUSED(session);
- __wt_scr_free(logrecp);
+ __wt_scr_free(session, logrecp);
}
int
@@ -135,7 +134,7 @@ __wt_logop_col_put_print(
fprintf(out, " \"fileid\": \"%" PRIu32 "\",\n", fileid);
fprintf(out, " \"recno\": \"%" PRIu64 "\",\n", recno);
WT_RET(__logrec_jsonify_str(session, &escaped, &value));
- fprintf(out, " \"value\": \"%s\",\n", escaped);
+ fprintf(out, " \"value\": \"%s\"", escaped);
__wt_free(session, escaped);
return (0);
}
@@ -192,7 +191,7 @@ __wt_logop_col_remove_print(
fprintf(out, " \"optype\": \"col_remove\",\n");
fprintf(out, " \"fileid\": \"%" PRIu32 "\",\n", fileid);
- fprintf(out, " \"recno\": \"%" PRIu64 "\",\n", recno);
+ fprintf(out, " \"recno\": \"%" PRIu64 "\"", recno);
return (0);
}
@@ -250,7 +249,7 @@ __wt_logop_col_truncate_print(
fprintf(out, " \"optype\": \"col_truncate\",\n");
fprintf(out, " \"fileid\": \"%" PRIu32 "\",\n", fileid);
fprintf(out, " \"start\": \"%" PRIu64 "\",\n", start);
- fprintf(out, " \"stop\": \"%" PRIu64 "\",\n", stop);
+ fprintf(out, " \"stop\": \"%" PRIu64 "\"", stop);
return (0);
}
@@ -312,7 +311,7 @@ __wt_logop_row_put_print(
WT_RET(__logrec_jsonify_str(session, &escaped, &key));
fprintf(out, " \"key\": \"%s\",\n", escaped);
WT_RET(__logrec_jsonify_str(session, &escaped, &value));
- fprintf(out, " \"value\": \"%s\",\n", escaped);
+ fprintf(out, " \"value\": \"%s\"", escaped);
__wt_free(session, escaped);
return (0);
}
@@ -372,7 +371,7 @@ __wt_logop_row_remove_print(
fprintf(out, " \"optype\": \"row_remove\",\n");
fprintf(out, " \"fileid\": \"%" PRIu32 "\",\n", fileid);
WT_RET(__logrec_jsonify_str(session, &escaped, &key));
- fprintf(out, " \"key\": \"%s\",\n", escaped);
+ fprintf(out, " \"key\": \"%s\"", escaped);
__wt_free(session, escaped);
return (0);
}
@@ -437,7 +436,7 @@ __wt_logop_row_truncate_print(
fprintf(out, " \"start\": \"%s\",\n", escaped);
WT_RET(__logrec_jsonify_str(session, &escaped, &stop));
fprintf(out, " \"stop\": \"%s\",\n", escaped);
- fprintf(out, " \"mode\": \"%" PRIu32 "\",\n", mode);
+ fprintf(out, " \"mode\": \"%" PRIu32 "\"", mode);
__wt_free(session, escaped);
return (0);
}
diff --git a/src/log/log_slot.c b/src/log/log_slot.c
index 85ceddf1d39..cb959f28bd7 100644
--- a/src/log/log_slot.c
+++ b/src/log/log_slot.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c
index dd60ad926d8..031a4e88467 100644
--- a/src/lsm/lsm_cursor.c
+++ b/src/lsm/lsm_cursor.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -1314,7 +1315,7 @@ __clsm_insert(WT_CURSOR *cursor)
WT_ERR(__clsm_deleted_encode(session, &cursor->value, &value, &buf));
ret = __clsm_put(session, clsm, &cursor->key, &value, 0);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
WT_TRET(__clsm_leave(clsm));
CURSOR_UPDATE_API_END(session, ret);
return (ret);
@@ -1347,7 +1348,7 @@ __clsm_update(WT_CURSOR *cursor)
ret = __clsm_put(session, clsm, &cursor->key, &value, 1);
}
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
WT_TRET(__clsm_leave(clsm));
CURSOR_UPDATE_API_END(session, ret);
return (ret);
@@ -1482,11 +1483,8 @@ __wt_clsm_open(WT_SESSION_IMPL *session,
WT_ERR(__wt_cursor_init(cursor, cursor->uri, owner, cfg, cursorp));
if (0) {
-err: __wt_lsm_tree_release(session, lsm_tree);
- if (clsm != NULL) {
- clsm->lsm_tree = NULL;
+err: if (clsm != NULL)
WT_TRET(__clsm_close(cursor));
- }
}
return (ret);
diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c
index 319bc734d6d..27bdf526ba2 100644
--- a/src/lsm/lsm_manager.c
+++ b/src/lsm/lsm_manager.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c
index 8989e979a44..8724807432c 100644
--- a/src/lsm/lsm_merge.c
+++ b/src/lsm/lsm_merge.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/lsm/lsm_meta.c b/src/lsm/lsm_meta.c
index 7fd77b64720..f9bf10ca208 100644
--- a/src/lsm/lsm_meta.c
+++ b/src/lsm/lsm_meta.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -234,6 +235,6 @@ __wt_lsm_meta_write(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
ret = __wt_metadata_update(session, lsm_tree->name, buf->data);
WT_ERR(ret);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c
index bd11e982442..e994300d4d3 100644
--- a/src/lsm/lsm_stat.c
+++ b/src/lsm/lsm_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -139,7 +140,7 @@ __curstat_lsm_init(
err: if (locked)
WT_TRET(__wt_lsm_tree_readunlock(session, lsm_tree));
__wt_lsm_tree_release(session, lsm_tree);
- __wt_scr_free(&uribuf);
+ __wt_scr_free(session, &uribuf);
return (ret);
}
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index 2e61bcbacc8..ed09d7544a8 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -171,7 +172,7 @@ __wt_lsm_tree_bloom_name(WT_SESSION_IMPL *session,
session, tmp, "file:%s-%06" PRIu32 ".bf", lsm_tree->filename, id));
WT_ERR(__wt_strndup(session, tmp->data, tmp->size, retp));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -191,7 +192,7 @@ __wt_lsm_tree_chunk_name(WT_SESSION_IMPL *session,
session, tmp, "file:%s-%06" PRIu32 ".lsm", lsm_tree->filename, id));
WT_ERR(__wt_strndup(session, tmp->data, tmp->size, retp));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -428,7 +429,7 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
if (0) {
err: WT_TRET(__lsm_tree_discard(session, lsm_tree, 0));
}
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c
index 81a588af84d..980d910ff33 100644
--- a/src/lsm/lsm_work_unit.c
+++ b/src/lsm/lsm_work_unit.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index 703453305ba..a376a81f4eb 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_apply.c b/src/meta/meta_apply.c
index 313516148c0..8ef5cc38db4 100644
--- a/src/meta/meta_apply.c
+++ b/src/meta/meta_apply.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index 303b49d7818..0a8557c7a33 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -299,7 +300,7 @@ __wt_meta_ckptlist_get(
err: __wt_meta_ckptlist_free(session, ckptbase);
}
__wt_free(session, config);
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
@@ -453,7 +454,7 @@ __wt_meta_ckptlist_set(WT_SESSION_IMPL *session,
ckptlsn->file, (uintmax_t)ckptlsn->offset));
WT_ERR(__ckpt_set(session, fname, buf->mem));
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/meta/meta_ext.c b/src/meta/meta_ext.c
index 24fb3141738..423b7d2e76b 100644
--- a/src/meta/meta_ext.c
+++ b/src/meta/meta_ext.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_table.c b/src/meta/meta_table.c
index 2df6e252f5b..fb568361f74 100644
--- a/src/meta/meta_table.c
+++ b/src/meta/meta_table.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_track.c b/src/meta/meta_track.c
index 8cc8822b268..85ca1732586 100644
--- a/src/meta/meta_track.c
+++ b/src/meta/meta_track.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_turtle.c b/src/meta/meta_turtle.c
index c7c2f7aa55c..9e0af69366e 100644
--- a/src/meta/meta_turtle.c
+++ b/src/meta/meta_turtle.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -37,7 +38,7 @@ __metadata_config(WT_SESSION_IMPL *session, char **metaconfp)
if (0) {
err: __wt_free(session, metaconf);
}
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
@@ -100,8 +101,8 @@ __metadata_load_hot_backup(WT_SESSION_IMPL *session)
err: if (fp != NULL)
WT_TRET(fclose(fp) == 0 ? 0 : __wt_errno());
- __wt_scr_free(&key);
- __wt_scr_free(&value);
+ __wt_scr_free(session, &key);
+ __wt_scr_free(session, &value);
return (ret);
}
@@ -275,7 +276,7 @@ __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep)
err: if (fp != NULL)
WT_TRET(fclose(fp) == 0 ? 0 : __wt_errno());
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
@@ -331,6 +332,6 @@ err: WT_TRET(__wt_remove(session, WT_METADATA_TURTLE_SET));
if (fh != NULL)
WT_TRET(__wt_close(session, fh));
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/os_posix/os_abort.c b/src/os_posix/os_abort.c
index 3d99ffe20b2..5bb6aeb6e16 100644
--- a/src/os_posix/os_abort.c
+++ b/src/os_posix/os_abort.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_alloc.c b/src/os_posix/os_alloc.c
index f7344032a15..0795fe2fe0d 100644
--- a/src/os_posix/os_alloc.c
+++ b/src/os_posix/os_alloc.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_dir.c b/src/os_posix/os_dir.c
index 98b2d4926cd..5bf6e7349fe 100644
--- a/src/os_posix/os_dir.c
+++ b/src/os_posix/os_dir.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_dlopen.c b/src/os_posix/os_dlopen.c
index cb9fe314beb..a468e7ab49d 100644
--- a/src/os_posix/os_dlopen.c
+++ b/src/os_posix/os_dlopen.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_errno.c b/src/os_posix/os_errno.c
index 9290f7d651f..a58f13583ce 100644
--- a/src/os_posix/os_errno.c
+++ b/src/os_posix/os_errno.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -20,3 +21,49 @@ __wt_errno(void)
*/
return (errno == 0 ? WT_ERROR : errno);
}
+
+/*
+ * __wt_strerror --
+ * POSIX implementation of wiredtiger_strerror.
+ */
+const char *
+__wt_strerror(int error)
+{
+ const char *p;
+
+ /*
+ * POSIX errors are non-negative integers; check for 0 explicitly
+ * in-case the underlying strerror doesn't handle 0, some don't.
+ */
+ if (error == 0)
+ return ("Successful return: 0");
+ if (error > 0 && (p = strerror(error)) != NULL)
+ return (p);
+ return (NULL);
+}
+
+/*
+ * __wt_strerror_r --
+ * POSIX implementation of wiredtiger_strerror_r.
+ */
+int
+__wt_strerror_r(int error, char *buf, size_t buflen)
+{
+ const char *p;
+
+ /* Require at least 2 bytes, printable character and trailing nul. */
+ if (buflen < 2)
+ return (ENOMEM);
+
+ /*
+ * Check for POSIX errors then fallback to something generic. Copy the
+ * string into the user's buffer, return success if anything printed.
+ */
+ p = __wt_strerror(error);
+ if (p != NULL && snprintf(buf, buflen, "%s", p) > 0)
+ return (0);
+
+ /* Fallback to a generic message, then guess it's a memory problem. */
+ return (
+ snprintf(buf, buflen, "error return: %d", error) > 0 ? 0 : ENOMEM);
+}
diff --git a/src/os_posix/os_exist.c b/src/os_posix/os_exist.c
index 723f07026e1..3e51a98766a 100644
--- a/src/os_posix/os_exist.c
+++ b/src/os_posix/os_exist.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_fallocate.c b/src/os_posix/os_fallocate.c
index 899181b41d8..142374702a1 100644
--- a/src/os_posix/os_fallocate.c
+++ b/src/os_posix/os_fallocate.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_filesize.c b/src/os_posix/os_filesize.c
index 3692b135d73..b01fc91514b 100644
--- a/src/os_posix/os_filesize.c
+++ b/src/os_posix/os_filesize.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_flock.c b/src/os_posix/os_flock.c
index e9e653d73e6..69cd367dde3 100644
--- a/src/os_posix/os_flock.c
+++ b/src/os_posix/os_flock.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_fsync.c b/src/os_posix/os_fsync.c
index 8feb78426e2..b0c04e98258 100644
--- a/src/os_posix/os_fsync.c
+++ b/src/os_posix/os_fsync.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_ftruncate.c b/src/os_posix/os_ftruncate.c
index 3f3034de551..ce2527e87e2 100644
--- a/src/os_posix/os_ftruncate.c
+++ b/src/os_posix/os_ftruncate.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_getenv.c b/src/os_posix/os_getenv.c
index 37fe2af8501..e1e0051a120 100644
--- a/src/os_posix/os_getenv.c
+++ b/src/os_posix/os_getenv.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_getline.c b/src/os_posix/os_getline.c
index 7ef4065ac3b..7c4ee8d1746 100644
--- a/src/os_posix/os_getline.c
+++ b/src/os_posix/os_getline.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_getopt.c b/src/os_posix/os_getopt.c
index 1c25521dacd..486d85286bc 100644
--- a/src/os_posix/os_getopt.c
+++ b/src/os_posix/os_getopt.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/os_posix/os_map.c b/src/os_posix/os_map.c
index be4d27e96a3..e95ccb0ade2 100644
--- a/src/os_posix/os_map.c
+++ b/src/os_posix/os_map.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_mtx_cond.c b/src/os_posix/os_mtx_cond.c
index 479a61db795..cf43b630997 100644
--- a/src/os_posix/os_mtx_cond.c
+++ b/src/os_posix/os_mtx_cond.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_mtx_rw.c b/src/os_posix/os_mtx_rw.c
index c6cfa9412a7..4cda976bea8 100644
--- a/src/os_posix/os_mtx_rw.c
+++ b/src/os_posix/os_mtx_rw.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/os_posix/os_once.c b/src/os_posix/os_once.c
index 22eaf5f0ee5..bfe0b9819ac 100644
--- a/src/os_posix/os_once.c
+++ b/src/os_posix/os_once.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_open.c b/src/os_posix/os_open.c
index a0da1952101..e689e9d8dbf 100644
--- a/src/os_posix/os_open.c
+++ b/src/os_posix/os_open.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_path.c b/src/os_posix/os_path.c
index aed99d1d027..07b14b55b44 100644
--- a/src/os_posix/os_path.c
+++ b/src/os_posix/os_path.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_priv.c b/src/os_posix/os_priv.c
index 7d56359da4f..21549cad957 100644
--- a/src/os_posix/os_priv.c
+++ b/src/os_posix/os_priv.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_remove.c b/src/os_posix/os_remove.c
index a52a4db6bc7..371a8e50375 100644
--- a/src/os_posix/os_remove.c
+++ b/src/os_posix/os_remove.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_rename.c b/src/os_posix/os_rename.c
index ddbb59aaf37..811604e7f0f 100644
--- a/src/os_posix/os_rename.c
+++ b/src/os_posix/os_rename.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_rw.c b/src/os_posix/os_rw.c
index 4247fb30fd1..24d6d1aa879 100644
--- a/src/os_posix/os_rw.c
+++ b/src/os_posix/os_rw.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_sleep.c b/src/os_posix/os_sleep.c
index 665330a26e7..64a5f9e56af 100644
--- a/src/os_posix/os_sleep.c
+++ b/src/os_posix/os_sleep.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_strtouq.c b/src/os_posix/os_strtouq.c
index 97f9759f76f..0b7a540959c 100644
--- a/src/os_posix/os_strtouq.c
+++ b/src/os_posix/os_strtouq.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_thread.c b/src/os_posix/os_thread.c
index 7c447710b46..392f997f1ac 100644
--- a/src/os_posix/os_thread.c
+++ b/src/os_posix/os_thread.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_time.c b/src/os_posix/os_time.c
index 56f688a1e14..c52772e77e1 100644
--- a/src/os_posix/os_time.c
+++ b/src/os_posix/os_time.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_yield.c b/src/os_posix/os_yield.c
index 6af30803e81..297ec7deaee 100644
--- a/src/os_posix/os_yield.c
+++ b/src/os_posix/os_yield.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_dir.c b/src/os_win/os_dir.c
index ab332e01186..33489bc2497 100644
--- a/src/os_win/os_dir.c
+++ b/src/os_win/os_dir.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -96,7 +97,7 @@ err:
if (findhandle != INVALID_HANDLE_VALUE)
(void)FindClose(findhandle);
__wt_free(session, path);
- __wt_scr_free(&pathbuf);
+ __wt_scr_free(session, &pathbuf);
if (ret == 0)
return (0);
diff --git a/src/os_win/os_dlopen.c b/src/os_win/os_dlopen.c
index 3fdd0c74b1f..0337c7cc368 100644
--- a/src/os_win/os_dlopen.c
+++ b/src/os_win/os_dlopen.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_errno.c b/src/os_win/os_errno.c
index ce50106b0cc..00ee638fbe3 100644
--- a/src/os_win/os_errno.c
+++ b/src/os_win/os_errno.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -7,6 +8,34 @@
#include "wt_internal.h"
+static const int windows_error_offset = -29000;
+
+/*
+ * __wt_map_error_to_windows_error --
+ * Return a negative integer, an encoded Windows error
+ * Standard C errors are positive integers from 0 - ~200
+ * Windows errors are from 0 - 15999 according to the documentation
+ */
+static DWORD
+__wt_map_error_to_windows_error(int error) {
+ /* Ensure we do not exceed the error range
+ Also validate he do not get any COM errors
+ (which are negative integers)
+ */
+ WT_ASSERT(NULL, error > 0 && error > -(windows_error_offset));
+
+ return (error + -(windows_error_offset));
+}
+
+/*
+ * __wt_map_error_to_windows_error --
+ * Return a positive integer, a decoded Windows error
+ */
+static int
+__wt_map_windows_error_to_error(DWORD winerr) {
+ return (winerr + windows_error_offset);
+}
+
/*
* __wt_errno --
* Return errno, or WT_ERROR if errno not set.
@@ -23,5 +52,73 @@ __wt_errno(void)
/* GetLastError should only be called if we hit an actual error */
WT_ASSERT(NULL, err != ERROR_SUCCESS);
- return (err == ERROR_SUCCESS ? WT_ERROR : err);
+ return (err == ERROR_SUCCESS ?
+ WT_ERROR : __wt_map_windows_error_to_error(err));
+}
+
+/*
+ * __wt_strerror --
+ * Windows implementation of wiredtiger_strerror.
+ */
+const char *
+__wt_strerror(int error)
+{
+ const char *p;
+
+ /*
+ * POSIX errors are non-negative integers; check for 0 explicitly
+ * in-case the underlying strerror doesn't handle 0, some don't.
+ */
+ if (error == 0)
+ return ("Successful return: 0");
+ if (error > 0 && (p = strerror(error)) != NULL)
+ return (p);
+ return (NULL);
+}
+
+/*
+ * __wt_strerror_r --
+ * Windows implementation of wiredtiger_strerror_r.
+ */
+int
+__wt_strerror_r(int error, char *buf, size_t buflen)
+{
+ DWORD lasterror;
+ const char *p;
+
+ /* Require at least 2 bytes, printable character and trailing nul. */
+ if (buflen < 2)
+ return (ENOMEM);
+
+ /*
+ * Check for POSIX errors, Windows errors, then fallback to something
+ * generic. Copy the string into the user's buffer, return success if
+ * anything printed.
+ */
+ p = __wt_strerror(error);
+ if (p != NULL && snprintf(buf, buflen, "%s", p) > 0)
+ return (0);
+
+ if (error < 0) {
+ error = __wt_map_error_to_windows_error(error);
+
+ lasterror = FormatMessageA(
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ error,
+ 0, /* let system choose the correct LANGID */
+ buf,
+ buflen,
+ NULL);
+
+ if (lasterror != 0)
+ return (0);
+
+ /* Fall through to the fallback error code */
+ }
+
+ /* Fallback to a generic message, then guess it's a memory problem. */
+ return (
+ snprintf(buf, buflen, "error return: %d", error) > 0 ? 0 : ENOMEM);
}
diff --git a/src/os_win/os_exist.c b/src/os_win/os_exist.c
index ab3805f19df..747ea7dfc27 100644
--- a/src/os_win/os_exist.c
+++ b/src/os_win/os_exist.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_fallocate.c b/src/os_win/os_fallocate.c
index abe53c23a7b..9d0a86882c6 100644
--- a/src/os_win/os_fallocate.c
+++ b/src/os_win/os_fallocate.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_filesize.c b/src/os_win/os_filesize.c
index 309ee1db40b..dfeadc31fc4 100644
--- a/src/os_win/os_filesize.c
+++ b/src/os_win/os_filesize.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_flock.c b/src/os_win/os_flock.c
index 4b3ca34d65f..d551480ba4d 100644
--- a/src/os_win/os_flock.c
+++ b/src/os_win/os_flock.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_fsync.c b/src/os_win/os_fsync.c
index 31a937f0334..7a01b5cd61d 100644
--- a/src/os_win/os_fsync.c
+++ b/src/os_win/os_fsync.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_ftruncate.c b/src/os_win/os_ftruncate.c
index 5d87f1ce06a..d9b43e4596f 100644
--- a/src/os_win/os_ftruncate.c
+++ b/src/os_win/os_ftruncate.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -16,7 +17,6 @@ __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
{
WT_DECL_RET;
LARGE_INTEGER largeint;
- uint32_t lasterror;
largeint.QuadPart = len;
@@ -31,10 +31,8 @@ __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
return (0);
}
- lasterror = GetLastError();
-
- if (lasterror = ERROR_USER_MAPPED_FILE)
+ if (GetLastError() == ERROR_USER_MAPPED_FILE)
return (EBUSY);
- WT_RET_MSG(session, lasterror, "%s SetEndOfFile error", fh->name);
+ WT_RET_MSG(session, __wt_errno(), "%s SetEndOfFile error", fh->name);
}
diff --git a/src/os_win/os_getenv.c b/src/os_win/os_getenv.c
index 8cc94abb524..9b3a20abad7 100644
--- a/src/os_win/os_getenv.c
+++ b/src/os_win/os_getenv.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_map.c b/src/os_win/os_map.c
index b3b4f0f7501..5c78f371889 100644
--- a/src/os_win/os_map.c
+++ b/src/os_win/os_map.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_mtx_cond.c b/src/os_win/os_mtx_cond.c
index a33ab4e5c37..36de49d1aae 100644
--- a/src/os_win/os_mtx_cond.c
+++ b/src/os_win/os_mtx_cond.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -44,7 +45,6 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, long usecs)
{
WT_DECL_RET;
int locked;
- int lasterror;
int milliseconds;
locked = 0;
WT_ASSERT(session, usecs >= 0);
@@ -81,8 +81,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, long usecs)
&cond->cond, &cond->mtx, INFINITE);
if (ret == 0) {
- lasterror = GetLastError();
- if (lasterror == ERROR_TIMEOUT) {
+ if (GetLastError() == ERROR_TIMEOUT) {
ret = 1;
}
}
diff --git a/src/os_win/os_once.c b/src/os_win/os_once.c
index 40640acf129..179c1bc97f7 100644
--- a/src/os_win/os_once.c
+++ b/src/os_win/os_once.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_open.c b/src/os_win/os_open.c
index f9d47c5be5d..387c7d2597b 100644
--- a/src/os_win/os_open.c
+++ b/src/os_win/os_open.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_path.c b/src/os_win/os_path.c
index 9f6b79c565c..89f05e238c4 100644
--- a/src/os_win/os_path.c
+++ b/src/os_win/os_path.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_priv.c b/src/os_win/os_priv.c
index 7b5152b4652..b5dc1eb55fe 100644
--- a/src/os_win/os_priv.c
+++ b/src/os_win/os_priv.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_remove.c b/src/os_win/os_remove.c
index d15ee929c00..fbf564877da 100644
--- a/src/os_win/os_remove.c
+++ b/src/os_win/os_remove.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_rename.c b/src/os_win/os_rename.c
index 092f5d62a40..a0f33843218 100644
--- a/src/os_win/os_rename.c
+++ b/src/os_win/os_rename.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -32,13 +33,13 @@ __wt_rename(WT_SESSION_IMPL *session, const char *from, const char *to)
*/
if ((ret = GetFileAttributesA(to_path)) != INVALID_FILE_ATTRIBUTES) {
if ((ret = DeleteFileA(to_path)) == FALSE) {
- lasterror = GetLastError();
+ lasterror = __wt_errno();
goto err;
}
}
if ((MoveFileA(from_path, to_path)) == FALSE)
- lasterror = GetLastError();
+ lasterror = __wt_errno();
err:
__wt_free(session, from_path);
diff --git a/src/os_win/os_rw.c b/src/os_win/os_rw.c
index 291533bc6bc..bafefcfba24 100644
--- a/src/os_win/os_rw.c
+++ b/src/os_win/os_rw.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_sleep.c b/src/os_win/os_sleep.c
index b9a8cc2e545..9f8eafec903 100644
--- a/src/os_win/os_sleep.c
+++ b/src/os_win/os_sleep.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_snprintf.c b/src/os_win/os_snprintf.c
index 70a11b84850..ebb14fd32e8 100644
--- a/src/os_win/os_snprintf.c
+++ b/src/os_win/os_snprintf.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_thread.c b/src/os_win/os_thread.c
index 4d8cf89f264..3ecfe2796d5 100644
--- a/src/os_win/os_thread.c
+++ b/src/os_win/os_thread.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_time.c b/src/os_win/os_time.c
index b49b738fe54..30fde045c54 100644
--- a/src/os_win/os_time.c
+++ b/src/os_win/os_time.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_vsnprintf.c b/src/os_win/os_vsnprintf.c
index 055a45e5862..205b63751c7 100644
--- a/src/os_win/os_vsnprintf.c
+++ b/src/os_win/os_vsnprintf.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_yield.c b/src/os_win/os_yield.c
index 970bfa139d0..dd3eb67de8b 100644
--- a/src/os_win/os_yield.c
+++ b/src/os_win/os_yield.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/packing/pack_api.c b/src/packing/pack_api.c
index c0c1e53c8ca..efe999505bf 100644
--- a/src/packing/pack_api.c
+++ b/src/packing/pack_api.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/packing/pack_impl.c b/src/packing/pack_impl.c
index 12b1582e6d0..0b699814fc1 100644
--- a/src/packing/pack_impl.c
+++ b/src/packing/pack_impl.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/packing/pack_stream.c b/src/packing/pack_stream.c
index a35a3555458..739e803b88c 100644
--- a/src/packing/pack_stream.c
+++ b/src/packing/pack_stream.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/reconcile/rec_track.c b/src/reconcile/rec_track.c
index fdf8ee6d68b..695b167f816 100644
--- a/src/reconcile/rec_track.c
+++ b/src/reconcile/rec_track.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -48,7 +49,7 @@ __ovfl_discard_verbose(
page,
__wt_addr_string(session, unpack->data, unpack->size, tmp)));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -188,7 +189,7 @@ __ovfl_reuse_verbose(WT_SESSION_IMPL *session,
F_ISSET(reuse, WT_OVFL_REUSE_JUST_ADDED) ? "just-added" : "",
WT_MIN(reuse->value_size, 40), (char *)WT_OVFL_REUSE_VALUE(reuse)));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -579,7 +580,7 @@ __ovfl_txnc_verbose(WT_SESSION_IMPL *session,
txnc->current,
WT_MIN(txnc->value_size, 40), (char *)WT_OVFL_TXNC_VALUE(txnc)));
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 6ce8247c2d4..5c3ed614850 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -1879,7 +1880,7 @@ __rec_split_row_promote(
}
ret = __wt_buf_set(session, key, r->cur->data, size);
-err: __wt_scr_free(&update);
+err: __wt_scr_free(session, &update);
return (ret);
}
@@ -2502,7 +2503,7 @@ __rec_raw_decompress(
WT_ASSERT(session, __wt_verify_dsk_image(
session, "[raw evict split]", tmp->data, dsk->mem_size, 0) == 0);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -2672,7 +2673,7 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r)
r->space_avail =
r->split_size - (WT_PAGE_HEADER_BYTE_SIZE(btree) + len);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -2861,7 +2862,7 @@ skip_check_complete:
bnd->addr.size = (uint8_t)addr_size;
done:
-err: __wt_scr_free(&key);
+err: __wt_scr_free(session, &key);
return (ret);
}
@@ -3915,7 +3916,7 @@ compare: /*
/* Write the remnant page. */
ret = __rec_split_finish(session, r);
-err: __wt_scr_free(&orig);
+err: __wt_scr_free(session, &orig);
return (ret);
}
@@ -4564,8 +4565,8 @@ leaf_insert: /* Write any K/V pairs inserted into the page after this key. */
/* Write the remnant page. */
ret = __rec_split_finish(session, r);
-err: __wt_scr_free(&tmpkey);
- __wt_scr_free(&tmpval);
+err: __wt_scr_free(session, &tmpkey);
+ __wt_scr_free(session, &tmpval);
return (ret);
}
@@ -4919,7 +4920,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
break;
WT_ILLEGAL_VALUE_ERR(session);
}
-err: __wt_scr_free(&tkey);
+err: __wt_scr_free(session, &tkey);
WT_RET(ret);
}
if (r->bnd_next > r->bnd_next_max) {
@@ -5402,7 +5403,7 @@ __rec_cell_build_ovfl(WT_SESSION_IMPL *session,
kv->cell_len = __wt_cell_pack_ovfl(&kv->cell, type, rle, kv->buf.size);
kv->len = kv->cell_len + kv->buf.size;
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/schema/schema_create.c b/src/schema/schema_create.c
index 7a1cf757093..c0f4f4bb57e 100644
--- a/src/schema/schema_create.c
+++ b/src/schema/schema_create.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -122,7 +123,7 @@ __create_file(WT_SESSION_IMPL *session,
else
WT_ERR(__wt_session_release_btree(session));
-err: __wt_scr_free(&val);
+err: __wt_scr_free(session, &val);
__wt_free(session, fileconf);
return (ret);
}
diff --git a/src/schema/schema_drop.c b/src/schema/schema_drop.c
index 9a74b26ffec..dfac4a172ef 100644
--- a/src/schema/schema_drop.c
+++ b/src/schema/schema_drop.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_list.c b/src/schema/schema_list.c
index 1fbc52821a6..9d70e5b943a 100644
--- a/src/schema/schema_list.c
+++ b/src/schema/schema_list.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_open.c b/src/schema/schema_open.c
index 4699fdeee02..d613ced00aa 100644
--- a/src/schema/schema_open.c
+++ b/src/schema/schema_open.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -113,7 +114,7 @@ __wt_schema_open_colgroups(WT_SESSION_IMPL *session, WT_TABLE *table)
table->cg_complete = 1;
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
if (colgroup != NULL)
__wt_schema_destroy_colgroup(session, colgroup);
if (cgconfig != NULL)
@@ -241,8 +242,8 @@ __open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
table, table->colconf.str, table->colconf.len, 1, plan));
WT_ERR(__wt_strndup(session, plan->data, plan->size, &idx->value_plan));
-err: __wt_scr_free(&buf);
- __wt_scr_free(&plan);
+err: __wt_scr_free(session, &buf);
+ __wt_scr_free(session, &plan);
return (ret);
}
@@ -326,6 +327,13 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
table->indices[i] = idx;
idx = NULL;
+
+ /*
+ * If the slot is bigger than anything else we've seen,
+ * bump the number of indices.
+ */
+ if (i >= table->nindices)
+ table->nindices = i + 1;
}
/* If we were looking for a single index, we're done. */
@@ -342,7 +350,7 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
table->idx_complete = 1;
}
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
if (idx != NULL)
WT_TRET(__wt_schema_destroy_index(session, idx));
if (cursor != NULL)
@@ -462,7 +470,7 @@ err: if (table != NULL)
WT_TRET(cursor->close(cursor));
__wt_free(session, tablename);
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/schema/schema_plan.c b/src/schema/schema_plan.c
index efd5f8d69b7..918cbe68fcc 100644
--- a/src/schema/schema_plan.c
+++ b/src/schema/schema_plan.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_project.c b/src/schema/schema_project.c
index 9aff4c8dded..c9b69b3c922 100644
--- a/src/schema/schema_project.c
+++ b/src/schema/schema_project.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_rename.c b/src/schema/schema_rename.c
index 549ccd130e5..38124754cd5 100644
--- a/src/schema/schema_rename.c
+++ b/src/schema/schema_rename.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -163,10 +164,10 @@ __rename_tree(WT_SESSION_IMPL *session,
/* Rename the file. */
WT_ERR(__wt_schema_rename(session, os->data, ns->data, cfg));
-err: __wt_scr_free(&nn);
- __wt_scr_free(&ns);
- __wt_scr_free(&nv);
- __wt_scr_free(&os);
+err: __wt_scr_free(session, &nn);
+ __wt_scr_free(session, &ns);
+ __wt_scr_free(session, &nv);
+ __wt_scr_free(session, &os);
__wt_free(session, value);
table->name = olduri;
return (ret);
diff --git a/src/schema/schema_stat.c b/src/schema/schema_stat.c
index 06b3ac5ca6e..dea797f823d 100644
--- a/src/schema/schema_stat.c
+++ b/src/schema/schema_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -25,7 +26,7 @@ __wt_curstat_colgroup_init(WT_SESSION_IMPL *session,
WT_ERR(__wt_buf_fmt(session, buf, "statistics:%s", colgroup->source));
ret = __wt_curstat_init(session, buf->data, cfg, cst);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
@@ -47,7 +48,7 @@ __wt_curstat_index_init(WT_SESSION_IMPL *session,
WT_ERR(__wt_buf_fmt(session, buf, "statistics:%s", idx->source));
ret = __wt_curstat_init(session, buf->data, cfg, cst);
-err: __wt_scr_free(&buf);
+err: __wt_scr_free(session, &buf);
return (ret);
}
@@ -109,6 +110,6 @@ __wt_curstat_table_init(WT_SESSION_IMPL *session,
err: __wt_schema_release_table(session, table);
- __wt_scr_free(&buf);
+ __wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/schema/schema_truncate.c b/src/schema/schema_truncate.c
index 6fca7628cae..383e860cc7b 100644
--- a/src/schema/schema_truncate.c
+++ b/src/schema/schema_truncate.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_util.c b/src/schema/schema_util.c
index 263f56f1c41..1e810e8adc9 100644
--- a/src/schema/schema_util.c
+++ b/src/schema/schema_util.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -79,6 +80,6 @@ __wt_name_check(WT_SESSION_IMPL *session, const char *str, size_t len)
ret = __wt_str_name_check(session, tmp->data);
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/schema/schema_worker.c b/src/schema/schema_worker.c
index 7660a9b5054..94eb3170175 100644
--- a/src/schema/schema_worker.c
+++ b/src/schema/schema_worker.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/session/session_api.c b/src/session/session_api.c
index 0effc1a7248..3ab5e0acab1 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/session/session_compact.c b/src/session/session_compact.c
index 6eca8a58d13..acb8b730a7d 100644
--- a/src/session/session_compact.c
+++ b/src/session/session_compact.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -194,7 +195,7 @@ __compact_file(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
WT_ERR(__session_compact_check_timeout(session, start_time));
}
-err: __wt_scr_free(&t);
+err: __wt_scr_free(session, &t);
return (ret);
}
diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
index 85483c7c8ae..13af615930b 100644
--- a/src/session/session_dhandle.c
+++ b/src/session/session_dhandle.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/session/session_salvage.c b/src/session/session_salvage.c
index 1512c6515ec..07f68e4c194 100644
--- a/src/session/session_salvage.c
+++ b/src/session/session_salvage.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/cksum.c b/src/support/cksum.c
index fc4725bcfbc..a8b5823100d 100644
--- a/src/support/cksum.c
+++ b/src/support/cksum.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/err.c b/src/support/err.c
index 25f190bf1e2..d766fcba33a 100644
--- a/src/support/err.c
+++ b/src/support/err.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/filename.c b/src/support/filename.c
index bd5d03fa633..6d65cdf9ada 100644
--- a/src/support/filename.c
+++ b/src/support/filename.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/global.c b/src/support/global.c
index a7d5b9a9df5..5ddd291c6d4 100644
--- a/src/support/global.c
+++ b/src/support/global.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/hash_city.c b/src/support/hash_city.c
index c6978f6bfe6..9a4a6464f40 100644
--- a/src/support/hash_city.c
+++ b/src/support/hash_city.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/hash_fnv.c b/src/support/hash_fnv.c
index 68f8537a4a0..e780931454d 100644
--- a/src/support/hash_fnv.c
+++ b/src/support/hash_fnv.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/hazard.c b/src/support/hazard.c
index 12350ab52f4..4b8b916b121 100644
--- a/src/support/hazard.c
+++ b/src/support/hazard.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/hex.c b/src/support/hex.c
index 9ee3e723fa2..eb9f420911a 100644
--- a/src/support/hex.c
+++ b/src/support/hex.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/huffman.c b/src/support/huffman.c
index 9625e879381..48b31b5e299 100644
--- a/src/support/huffman.c
+++ b/src/support/huffman.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -686,7 +687,7 @@ __wt_huffman_encode(WT_SESSION_IMPL *session, void *huffman_arg,
max_len, outlen);
#endif
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -809,7 +810,7 @@ __wt_huffman_decode(WT_SESSION_IMPL *session, void *huffman_arg,
max_len, outlen);
#endif
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
diff --git a/src/support/mutex.c b/src/support/mutex.c
index ffe52cf28fd..c35656051f6 100644
--- a/src/support/mutex.c
+++ b/src/support/mutex.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/pow.c b/src/support/pow.c
index a6bf6c7227f..8e42113a2ee 100644
--- a/src/support/pow.c
+++ b/src/support/pow.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/rand.c b/src/support/rand.c
index b716eb8c58b..bd51b2ea0d5 100644
--- a/src/support/rand.c
+++ b/src/support/rand.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/scratch.c b/src/support/scratch.c
index e4df04a36ed..957101b8fae 100644
--- a/src/support/scratch.c
+++ b/src/support/scratch.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -179,8 +180,7 @@ __wt_scr_alloc_func(WT_SESSION_IMPL *session, size_t size, WT_ITEM **scratchp
* or the largest buffer if none are large enough.
*/
if (best == NULL ||
- ((*best)->memsize < size &&
- buf->memsize > (*best)->memsize) ||
+ (buf->memsize <= size && buf->memsize > (*best)->memsize) ||
(buf->memsize >= size && buf->memsize < (*best)->memsize))
best = p;
@@ -209,7 +209,7 @@ __wt_scr_alloc_func(WT_SESSION_IMPL *session, size_t size, WT_ITEM **scratchp
}
/*
- * If slot is non-NULL, we found an empty slot, try and allocate a
+ * If slot is non-NULL, we found an empty slot, try to allocate a
* buffer.
*/
if (best == NULL) {
@@ -223,6 +223,7 @@ __wt_scr_alloc_func(WT_SESSION_IMPL *session, size_t size, WT_ITEM **scratchp
}
/* Grow the buffer as necessary and return. */
+ session->scratch_cached -= (*best)->memsize;
WT_ERR(__wt_buf_init(session, *best, size));
F_SET(*best, WT_ITEM_INUSE);
diff --git a/src/support/stat.c b/src/support/stat.c
index 265a2673d7c..f4ae082add3 100644
--- a/src/support/stat.c
+++ b/src/support/stat.c
@@ -367,6 +367,8 @@ __wt_stat_init_connection_stats(WT_CONNECTION_STATS *stats)
stats->cache_inmem_split.desc = "cache: in-memory page splits";
stats->cache_eviction_internal.desc = "cache: internal pages evicted";
stats->cache_bytes_max.desc = "cache: maximum bytes configured";
+ stats->cache_eviction_maximum_page_size.desc =
+ "cache: maximum page size at eviction";
stats->cache_eviction_dirty.desc = "cache: modified pages evicted";
stats->cache_eviction_deepen.desc =
"cache: page split during eviction deepened the tree";
@@ -480,6 +482,16 @@ __wt_stat_init_connection_stats(WT_CONNECTION_STATS *stats)
"reconciliation: split objects currently awaiting free";
stats->session_cursor_open.desc = "session: open cursor count";
stats->session_open.desc = "session: open session count";
+ stats->page_busy_blocked.desc =
+ "thread-yield: page acquire busy blocked";
+ stats->page_forcible_evict_blocked.desc =
+ "thread-yield: page acquire eviction blocked";
+ stats->page_locked_blocked.desc =
+ "thread-yield: page acquire locked blocked";
+ stats->page_read_blocked.desc =
+ "thread-yield: page acquire read blocked";
+ stats->page_sleep.desc =
+ "thread-yield: page acquire time sleeping (usecs)";
stats->txn_begin.desc = "transaction: transaction begins";
stats->txn_checkpoint_running.desc =
"transaction: transaction checkpoint currently running";
@@ -538,6 +550,7 @@ __wt_stat_refresh_connection_stats(void *stats_arg)
stats->cache_eviction_hazard.v = 0;
stats->cache_inmem_split.v = 0;
stats->cache_eviction_internal.v = 0;
+ stats->cache_eviction_maximum_page_size.v = 0;
stats->cache_eviction_dirty.v = 0;
stats->cache_eviction_deepen.v = 0;
stats->cache_eviction_force.v = 0;
@@ -608,6 +621,11 @@ __wt_stat_refresh_connection_stats(void *stats_arg)
stats->lsm_work_queue_max.v = 0;
stats->rec_pages.v = 0;
stats->rec_pages_eviction.v = 0;
+ stats->page_busy_blocked.v = 0;
+ stats->page_forcible_evict_blocked.v = 0;
+ stats->page_locked_blocked.v = 0;
+ stats->page_read_blocked.v = 0;
+ stats->page_sleep.v = 0;
stats->txn_begin.v = 0;
stats->txn_checkpoint.v = 0;
stats->txn_fail_cache.v = 0;
diff --git a/src/txn/txn.c b/src/txn/txn.c
index d6aa483c18a..fd80efd5ebd 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -530,9 +531,8 @@ __wt_txn_global_init(WT_SESSION_IMPL *session, const char *cfg[])
conn = S2C(session);
txn_global = &conn->txn_global;
- txn_global->current = 1;
- txn_global->oldest_id = 1;
- txn_global->last_running = 1;
+ txn_global->current = txn_global->last_running =
+ txn_global->oldest_id = WT_TXN_FIRST;
WT_RET(__wt_calloc_def(
session, conn->session_size, &txn_global->states));
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index fe9c9eaf89e..0cd341185f2 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -162,7 +163,7 @@ __checkpoint_apply_all(WT_SESSION_IMPL *session, const char *cfg[],
if (fullp != NULL)
*fullp = !target_list;
-err: __wt_scr_free(&tmp);
+err: __wt_scr_free(session, &tmp);
return (ret);
}
@@ -593,21 +594,29 @@ __checkpoint_worker(
WT_DECL_RET;
WT_LSN ckptlsn;
const char *name;
- int deleted, force, hot_backup_locked, track_ckpt, was_modified;
+ int deleted, fake_ckpt, force, hot_backup_locked, was_modified;
char *name_alloc;
btree = S2BT(session);
bm = btree->bm;
conn = S2C(session);
ckpt = ckptbase = NULL;
- INIT_LSN(&ckptlsn);
dhandle = session->dhandle;
name_alloc = NULL;
hot_backup_locked = 0;
name_alloc = NULL;
- track_ckpt = 1;
+ fake_ckpt = 0;
was_modified = btree->modified;
+ /*
+ * Set the checkpoint LSN to the maximum LSN so that if logging is
+ * disabled, recovery will never roll old changes forward over the
+ * non-logged changes in this checkpoint. If logging is enabled, a
+ * real checkpoint LSN will be assigned later for this checkpoint and
+ * overwrite this.
+ */
+ WT_MAX_LSN(&ckptlsn);
+
/* Get the list of checkpoints for this file. */
WT_RET(__wt_meta_ckptlist_get(session, dhandle->name, &ckptbase));
@@ -814,7 +823,7 @@ __checkpoint_worker(
WT_ERR_MSG(session, ret,
"block-manager checkpoint found "
"for a bulk-loaded file");
- track_ckpt = 0;
+ fake_ckpt = 1;
goto fake;
case WT_BTREE_SALVAGE:
case WT_BTREE_UPGRADE:
@@ -839,7 +848,7 @@ __checkpoint_worker(
*/
if (is_checkpoint)
if (btree->bulk_load_ok) {
- track_ckpt = 0;
+ fake_ckpt = 1;
goto fake;
}
@@ -888,7 +897,15 @@ __checkpoint_worker(
if (F_ISSET(ckpt, WT_CKPT_ADD))
ckpt->write_gen = btree->write_gen;
-fake: /* Update the object's metadata. */
+fake: /*
+ * If we're faking a checkpoint and logging is enabled, recovery should
+ * roll forward any changes made between now and the next checkpoint,
+ * so set the checkpoint LSN to the beginning of time.
+ */
+ if (fake_ckpt && FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED))
+ WT_INIT_LSN(&ckptlsn);
+
+ /* Update the object's metadata. */
WT_ERR(__wt_meta_ckptlist_set(
session, dhandle->name, ckptbase, &ckptlsn));
@@ -899,7 +916,7 @@ fake: /* Update the object's metadata. */
* is being discarded, in which case the handle will be gone by the
* time we try to apply or unroll the meta tracking event.
*/
- if (track_ckpt) {
+ if (!fake_ckpt) {
if (WT_META_TRACKING(session) && is_checkpoint)
WT_ERR(__wt_meta_track_checkpoint(session));
else
diff --git a/src/txn/txn_ext.c b/src/txn/txn_ext.c
index 31d5506be5b..e35b6f16ea1 100644
--- a/src/txn/txn_ext.c
+++ b/src/txn/txn_ext.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/txn/txn_log.c b/src/txn/txn_log.c
index ae7641020be..f66bd7e09c8 100644
--- a/src/txn/txn_log.c
+++ b/src/txn/txn_log.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -66,9 +67,22 @@ static int
__txn_commit_printlog(
WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
+ int firstrecord;
+
+ firstrecord = 1;
+
/* The logging subsystem zero-pads records. */
- while (*pp < end && **pp)
+ while (*pp < end && **pp) {
+ if (!firstrecord)
+ fprintf(out, ",\n");
+
+ firstrecord = 0;
+
WT_RET(__wt_txn_op_printlog(session, pp, end, out));
+ }
+
+ fprintf(out, "\n");
+
return (0);
}
@@ -332,9 +346,9 @@ __wt_txn_checkpoint_log(
/* FALLTHROUGH */
case WT_TXN_LOG_CKPT_FAIL:
/* Cleanup any allocated resources */
- INIT_LSN(ckpt_lsn);
+ WT_INIT_LSN(ckpt_lsn);
txn->ckpt_nsnapshot = 0;
- __wt_scr_free(&txn->ckpt_snapshot);
+ __wt_scr_free(session, &txn->ckpt_snapshot);
txn->full_ckpt = 0;
break;
}
@@ -412,8 +426,8 @@ __wt_txn_truncate_end(WT_SESSION_IMPL *session)
* Print a log record in a human-readable format.
*/
static int
-__txn_printlog(
- WT_SESSION_IMPL *session, WT_ITEM *rawrec, WT_LSN *lsnp, void *cookie)
+__txn_printlog(WT_SESSION_IMPL *session,
+ WT_ITEM *rawrec, WT_LSN *lsnp, void *cookie, int firstrecord)
{
FILE *out;
WT_LOG_RECORD *logrec;
@@ -435,6 +449,9 @@ __txn_printlog(
/* First, peek at the log record type. */
WT_RET(__wt_logrec_read(session, &p, end, &rectype));
+ if (!firstrecord)
+ fprintf(out, ",\n");
+
if (fprintf(out, " { \"lsn\" : [%" PRIu32 ",%" PRId64 "],\n",
lsnp->file, lsnp->offset) < 0 ||
fprintf(out, " \"hdr_flags\" : \"%s\",\n",
@@ -448,16 +465,16 @@ __txn_printlog(
case WT_LOGREC_CHECKPOINT:
WT_RET(__wt_struct_unpack(session, p, WT_PTRDIFF(end, p),
WT_UNCHECKED_STRING(IQ), &ckpt_lsn.file, &ckpt_lsn.offset));
- if (fprintf(out, " \"type\" : \"checkpoint\"\n") < 0 ||
+ if (fprintf(out, " \"type\" : \"checkpoint\",\n") < 0 ||
fprintf(
- out, " \"ckpt_lsn\" : [%" PRIu32 ",%" PRId64 "],\n",
+ out, " \"ckpt_lsn\" : [%" PRIu32 ",%" PRId64 "]\n",
ckpt_lsn.file, ckpt_lsn.offset) < 0)
return (errno);
break;
case WT_LOGREC_COMMIT:
WT_RET(__wt_vunpack_uint(&p, WT_PTRDIFF(end, p), &txnid));
- if (fprintf(out, " \"type\" : \"commit\"\n") < 0 ||
+ if (fprintf(out, " \"type\" : \"commit\",\n") < 0 ||
fprintf(out, " \"txnid\" : %" PRIu64 ",\n", txnid) < 0)
return (errno);
WT_RET(__txn_commit_printlog(session, &p, end, out));
@@ -466,8 +483,8 @@ __txn_printlog(
case WT_LOGREC_FILE_SYNC:
WT_RET(__wt_struct_unpack(session, p, WT_PTRDIFF(end, p),
WT_UNCHECKED_STRING(Ii), &fileid, &start));
- if (fprintf(out, " \"type\" : \"file_sync\"\n") < 0 ||
- fprintf(out, " \"fileid\" : %" PRIu32 "\n",
+ if (fprintf(out, " \"type\" : \"file_sync\",\n") < 0 ||
+ fprintf(out, " \"fileid\" : %" PRIu32 ",\n",
fileid) < 0 ||
fprintf(out, " \"start\" : %" PRId32 "\n", start) < 0)
return (errno);
@@ -476,13 +493,13 @@ __txn_printlog(
case WT_LOGREC_MESSAGE:
WT_RET(__wt_struct_unpack(session, p, WT_PTRDIFF(end, p),
WT_UNCHECKED_STRING(S), &msg));
- if (fprintf(out, " \"type\" : \"message\"\n") < 0 ||
+ if (fprintf(out, " \"type\" : \"message\",\n") < 0 ||
fprintf(out, " \"message\" : \"%s\"\n", msg) < 0)
return (errno);
break;
}
- if (fprintf(out, " },\n") < 0)
+ if (fprintf(out, " }") < 0)
return (errno);
return (0);
@@ -503,7 +520,7 @@ __wt_txn_printlog(WT_SESSION *wt_session, FILE *out)
return (errno);
WT_RET(__wt_log_scan(
session, NULL, WT_LOGSCAN_FIRST, __txn_printlog, out));
- if (fprintf(out, "]\n") < 0)
+ if (fprintf(out, "\n]\n") < 0)
return (errno);
return (0);
diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c
index fb1c7abf742..b2515e3c8cd 100644
--- a/src/txn/txn_recover.c
+++ b/src/txn/txn_recover.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -265,8 +266,8 @@ __txn_commit_apply(
* Roll the log forward to recover committed changes.
*/
static int
-__txn_log_recover(
- WT_SESSION_IMPL *session, WT_ITEM *logrec, WT_LSN *lsnp, void *cookie)
+__txn_log_recover(WT_SESSION_IMPL *session,
+ WT_ITEM *logrec, WT_LSN *lsnp, void *cookie, int firstrecord)
{
WT_RECOVERY *r;
const uint8_t *end, *p;
@@ -276,6 +277,7 @@ __txn_log_recover(
r = cookie;
p = LOG_SKIP_HEADER(logrec->data);
end = (const uint8_t *)logrec->data + logrec->size;
+ WT_UNUSED(firstrecord);
/* First, peek at the log record type. */
WT_RET(__wt_logrec_read(session, &p, end, &rectype));
@@ -322,7 +324,7 @@ __recovery_setup_file(WT_RECOVERY *r, const char *uri, const char *config)
__wt_config_getones(r->session, config, "checkpoint_lsn", &cval));
/* If there is checkpoint logged for the file, apply everything. */
if (cval.type != WT_CONFIG_ITEM_STRUCT)
- INIT_LSN(&lsn);
+ WT_INIT_LSN(&lsn);
else if (sscanf(cval.str, "(%" PRIu32 ",%" PRIdMAX ")",
&lsn.file, (intmax_t*)&lsn.offset) != 2)
WT_RET_MSG(r->session, EINVAL,
@@ -394,9 +396,7 @@ __recovery_file_scan(WT_RECOVERY *r)
}
WT_ERR_NOTFOUND_OK(ret);
-err: if (r->nfiles > r->max_fileid)
- r->max_fileid = r->nfiles;
- return (ret);
+err: return (ret);
}
/*
@@ -404,18 +404,19 @@ err: if (r->nfiles > r->max_fileid)
* Run recovery.
*/
int
-__wt_txn_recover(WT_CONNECTION_IMPL *conn)
+__wt_txn_recover(WT_SESSION_IMPL *session)
{
+ WT_CONNECTION_IMPL *conn;
WT_CURSOR *metac;
WT_DECL_RET;
WT_RECOVERY r;
- WT_SESSION_IMPL *session;
struct WT_RECOVERY_FILE *metafile;
char *config;
int was_backup;
+ conn = S2C(session);
WT_CLEAR(r);
- INIT_LSN(&r.ckpt_lsn);
+ WT_INIT_LSN(&r.ckpt_lsn);
was_backup = F_ISSET(conn, WT_CONN_WAS_BACKUP) ? 1 : 0;
/* We need a real session for recovery. */
@@ -430,13 +431,25 @@ __wt_txn_recover(WT_CONNECTION_IMPL *conn)
metafile->c = metac;
/*
+ * If no log was found (including if logging is disabled), or if the
+ * last checkpoint was done with logging disabled, recovery should not
+ * run. Scan the metadata to figure out the largest file ID.
+ */
+ if (!FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_EXISTED) ||
+ WT_IS_MAX_LSN(&metafile->ckpt_lsn)) {
+ WT_ERR(__recovery_file_scan(&r));
+ conn->next_file_id = r.max_fileid;
+ goto done;
+ }
+
+ /*
* First, do a pass through the log to recover the metadata, and
* establish the last checkpoint LSN. Skip this when opening a hot
* backup: we already have the correct metadata in that case.
*/
if (!was_backup) {
r.metadata_only = 1;
- if (IS_INIT_LSN(&metafile->ckpt_lsn))
+ if (WT_IS_INIT_LSN(&metafile->ckpt_lsn))
WT_ERR(__wt_log_scan(session,
NULL, WT_LOGSCAN_FIRST, __txn_log_recover, &r));
else
@@ -465,7 +478,7 @@ __wt_txn_recover(WT_CONNECTION_IMPL *conn)
WT_ERR(__wt_verbose(session, WT_VERB_RECOVERY,
"Main recovery loop: starting at %u/%" PRIuMAX,
r.ckpt_lsn.file, (uintmax_t)r.ckpt_lsn.offset));
- if (IS_INIT_LSN(&r.ckpt_lsn))
+ if (WT_IS_INIT_LSN(&r.ckpt_lsn))
WT_ERR(__wt_log_scan(session, NULL,
WT_LOGSCAN_FIRST | WT_LOGSCAN_RECOVER,
__txn_log_recover, &r));
@@ -483,6 +496,7 @@ __wt_txn_recover(WT_CONNECTION_IMPL *conn)
*/
WT_ERR(session->iface.checkpoint(&session->iface, "force=1"));
+done:
err: WT_TRET(__recovery_free(&r));
__wt_free(session, config);
WT_TRET(session->iface.close(&session->iface, NULL));
diff --git a/src/utilities/util.h b/src/utilities/util.h
index 1f2f0b7211a..aaf68159c68 100644
--- a/src/utilities/util.h
+++ b/src/utilities/util.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_backup.c b/src/utilities/util_backup.c
index aa61cc338f0..cd81cd9bfb5 100644
--- a/src/utilities/util_backup.c
+++ b/src/utilities/util_backup.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_compact.c b/src/utilities/util_compact.c
index 51d5461e43c..633a92df04a 100644
--- a/src/utilities/util_compact.c
+++ b/src/utilities/util_compact.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_cpyright.c b/src/utilities/util_cpyright.c
index 7cb47c68464..df135b68d2c 100644
--- a/src/utilities/util_cpyright.c
+++ b/src/utilities/util_cpyright.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -10,7 +11,7 @@
void
util_copyright(void)
{
- printf("%s\n", "Copyright (c) 2008-2014 WiredTiger, Inc.");
+ printf("%s\n", "Copyright (c) 2008-2015 MongoDB, Inc.");
printf("%s\n\n", "All rights reserved.");
printf("%s\n\n",
diff --git a/src/utilities/util_create.c b/src/utilities/util_create.c
index ebff3a8ad05..94ef8f4e3cb 100644
--- a/src/utilities/util_create.c
+++ b/src/utilities/util_create.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_drop.c b/src/utilities/util_drop.c
index 6fe416882a3..15f6ea1be0c 100644
--- a/src/utilities/util_drop.c
+++ b/src/utilities/util_drop.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c
index fd99d711459..f7d14209fa4 100644
--- a/src/utilities/util_dump.c
+++ b/src/utilities/util_dump.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_list.c b/src/utilities/util_list.c
index 4a1489628d1..c7f05a5435f 100644
--- a/src/utilities/util_list.c
+++ b/src/utilities/util_list.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_load.c b/src/utilities/util_load.c
index 454699381c4..0083fab4bd8 100644
--- a/src/utilities/util_load.c
+++ b/src/utilities/util_load.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_load.h b/src/utilities/util_load.h
index 7bca677e178..43ae1ce63b0 100644
--- a/src/utilities/util_load.h
+++ b/src/utilities/util_load.h
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_load_json.c b/src/utilities/util_load_json.c
index fb61df9ab16..7ccabf87010 100644
--- a/src/utilities/util_load_json.c
+++ b/src/utilities/util_load_json.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_loadtext.c b/src/utilities/util_loadtext.c
index 27c4c23b50c..cb84fb03d13 100644
--- a/src/utilities/util_loadtext.c
+++ b/src/utilities/util_loadtext.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_main.c b/src/utilities/util_main.c
index 04ab59f1ca9..ecfffb81e4b 100644
--- a/src/utilities/util_main.c
+++ b/src/utilities/util_main.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_misc.c b/src/utilities/util_misc.c
index 71e307a2e0e..15605362b50 100644
--- a/src/utilities/util_misc.c
+++ b/src/utilities/util_misc.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_printlog.c b/src/utilities/util_printlog.c
index 7fc9bfa39b0..ff9210b575f 100644
--- a/src/utilities/util_printlog.c
+++ b/src/utilities/util_printlog.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_read.c b/src/utilities/util_read.c
index d9a629e40e2..de6b8adb5c2 100644
--- a/src/utilities/util_read.c
+++ b/src/utilities/util_read.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_rename.c b/src/utilities/util_rename.c
index 8c2aeb30c59..e5fda06b310 100644
--- a/src/utilities/util_rename.c
+++ b/src/utilities/util_rename.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_salvage.c b/src/utilities/util_salvage.c
index 386365d8875..dc8affcb1d9 100644
--- a/src/utilities/util_salvage.c
+++ b/src/utilities/util_salvage.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_stat.c b/src/utilities/util_stat.c
index caac560e839..2f99214e57a 100644
--- a/src/utilities/util_stat.c
+++ b/src/utilities/util_stat.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -15,16 +16,26 @@ util_stat(WT_SESSION *session, int argc, char *argv[])
WT_CURSOR *cursor;
WT_DECL_RET;
size_t urilen;
- int all, ch, objname_free;
- const char *pval, *desc;
+ int ch, objname_free;
+ const char *config, *pval, *desc;
char *objname, *uri;
- all = objname_free = 0;
+ objname_free = 0;
objname = uri = NULL;
- while ((ch = __wt_getopt(progname, argc, argv, "a")) != EOF)
+ config = NULL;
+ while ((ch = __wt_getopt(progname, argc, argv, "af")) != EOF)
switch (ch) {
case 'a':
- all = 1;
+ /*
+ * Historically, the -a option meant include all of the
+ * statistics; because we are opening the database with
+ * statistics=(all), that is now the default, allow the
+ * option for compatibility.
+ */
+ config = NULL;
+ break;
+ case 'f':
+ config = "statistics=(fast)";
break;
case '?':
default:
@@ -58,8 +69,9 @@ util_stat(WT_SESSION *session, int argc, char *argv[])
}
snprintf(uri, urilen, "statistics:%s", objname);
- if ((ret = session->open_cursor(session, uri, NULL,
- all ? "statistics=(all)" : NULL, &cursor)) != 0) {
+
+ if ((ret =
+ session->open_cursor(session, uri, NULL, config, &cursor)) != 0) {
fprintf(stderr, "%s: cursor open(%s) failed: %s\n",
progname, uri, wiredtiger_strerror(ret));
goto err;
@@ -97,7 +109,7 @@ usage(void)
{
(void)fprintf(stderr,
"usage: %s %s "
- "stat -a [uri]\n",
+ "stat [-f] [uri]\n",
progname, usage_prefix);
return (1);
}
diff --git a/src/utilities/util_upgrade.c b/src/utilities/util_upgrade.c
index b56caca2ccd..6be11f77099 100644
--- a/src/utilities/util_upgrade.c
+++ b/src/utilities/util_upgrade.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_verbose.c b/src/utilities/util_verbose.c
index 12ff1c5463c..084cce3f610 100644
--- a/src/utilities/util_verbose.c
+++ b/src/utilities/util_verbose.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_verify.c b/src/utilities/util_verify.c
index 6ae5fdeec26..7b3fffdd03b 100644
--- a/src/utilities/util_verify.c
+++ b/src/utilities/util_verify.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_write.c b/src/utilities/util_write.c
index 067b951c0cc..f9fb2d111fe 100644
--- a/src/utilities/util_write.c
+++ b/src/utilities/util_write.c
@@ -1,4 +1,5 @@
/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c
index 9f1cf21bf41..72f53fed9f8 100644
--- a/test/bloom/test_bloom.c
+++ b/test/bloom/test_bloom.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/checkpointer.c b/test/checkpoint/checkpointer.c
index 3eefccde915..dd6fcd6b95a 100644
--- a/test/checkpoint/checkpointer.c
+++ b/test/checkpoint/checkpointer.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/test_checkpoint.c b/test/checkpoint/test_checkpoint.c
index 749e504d3aa..9ec36742431 100644
--- a/test/checkpoint/test_checkpoint.c
+++ b/test/checkpoint/test_checkpoint.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/test_checkpoint.h b/test/checkpoint/test_checkpoint.h
index 2a8bbdcc212..7b3c48a03b0 100644
--- a/test/checkpoint/test_checkpoint.h
+++ b/test/checkpoint/test_checkpoint.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/workers.c b/test/checkpoint/workers.c
index c682bd13864..393532f8e22 100644
--- a/test/checkpoint/workers.c
+++ b/test/checkpoint/workers.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/fops/file.c b/test/fops/file.c
index 1f8a084c404..2763afc5bca 100644
--- a/test/fops/file.c
+++ b/test/fops/file.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/fops/fops.c b/test/fops/fops.c
index 0a5cce87ea3..13bd75d7407 100644
--- a/test/fops/fops.c
+++ b/test/fops/fops.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/fops/t.c b/test/fops/t.c
index 769d3562f0f..1522b5941f7 100644
--- a/test/fops/t.c
+++ b/test/fops/t.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/fops/thread.h b/test/fops/thread.h
index ccd3c84150c..3b49a45d9bb 100644
--- a/test/fops/thread.h
+++ b/test/fops/thread.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/backup.c b/test/format/backup.c
index cca3ac7889c..d70353e282c 100644
--- a/test/format/backup.c
+++ b/test/format/backup.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/bdb.c b/test/format/bdb.c
index 21e6b40d02f..563b69b9e27 100644
--- a/test/format/bdb.c
+++ b/test/format/bdb.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/bulk.c b/test/format/bulk.c
index 3b65ad29685..c91338b9ca1 100644
--- a/test/format/bulk.c
+++ b/test/format/bulk.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/compact.c b/test/format/compact.c
index 2e563ba88c0..60c99db13c3 100644
--- a/test/format/compact.c
+++ b/test/format/compact.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/config.c b/test/format/config.c
index da20cd26433..1fbbe90a57e 100644
--- a/test/format/config.c
+++ b/test/format/config.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/config.h b/test/format/config.h
index 2ab13620486..01357d6fb30 100644
--- a/test/format/config.h
+++ b/test/format/config.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/format.h b/test/format/format.h
index 9290a93e5db..9adb56c82fb 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/ops.c b/test/format/ops.c
index 906d32fee82..3a0a9110b9c 100644
--- a/test/format/ops.c
+++ b/test/format/ops.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/recover.sh b/test/format/recover.sh
index 22e60332711..391da3c85fb 100644
--- a/test/format/recover.sh
+++ b/test/format/recover.sh
@@ -1,14 +1,24 @@
#! /bin/sh
+# Ulimit: don't drop core.
+ulimit -c 0
+
# Timer: how many minutes format runs before aborting.
timer=2
# Runs: set to 0 to run infinitely.
runs=1000
+if test "$#" -gt "0"; then
+ runs=$1
+fi
# Config: additional test/format configuration
config=
+# Assumes we're running in build_*/test/format directory.
+tcmd=./t
+wtcmd=../../wt
+rundir2=RUNDIR.SAVE
count=0
while true; do
count=`expr $count + 1`
@@ -21,11 +31,14 @@ while true; do
echo "recovery test: $count of $runs"
fi
- ./t $config -q abort=1 logging=1 timer=$timer
+ rm -rf $rundir2
+ $tcmd $config -q abort=1 logging=1 timer=$timer
uri='file:wt'
- if `wt -h RUNDIR list | egrep table > /dev/null`; then
+ if `$wtcmd -h RUNDIR list | egrep table > /dev/null`; then
uri='table:wt'
fi
- wt -h RUNDIR verify $uri || exit 1
+ # Save a copy of the database directory exactly as it was at the crash.
+ cp -rp RUNDIR $rundir2
+ $wtcmd -h RUNDIR verify $uri || exit 1
done
diff --git a/test/format/salvage.c b/test/format/salvage.c
index 1d80ade420d..a715ca96d07 100644
--- a/test/format/salvage.c
+++ b/test/format/salvage.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/t.c b/test/format/t.c
index 2d9db5cb664..b53913b4623 100644
--- a/test/format/t.c
+++ b/test/format/t.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/util.c b/test/format/util.c
index 4880dfbbdd0..a1d1fa2b772 100644
--- a/test/format/util.c
+++ b/test/format/util.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/wts.c b/test/format/wts.c
index 243d1deb6d7..b36655aacbe 100644
--- a/test/format/wts.c
+++ b/test/format/wts.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/huge/huge.c b/test/huge/huge.c
index 6ef9755a5a5..c53ef45c4ef 100644
--- a/test/huge/huge.c
+++ b/test/huge/huge.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/AsyncTest.java b/test/java/com/wiredtiger/test/AsyncTest.java
index 318bd0a205d..326a86b93cb 100644
--- a/test/java/com/wiredtiger/test/AsyncTest.java
+++ b/test/java/com/wiredtiger/test/AsyncTest.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/AutoCloseTest.java b/test/java/com/wiredtiger/test/AutoCloseTest.java
index e3e1d58af35..22f0ade7452 100644
--- a/test/java/com/wiredtiger/test/AutoCloseTest.java
+++ b/test/java/com/wiredtiger/test/AutoCloseTest.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/CursorTest.java b/test/java/com/wiredtiger/test/CursorTest.java
index a4843302cc4..f332382dc34 100644
--- a/test/java/com/wiredtiger/test/CursorTest.java
+++ b/test/java/com/wiredtiger/test/CursorTest.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/CursorTest02.java b/test/java/com/wiredtiger/test/CursorTest02.java
index af320a044bf..87eec66f71a 100644
--- a/test/java/com/wiredtiger/test/CursorTest02.java
+++ b/test/java/com/wiredtiger/test/CursorTest02.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/ExceptionTest.java b/test/java/com/wiredtiger/test/ExceptionTest.java
index 6cb5a4c2043..25a88454450 100644
--- a/test/java/com/wiredtiger/test/ExceptionTest.java
+++ b/test/java/com/wiredtiger/test/ExceptionTest.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/PackTest.java b/test/java/com/wiredtiger/test/PackTest.java
index 8bc0d43cc5a..ed1b831a92b 100644
--- a/test/java/com/wiredtiger/test/PackTest.java
+++ b/test/java/com/wiredtiger/test/PackTest.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/WiredTigerSuite.java b/test/java/com/wiredtiger/test/WiredTigerSuite.java
index b0b48e696d7..b393237aac3 100644
--- a/test/java/com/wiredtiger/test/WiredTigerSuite.java
+++ b/test/java/com/wiredtiger/test/WiredTigerSuite.java
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/mciproject.yml b/test/mciproject.yml
new file mode 100644
index 00000000000..fe0f880602c
--- /dev/null
+++ b/test/mciproject.yml
@@ -0,0 +1,103 @@
+#
+# This file defines the tasks and platforms for WiredTiger in the
+# MongoDB continuous integration system (see https://mci.mongodb.com).
+#
+
+functions:
+ "fetch source" :
+ command: git.get_project
+ params:
+ directory: wiredtiger
+
+pre:
+ - command: shell.exec
+ params:
+ script: |
+ rm -rf "wiredtiger"
+post:
+ - command: shell.exec
+ params:
+ script: |
+ rm -rf "wiredtiger"
+
+tasks:
+ - name: compile-posix
+ 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
+
+ ./build_posix/reconf
+ ${configure_env_vars|} ./configure --enable-diagnostic --enable-python --enable-zlib
+ ${make_command|make} ${smp_command|}
+ ${make_command|make} check
+
+ ${test_env_vars|} python ./test/suite/run.py -v 2
+ - name: compile-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-swig=c:\\swigwin-3.0.2\\swig.exe ${smp_command|}
+
+ ${test_env_vars|} python ./test/suite/run.py -v 2
+
+buildvariants:
+- name: ubuntu1404
+ display_name: Ubuntu 14.04
+ run_on:
+ - ubuntu1404-test
+ expansions:
+ test_env_vars: LD_LIBRARY_PATH=.libs
+ smp_command: -j$(grep -c ^processor /proc/cpuinfo)
+ configure_env_vars: CC=/opt/mongodbtoolchain/bin/gcc CXX=/opt/mongodbtoolchain/bin/g++
+ tasks:
+ - name: compile-posix
+
+- name: solaris
+ display_name: Solaris
+ run_on:
+ - solaris
+ expansions:
+ make_command: PATH=/opt/mongodbtoolchain/bin:$PATH gmake
+ test_env_vars: LD_LIBRARY_PATH=.libs
+ smp_command: -j$(kstat cpu | sort -u | grep -c "^module")
+ configure_env_vars: PATH=/opt/mongodbtoolchain/bin:$PATH CFLAGS="-m64"
+ tasks:
+ - name: compile-posix
+
+- name: windows-64
+ display_name: Windows 64-bit
+ run_on:
+ - windows-64-vs2013-compile
+ expansions:
+ smp_command: -j$(grep -c ^processor /proc/cpuinfo)
+ tasks:
+ - name: compile-windows
+
+- name: osx-108
+ display_name: OS X 10.8
+ run_on:
+ - osx-108
+ expansions:
+ smp_command: -j$(sysctl -n hw.logicalcpu)
+ configure_env_vars: PATH=/opt/local/bin:$PATH
+ make_command: PATH=/opt/local/bin:$PATH ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future make
+ test_env_vars: DYLD_LIBRARY_PATH=.libs
+ tasks:
+ - name: compile-posix
diff --git a/test/packing/intpack-test.c b/test/packing/intpack-test.c
index 046081e26c0..109f37e229a 100644
--- a/test/packing/intpack-test.c
+++ b/test/packing/intpack-test.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/packing/intpack-test2.c b/test/packing/intpack-test2.c
index 7d0bdc6f79e..6b54504f367 100644
--- a/test/packing/intpack-test2.c
+++ b/test/packing/intpack-test2.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/packing/packing-test.c b/test/packing/packing-test.c
index 4405888ba1a..2696e8a008d 100644
--- a/test/packing/packing-test.c
+++ b/test/packing/packing-test.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c
index 7d5912c740f..f1e4f26c255 100644
--- a/test/salvage/salvage.c
+++ b/test/salvage/salvage.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/suite/helper.py b/test/suite/helper.py
index 14d01a57078..21eac2359b6 100644
--- a/test/suite/helper.py
+++ b/test/suite/helper.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/run.py b/test/suite/run.py
index a29f7af2212..63101518bd9 100644
--- a/test/suite/run.py
+++ b/test/suite/run.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/suite_random.py b/test/suite/suite_random.py
index afdc09c0892..114b50ba915 100644
--- a/test/suite/suite_random.py
+++ b/test/suite/suite_random.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/suite_subprocess.py b/test/suite/suite_subprocess.py
index 6aefc4d0ab9..66381ed8a0d 100644
--- a/test/suite/suite_subprocess.py
+++ b/test/suite/suite_subprocess.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_async01.py b/test/suite/test_async01.py
index 5c8a1e6df2c..2150b16fa81 100644
--- a/test/suite/test_async01.py
+++ b/test/suite/test_async01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_async02.py b/test/suite/test_async02.py
index 7e88719985e..43cf520e8ed 100644
--- a/test/suite/test_async02.py
+++ b/test/suite/test_async02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_async03.py b/test/suite/test_async03.py
index 5451f87b174..ea62f8c525b 100644
--- a/test/suite/test_async03.py
+++ b/test/suite/test_async03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_autoclose.py b/test/suite/test_autoclose.py
index 6ad4830e1e2..40106e6f97d 100644
--- a/test/suite/test_autoclose.py
+++ b/test/suite/test_autoclose.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_backup01.py b/test/suite/test_backup01.py
index d7f1c01b3ca..f6e9cd87291 100644
--- a/test/suite/test_backup01.py
+++ b/test/suite/test_backup01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_backup02.py b/test/suite/test_backup02.py
index 2ac904e8bad..b9cf0e8b59c 100644
--- a/test/suite/test_backup02.py
+++ b/test/suite/test_backup02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_backup03.py b/test/suite/test_backup03.py
index 2aef85e0690..880469c2486 100644
--- a/test/suite/test_backup03.py
+++ b/test/suite/test_backup03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_backup04.py b/test/suite/test_backup04.py
index 8d78b4e9d78..60f8f0df6c2 100644
--- a/test/suite/test_backup04.py
+++ b/test/suite/test_backup04.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_base01.py b/test/suite/test_base01.py
index dfd3169ee52..8d4c03e2bda 100644
--- a/test/suite/test_base01.py
+++ b/test/suite/test_base01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_base02.py b/test/suite/test_base02.py
index 7121c621571..50332518217 100644
--- a/test/suite/test_base02.py
+++ b/test/suite/test_base02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_base03.py b/test/suite/test_base03.py
index a3ff57aa0ab..3335518dd16 100644
--- a/test/suite/test_base03.py
+++ b/test/suite/test_base03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_base04.py b/test/suite/test_base04.py
index bb0738ca06d..8aca81294df 100644
--- a/test/suite/test_base04.py
+++ b/test/suite/test_base04.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_base05.py b/test/suite/test_base05.py
index 33019f37650..74278624738 100644
--- a/test/suite/test_base05.py
+++ b/test/suite/test_base05.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug001.py b/test/suite/test_bug001.py
index 230607e7e87..1e0412443a5 100644
--- a/test/suite/test_bug001.py
+++ b/test/suite/test_bug001.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug003.py b/test/suite/test_bug003.py
index dc27ad4633e..e4a2196e7d8 100644
--- a/test/suite/test_bug003.py
+++ b/test/suite/test_bug003.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug004.py b/test/suite/test_bug004.py
index a9ced78e820..c5a28539409 100644
--- a/test/suite/test_bug004.py
+++ b/test/suite/test_bug004.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug005.py b/test/suite/test_bug005.py
index 128eb708a81..1e8d3328236 100644
--- a/test/suite/test_bug005.py
+++ b/test/suite/test_bug005.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug006.py b/test/suite/test_bug006.py
index 8af48a6fcaf..f4a41135357 100644
--- a/test/suite/test_bug006.py
+++ b/test/suite/test_bug006.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug007.py b/test/suite/test_bug007.py
index 9691bd414d1..ab03657c944 100644
--- a/test/suite/test_bug007.py
+++ b/test/suite/test_bug007.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bug008.py b/test/suite/test_bug008.py
index 7694fa4979d..6646d188ce5 100644
--- a/test/suite/test_bug008.py
+++ b/test/suite/test_bug008.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bulk01.py b/test/suite/test_bulk01.py
index c99cedae1e6..e57231cd9ef 100644
--- a/test/suite/test_bulk01.py
+++ b/test/suite/test_bulk01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_bulk02.py b/test/suite/test_bulk02.py
index d656f9b7ec3..9f7a63f78b2 100644
--- a/test/suite/test_bulk02.py
+++ b/test/suite/test_bulk02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py
index ab4dbe18bd6..f4ace4a9a2f 100644
--- a/test/suite/test_checkpoint01.py
+++ b/test/suite/test_checkpoint01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_checkpoint02.py b/test/suite/test_checkpoint02.py
index 9ea6509aed9..02dcef91dc3 100644
--- a/test/suite/test_checkpoint02.py
+++ b/test/suite/test_checkpoint02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_compact.py b/test/suite/test_compact.py
index 194a6947c03..c7269785115 100644
--- a/test/suite/test_compact.py
+++ b/test/suite/test_compact.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_compress01.py b/test/suite/test_compress01.py
index 43dfca0515c..17d87403a0f 100644
--- a/test/suite/test_compress01.py
+++ b/test/suite/test_compress01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_config01.py b/test/suite/test_config01.py
index b4eb8775e22..f40f9df3b20 100644
--- a/test/suite/test_config01.py
+++ b/test/suite/test_config01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_config02.py b/test/suite/test_config02.py
index 1edcab5756d..7e3570a1a37 100644
--- a/test/suite/test_config02.py
+++ b/test/suite/test_config02.py
@@ -1,5 +1,6 @@
#!/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.
@@ -146,9 +147,11 @@ class test_config02(wttest.WiredTigerTestCase):
dir = 'nondir'
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: wiredtiger.wiredtiger_open(dir, 'create'),
- '/No such file or directory/')
+ '/(No such file or directory|The system cannot find the path specified)/')
def test_home_not_writeable(self):
+ if os.name == "nt":
+ self.skipTest('Unix specific test skipped on Windows')
dir = 'subdir'
os.mkdir(dir)
os.chmod(dir, 0555)
diff --git a/test/suite/test_config03.py b/test/suite/test_config03.py
index f30fb994fa1..3a1bbd76773 100644
--- a/test/suite/test_config03.py
+++ b/test/suite/test_config03.py
@@ -1,5 +1,6 @@
#!/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.
@@ -102,12 +103,12 @@ class test_config03(test_base03.test_base03):
if self.s_create == False:
successargs = successargs.replace(',create=false,',',create,')
expect_fail = True
- fail_msg = '/No such file or directory/'
+ fail_msg = '/(No such file or directory|The system cannot find the file specified)/'
elif self.s_create == None:
successargs = successargs + 'create=true,'
expect_fail = True
- fail_msg = '/No such file or directory/'
-
+ fail_msg = '/(No such file or directory|The system cannot find the file specified)/'
+
if self.s_eviction_target >= self.s_eviction_trigger:
# construct args that guarantee that target < trigger
# we know that trigger >= 1
diff --git a/test/suite/test_config04.py b/test/suite/test_config04.py
index 7c75e43e475..ceb2da41305 100644
--- a/test/suite/test_config04.py
+++ b/test/suite/test_config04.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_config05.py b/test/suite/test_config05.py
index a75cde42fc6..c8c8c79f192 100644
--- a/test/suite/test_config05.py
+++ b/test/suite/test_config05.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor01.py b/test/suite/test_cursor01.py
index 691fb5cf645..a40a59a34c3 100644
--- a/test/suite/test_cursor01.py
+++ b/test/suite/test_cursor01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor02.py b/test/suite/test_cursor02.py
index d69251e5653..5be3cecd1d1 100644
--- a/test/suite/test_cursor02.py
+++ b/test/suite/test_cursor02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor03.py b/test/suite/test_cursor03.py
index 9034de8b3f5..d27c578bafd 100644
--- a/test/suite/test_cursor03.py
+++ b/test/suite/test_cursor03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor04.py b/test/suite/test_cursor04.py
index d53f88966e3..43b824ee013 100644
--- a/test/suite/test_cursor04.py
+++ b/test/suite/test_cursor04.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor05.py b/test/suite/test_cursor05.py
index ad4bbbf6b96..14705e8bcb0 100644
--- a/test/suite/test_cursor05.py
+++ b/test/suite/test_cursor05.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor_compare.py b/test/suite/test_cursor_compare.py
index 7e99e1e32d6..227505b14ce 100644
--- a/test/suite/test_cursor_compare.py
+++ b/test/suite/test_cursor_compare.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py
index 7b7cc41092f..75275dfde83 100644
--- a/test/suite/test_cursor_random.py
+++ b/test/suite/test_cursor_random.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_cursor_tracker.py b/test/suite/test_cursor_tracker.py
index 3fdc3112772..f25def3e1cc 100644
--- a/test/suite/test_cursor_tracker.py
+++ b/test/suite/test_cursor_tracker.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_drop.py b/test/suite/test_drop.py
index dcda3998436..1daafb72db1 100644
--- a/test/suite/test_drop.py
+++ b/test/suite/test_drop.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_drop_create.py b/test/suite/test_drop_create.py
index 909393a78fc..9566edf9f6f 100644
--- a/test/suite/test_drop_create.py
+++ b/test/suite/test_drop_create.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_dump.py b/test/suite/test_dump.py
index 26ad0397bdb..4c7e6f667e4 100644
--- a/test/suite/test_dump.py
+++ b/test/suite/test_dump.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_dupc.py b/test/suite/test_dupc.py
index ce79cb9db5b..5a0a6bd67cc 100644
--- a/test/suite/test_dupc.py
+++ b/test/suite/test_dupc.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_empty.py b/test/suite/test_empty.py
index d979ca0f4cb..11821d44deb 100644
--- a/test/suite/test_empty.py
+++ b/test/suite/test_empty.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_excl.py b/test/suite/test_excl.py
index 39c90bfba14..da671cc2f9a 100644
--- a/test/suite/test_excl.py
+++ b/test/suite/test_excl.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_home.py b/test/suite/test_home.py
index 78310d69079..ed85a3224c2 100644
--- a/test/suite/test_home.py
+++ b/test/suite/test_home.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_index01.py b/test/suite/test_index01.py
index 124e4cc2811..f2398fee5e8 100644
--- a/test/suite/test_index01.py
+++ b/test/suite/test_index01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_jsondump01.py b/test/suite/test_jsondump01.py
index 730fbf0a05a..b483b4db429 100644
--- a/test/suite/test_jsondump01.py
+++ b/test/suite/test_jsondump01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_jsondump02.py b/test/suite/test_jsondump02.py
index 2eff8b755a7..3ce6ffd424c 100644
--- a/test/suite/test_jsondump02.py
+++ b/test/suite/test_jsondump02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_lsm01.py b/test/suite/test_lsm01.py
index 8f63f783ed4..f2561278edd 100644
--- a/test/suite/test_lsm01.py
+++ b/test/suite/test_lsm01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_lsm02.py b/test/suite/test_lsm02.py
index 41d82d8ad0d..00d1e00dc17 100644
--- a/test/suite/test_lsm02.py
+++ b/test/suite/test_lsm02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_metadata_cursor01.py b/test/suite/test_metadata_cursor01.py
index 98628bda180..dfe9ec8ac97 100644
--- a/test/suite/test_metadata_cursor01.py
+++ b/test/suite/test_metadata_cursor01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_overwrite.py b/test/suite/test_overwrite.py
index a4e8248b918..7d938918324 100644
--- a/test/suite/test_overwrite.py
+++ b/test/suite/test_overwrite.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_perf001.py b/test/suite/test_perf001.py
index 6438702ca0a..a80c0c7e73a 100644
--- a/test/suite/test_perf001.py
+++ b/test/suite/test_perf001.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_priv01.py b/test/suite/test_priv01.py
index 93b60c68491..f2cd6b1d16d 100644
--- a/test/suite/test_priv01.py
+++ b/test/suite/test_priv01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_reconfig.py b/test/suite/test_reconfig.py
index a187b2a26d9..06763f8f9ef 100644
--- a/test/suite/test_reconfig.py
+++ b/test/suite/test_reconfig.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_rename.py b/test/suite/test_rename.py
index 1962c51c10c..321b73543ae 100644
--- a/test/suite/test_rename.py
+++ b/test/suite/test_rename.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_salvage.py b/test/suite/test_salvage.py
index bd6de5f90f3..0a50ab9bd62 100644
--- a/test/suite/test_salvage.py
+++ b/test/suite/test_salvage.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_schema01.py b/test/suite/test_schema01.py
index efd7ba9fdf1..9bfc1897ec9 100644
--- a/test/suite/test_schema01.py
+++ b/test/suite/test_schema01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_schema02.py b/test/suite/test_schema02.py
index 6ce7c6bbecf..17a983c1551 100644
--- a/test/suite/test_schema02.py
+++ b/test/suite/test_schema02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py
index e650d8b6964..5db6966f634 100644
--- a/test/suite/test_schema03.py
+++ b/test/suite/test_schema03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_shared_cache.py b/test/suite/test_shared_cache.py
index 4de3a77d1eb..ff40d31e6df 100644
--- a/test/suite/test_shared_cache.py
+++ b/test/suite/test_shared_cache.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_stat01.py b/test/suite/test_stat01.py
index 33a7b09deb4..0f072a7c473 100644
--- a/test/suite/test_stat01.py
+++ b/test/suite/test_stat01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_stat02.py b/test/suite/test_stat02.py
index db12531f210..c2f2a69b046 100644
--- a/test/suite/test_stat02.py
+++ b/test/suite/test_stat02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_stat_log01.py b/test/suite/test_stat_log01.py
index 339630f503f..b7e76e9efdd 100644
--- a/test/suite/test_stat_log01.py
+++ b/test/suite/test_stat_log01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_sweep01.py b/test/suite/test_sweep01.py
index 6205ed7de12..30efed98c80 100644
--- a/test/suite/test_sweep01.py
+++ b/test/suite/test_sweep01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_truncate01.py b/test/suite/test_truncate01.py
index 2df0cfaea56..c74c9bdfe91 100644
--- a/test/suite/test_truncate01.py
+++ b/test/suite/test_truncate01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_truncate02.py b/test/suite/test_truncate02.py
index e2f133da59d..a11de6cc5da 100644
--- a/test/suite/test_truncate02.py
+++ b/test/suite/test_truncate02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_truncate03.py b/test/suite/test_truncate03.py
index c35c2220517..4e83734a77b 100644
--- a/test/suite/test_truncate03.py
+++ b/test/suite/test_truncate03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn01.py b/test/suite/test_txn01.py
index 1e05cefb35d..fec90938547 100644
--- a/test/suite/test_txn01.py
+++ b/test/suite/test_txn01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn02.py b/test/suite/test_txn02.py
index d83bf6ce5f8..9369f1a0226 100644
--- a/test/suite/test_txn02.py
+++ b/test/suite/test_txn02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn03.py b/test/suite/test_txn03.py
index c1f26c582fc..4f202979fe4 100644
--- a/test/suite/test_txn03.py
+++ b/test/suite/test_txn03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn04.py b/test/suite/test_txn04.py
index 7e8b448856b..1dfe13db961 100644
--- a/test/suite/test_txn04.py
+++ b/test/suite/test_txn04.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn05.py b/test/suite/test_txn05.py
index cc5db523c27..9651a5add74 100644
--- a/test/suite/test_txn05.py
+++ b/test/suite/test_txn05.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn06.py b/test/suite/test_txn06.py
index 24a8a224d4d..36457899054 100644
--- a/test/suite/test_txn06.py
+++ b/test/suite/test_txn06.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn07.py b/test/suite/test_txn07.py
index fe203e07b30..74df555ce5c 100644
--- a/test/suite/test_txn07.py
+++ b/test/suite/test_txn07.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn08.py b/test/suite/test_txn08.py
index a2f08a2686b..f8abd52ca47 100644
--- a/test/suite/test_txn08.py
+++ b/test/suite/test_txn08.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_txn09.py b/test/suite/test_txn09.py
new file mode 100644
index 00000000000..9ab6718341f
--- /dev/null
+++ b/test/suite/test_txn09.py
@@ -0,0 +1,195 @@
+#!/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_txn02.py
+# Transactions: commits and rollbacks
+#
+
+import fnmatch, os, shutil, time
+from suite_subprocess import suite_subprocess
+from wiredtiger import wiredtiger_open
+from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
+import wttest
+
+class test_txn09(wttest.WiredTigerTestCase, suite_subprocess):
+ tablename = 'test_txn09'
+ uri = 'table:' + tablename
+ log_enabled = True
+
+ types = [
+ ('row', dict(tabletype='row',
+ create_params = 'key_format=i,value_format=i')),
+ ('var', dict(tabletype='var',
+ create_params = 'key_format=r,value_format=i')),
+ ('fix', dict(tabletype='fix',
+ create_params = 'key_format=r,value_format=8t')),
+ ]
+ op1s = [
+ ('i4', dict(op1=('insert', 4))),
+ ('r1', dict(op1=('remove', 1))),
+ ('u10', dict(op1=('update', 10))),
+ ]
+ op2s = [
+ ('i6', dict(op2=('insert', 6))),
+ ('r4', dict(op2=('remove', 4))),
+ ('u4', dict(op2=('update', 4))),
+ ]
+ op3s = [
+ ('i12', dict(op3=('insert', 12))),
+ ('r4', dict(op3=('remove', 4))),
+ ('u4', dict(op3=('update', 4))),
+ ]
+ op4s = [
+ ('i14', dict(op4=('insert', 14))),
+ ('r12', dict(op4=('remove', 12))),
+ ('u12', dict(op4=('update', 12))),
+ ]
+ txn1s = [('t1c', dict(txn1='commit')), ('t1r', dict(txn1='rollback'))]
+ txn2s = [('t2c', dict(txn2='commit')), ('t2r', dict(txn2='rollback'))]
+ txn3s = [('t3c', dict(txn3='commit')), ('t3r', dict(txn3='rollback'))]
+ txn4s = [('t4c', dict(txn4='commit')), ('t4r', dict(txn4='rollback'))]
+
+ all_scenarios = multiply_scenarios('.', types,
+ op1s, txn1s, op2s, txn2s, op3s, txn3s, op4s, txn4s)
+
+ # This test generates thousands of potential scenarios.
+ # For default runs, we'll use a small subset of them, for
+ # long runs (when --long is set) we'll set a much larger limit.
+ scenarios = number_scenarios(prune_scenarios(all_scenarios, 20, 5000))
+
+ # Overrides WiredTigerTestCase
+ def setUpConnectionOpen(self, dir):
+ self.home = dir
+ conn_params = \
+ 'create,error_prefix="%s: ",' % self.shortid() + \
+ 'log=(archive=false,enabled=%s),' % int(self.log_enabled) + \
+ 'transaction_sync=(enabled=false),'
+
+ # print "Opening conn at '%s' with config '%s'" % (dir, conn_params)
+ conn = wiredtiger_open(dir, conn_params)
+ self.pr(`conn`)
+ self.session2 = conn.open_session()
+ return conn
+
+ # Check that a cursor (optionally started in a new transaction), sees the
+ # expected values.
+ def check(self, session, txn_config, expected):
+ if txn_config:
+ session.begin_transaction(txn_config)
+ c = session.open_cursor(self.uri, None)
+ actual = dict((k, v) for k, v in c if v != 0)
+ # Search for the expected items as well as iterating
+ for k, v in expected.iteritems():
+ self.assertEqual(c[k], v)
+ c.close()
+ if txn_config:
+ session.commit_transaction()
+ self.assertEqual(actual, expected)
+
+ # Check the state of the system with respect to the current cursor and
+ # different isolation levels.
+ def check_all(self, current, committed):
+ # Transactions see their own changes.
+ # Read-uncommitted transactions see all changes.
+ # Snapshot and read-committed transactions should not see changes.
+ self.check(self.session, None, current)
+ self.check(self.session2, "isolation=snapshot", committed)
+ self.check(self.session2, "isolation=read-committed", committed)
+ self.check(self.session2, "isolation=read-uncommitted", current)
+
+ def test_ops(self):
+ # print "Creating %s with config '%s'" % (self.uri, self.create_params)
+ self.session.create(self.uri, self.create_params)
+ # Set up the table with entries for 1, 2, 10 and 11.
+ # We use the overwrite config so insert can update as needed.
+ c = self.session.open_cursor(self.uri, None, 'overwrite')
+ c.set_value(1)
+ c.set_key(1)
+ c.insert()
+ c.set_key(2)
+ c.insert()
+ c.set_key(10)
+ c.insert()
+ c.set_key(11)
+ c.insert()
+ current = {1:1, 2:1, 10:1, 11:1}
+ committed = current.copy()
+
+ ops = (self.op1, self.op2, self.op3, self.op4)
+ txns = (self.txn1, self.txn2, self.txn3, self.txn4)
+ # for ok, txn in zip(ops, txns):
+ # print ', '.join('%s(%d)[%s]' % (ok[0], ok[1], txn)
+ for i, ot in enumerate(zip(ops, txns)):
+ ok, txn = ot
+ op, k = ok
+
+ # Close and reopen the connection and cursor, toggling the log
+ self.log_enabled = not self.log_enabled
+ self.reopen_conn()
+ c = self.session.open_cursor(self.uri, None, 'overwrite')
+
+ self.session.begin_transaction(
+ (self.scenario_number % 2) and 'sync' or None)
+ # Test multiple operations per transaction by always
+ # doing the same operation on key k + 1.
+ k1 = k + 1
+ # print '%d: %s(%d)[%s]' % (i, ok[0], ok[1], txn)
+ if op == 'insert' or op == 'update':
+ c.set_value(i + 2)
+ c.set_key(k)
+ c.insert()
+ c.set_key(k1)
+ c.insert()
+ current[k] = i + 2
+ current[k1] = i + 2
+ elif op == 'remove':
+ c.set_key(k)
+ c.remove()
+ c.set_key(k1)
+ c.remove()
+ if k in current:
+ del current[k]
+ if k1 in current:
+ del current[k1]
+
+ # print current
+ # Check the state after each operation.
+ self.check_all(current, committed)
+
+ if txn == 'commit':
+ committed = current.copy()
+ self.session.commit_transaction()
+ elif txn == 'rollback':
+ current = committed.copy()
+ self.session.rollback_transaction()
+
+ # Check the state after each commit/rollback.
+ self.check_all(current, committed)
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/test/suite/test_unicode01.py b/test/suite/test_unicode01.py
index 6731b2dd1a6..76ebd886319 100644
--- a/test/suite/test_unicode01.py
+++ b/test/suite/test_unicode01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_upgrade.py b/test/suite/test_upgrade.py
index e88f250d278..24cecf4b518 100644
--- a/test/suite/test_upgrade.py
+++ b/test/suite/test_upgrade.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util01.py b/test/suite/test_util01.py
index 6890e187bce..62540769f08 100644
--- a/test/suite/test_util01.py
+++ b/test/suite/test_util01.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util02.py b/test/suite/test_util02.py
index 1cf8989b395..e95746e2946 100644
--- a/test/suite/test_util02.py
+++ b/test/suite/test_util02.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util03.py b/test/suite/test_util03.py
index db1ea8e4f80..aa5d723fbe8 100644
--- a/test/suite/test_util03.py
+++ b/test/suite/test_util03.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util04.py b/test/suite/test_util04.py
index fc314db0126..09b4facb220 100644
--- a/test/suite/test_util04.py
+++ b/test/suite/test_util04.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util07.py b/test/suite/test_util07.py
index d525375a496..9a04f0b1363 100644
--- a/test/suite/test_util07.py
+++ b/test/suite/test_util07.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util08.py b/test/suite/test_util08.py
index fc4b1cd1c89..7c4c5cfcf85 100644
--- a/test/suite/test_util08.py
+++ b/test/suite/test_util08.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util09.py b/test/suite/test_util09.py
index 6099ed5466f..e5b0b57a23c 100644
--- a/test/suite/test_util09.py
+++ b/test/suite/test_util09.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util11.py b/test/suite/test_util11.py
index e845a06d3f2..e69530255a4 100644
--- a/test/suite/test_util11.py
+++ b/test/suite/test_util11.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_util12.py b/test/suite/test_util12.py
index 051e22cb87e..0faa8dbf8bd 100644
--- a/test/suite/test_util12.py
+++ b/test/suite/test_util12.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_verify.py b/test/suite/test_verify.py
index 8743e08bd3f..6b9fe06ce89 100644
--- a/test/suite/test_verify.py
+++ b/test/suite/test_verify.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/test_version.py b/test/suite/test_version.py
index dc86cf7133e..4d59ea6d279 100644
--- a/test/suite/test_version.py
+++ b/test/suite/test_version.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/wtscenario.py b/test/suite/wtscenario.py
index 70497102bb0..2e59c704971 100644
--- a/test/suite/wtscenario.py
+++ b/test/suite/wtscenario.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/wttest.py b/test/suite/wttest.py
index 4de09a143b2..c1224538c59 100644
--- a/test/suite/wttest.py
+++ b/test/suite/wttest.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/suite/wtthread.py b/test/suite/wtthread.py
index ab881a0f4f3..c847c877b2d 100644
--- a/test/suite/wtthread.py
+++ b/test/suite/wtthread.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/test/thread/file.c b/test/thread/file.c
index ac37b27a4d8..7e0e3c0a5d2 100644
--- a/test/thread/file.c
+++ b/test/thread/file.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/rw.c b/test/thread/rw.c
index d680e0a6b91..08cf63f435a 100644
--- a/test/thread/rw.c
+++ b/test/thread/rw.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/stats.c b/test/thread/stats.c
index 704dd75d254..491f4ec918c 100644
--- a/test/thread/stats.c
+++ b/test/thread/stats.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/t.c b/test/thread/t.c
index 1ba5a209d5e..6d5f6f0dff7 100644
--- a/test/thread/t.c
+++ b/test/thread/t.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/thread.h b/test/thread/thread.h
index 468bd40b262..ef34c3df5d4 100644
--- a/test/thread/thread.h
+++ b/test/thread/thread.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/windows/windows_shim.c b/test/windows/windows_shim.c
index 2e0226268f6..646ebf0c441 100644
--- a/test/windows/windows_shim.c
+++ b/test/windows/windows_shim.c
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/windows/windows_shim.h b/test/windows/windows_shim.h
index 47a1018c229..441201e3744 100644
--- a/test/windows/windows_shim.h
+++ b/test/windows/windows_shim.h
@@ -1,4 +1,5 @@
/*-
+ * Public Domain 2014-2015 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/tools/stat_data.py b/tools/stat_data.py
index 3d192be7566..89e06dbbf90 100644
--- a/tools/stat_data.py
+++ b/tools/stat_data.py
@@ -4,6 +4,7 @@ no_scale_per_second_list = [
'async: maximum work queue length',
'cache: bytes currently in the cache',
'cache: maximum bytes configured',
+ 'cache: maximum page size at eviction',
'cache: pages currently held in the cache',
'cache: tracked dirty bytes in the cache',
'cache: tracked dirty pages in the cache',
@@ -85,6 +86,7 @@ prefix_list = [
'connection',
'session',
'block-manager',
+ 'thread-yield',
'async',
'btree',
'compression',
diff --git a/tools/statlog.py b/tools/statlog.py
index f32b46a9ec7..a597eb060ae 100644
--- a/tools/statlog.py
+++ b/tools/statlog.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/tools/wt_nvd3_util.py b/tools/wt_nvd3_util.py
index fe058d25c1d..435c2ce71e7 100644
--- a/tools/wt_nvd3_util.py
+++ b/tools/wt_nvd3_util.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/tools/wtperf_graph.py b/tools/wtperf_graph.py
index f45145cf801..d80eb0cbce5 100644
--- a/tools/wtperf_graph.py
+++ b/tools/wtperf_graph.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/tools/wtperf_stats.py b/tools/wtperf_stats.py
index f87ca2d3254..5e6e1733fb7 100644
--- a/tools/wtperf_stats.py
+++ b/tools/wtperf_stats.py
@@ -1,5 +1,6 @@
#!/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.
diff --git a/tools/wtstats.py b/tools/wtstats.py
index cc2ebd80877..740a2017d63 100644
--- a/tools/wtstats.py
+++ b/tools/wtstats.py
@@ -1,5 +1,6 @@
#!/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.