diff options
Diffstat (limited to 'src')
36 files changed, 518 insertions, 407 deletions
diff --git a/src/block/block_map.c b/src/block/block_map.c index ce6fe8602f5..d2c70fb4c49 100644 --- a/src/block/block_map.c +++ b/src/block/block_map.c @@ -46,7 +46,7 @@ __wt_block_map(WT_SESSION_IMPL *session, WT_BLOCK *block, * There may be no underlying functionality. */ handle = block->fh->handle; - if (handle->map == NULL) + if (handle->fh_map == NULL) return (0); /* @@ -54,7 +54,7 @@ __wt_block_map(WT_SESSION_IMPL *session, WT_BLOCK *block, * Ignore not-supported errors, we'll read the file through the cache * if map fails. */ - ret = handle->map(handle, + ret = handle->fh_map(handle, (WT_SESSION *)session, mapped_regionp, lengthp, mapped_cookiep); if (ret == ENOTSUP) { *(void **)mapped_regionp = NULL; @@ -76,6 +76,6 @@ __wt_block_unmap(WT_SESSION_IMPL *session, /* Unmap the file from memory. */ handle = block->fh->handle; - return (handle->unmap(handle, + return (handle->fh_unmap(handle, (WT_SESSION *)session, mapped_region, length, mapped_cookie)); } diff --git a/src/block/block_mgr.c b/src/block/block_mgr.c index 465952d8ca5..971fe713f83 100644 --- a/src/block/block_mgr.c +++ b/src/block/block_mgr.c @@ -311,7 +311,7 @@ __bm_map_discard(WT_BM *bm, WT_SESSION_IMPL *session, void *map, size_t len) WT_FILE_HANDLE *handle; handle = bm->block->fh->handle; - return (handle->map_discard( + return (handle->fh_map_discard( handle, (WT_SESSION *)session, map, len, bm->mapped_cookie)); } diff --git a/src/block/block_read.c b/src/block/block_read.c index 7304f6ff4bc..97157e4a0f1 100644 --- a/src/block/block_read.c +++ b/src/block/block_read.c @@ -35,11 +35,11 @@ __wt_bm_preload( handle = block->fh->handle; mapped = bm->map != NULL && offset + size <= (wt_off_t)bm->maplen; - if (mapped && handle->map_preload != NULL) - ret = handle->map_preload(handle, (WT_SESSION *)session, + if (mapped && handle->fh_map_preload != NULL) + ret = handle->fh_map_preload(handle, (WT_SESSION *)session, (uint8_t *)bm->map + offset, size, bm->mapped_cookie); - if (!mapped && handle->fadvise != NULL) - ret = handle->fadvise(handle, (WT_SESSION *)session, + if (!mapped && handle->fh_advise != NULL) + ret = handle->fh_advise(handle, (WT_SESSION *)session, (wt_off_t)offset, (wt_off_t)size, WT_FILE_HANDLE_WILLNEED); if (ret != EBUSY && ret != ENOTSUP) return (ret); @@ -78,10 +78,10 @@ __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, */ handle = block->fh->handle; mapped = bm->map != NULL && offset + size <= (wt_off_t)bm->maplen; - if (mapped && handle->map_preload != NULL) { + if (mapped && handle->fh_map_preload != NULL) { buf->data = (uint8_t *)bm->map + offset; buf->size = size; - ret = handle->map_preload(handle, (WT_SESSION *)session, + ret = handle->fh_map_preload(handle, (WT_SESSION *)session, buf->data, buf->size,bm->mapped_cookie); WT_STAT_FAST_CONN_INCR(session, block_map_read); diff --git a/src/block/block_write.c b/src/block/block_write.c index 4f1224f3c13..1fefeee09da 100644 --- a/src/block/block_write.c +++ b/src/block/block_write.c @@ -52,7 +52,7 @@ __wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size) /* The file may not support this call. */ handle = block->fh->handle; - if (handle->fadvise == NULL) + if (handle->fh_advise == NULL) return (0); /* The call may not be configured. */ @@ -67,7 +67,7 @@ __wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size) return (0); block->os_cache = 0; - ret = handle->fadvise(handle, (WT_SESSION *)session, + ret = handle->fh_advise(handle, (WT_SESSION *)session, (wt_off_t)0, (wt_off_t)0, WT_FILE_HANDLE_DONTNEED); return (ret == EBUSY || ret == ENOTSUP ? 0 : ret); } @@ -128,7 +128,8 @@ __wt_block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block, * and remember that ftruncate requires locking. */ handle = fh->handle; - if (handle->fallocate != NULL || handle->fallocate_nolock != NULL) { + if (handle->fh_allocate != NULL || + handle->fh_allocate_nolock != NULL) { /* * Release any locally acquired lock if not needed to extend the * file, extending the file may require updating on-disk file's @@ -136,7 +137,7 @@ __wt_block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block, * configure for file extension on systems that require locking * over the extend call.) */ - if (handle->fallocate_nolock != NULL && *release_lockp) { + if (handle->fh_allocate_nolock != NULL && *release_lockp) { *release_lockp = locked = false; __wt_spin_unlock(session, &block->live_lock); } diff --git a/src/checksum/power8/crc32.S b/src/checksum/power8/crc32.S index c0b81143f07..f990acb7b12 100644 --- a/src/checksum/power8/crc32.S +++ b/src/checksum/power8/crc32.S @@ -769,3 +769,10 @@ FUNC_START(__crc32_vpmsum) FUNC_END(__crc32_vpmsum) #endif + +/* + * Make sure the stack isn't executable with GCC (regardless of platform). + */ +#ifndef __clang__ +.section .note.GNU-stack,"",@progbits +#endif diff --git a/src/config/config_collapse.c b/src/config/config_collapse.c index 27bd6255a0a..591d22284f5 100644 --- a/src/config/config_collapse.c +++ b/src/config/config_collapse.c @@ -38,6 +38,8 @@ __wt_config_collapse( WT_DECL_ITEM(tmp); WT_DECL_RET; + *config_ret = NULL; + WT_RET(__wt_scr_alloc(session, 0, &tmp)); WT_ERR(__wt_config_init(session, &cparser, cfg[0])); @@ -59,6 +61,8 @@ __wt_config_collapse( WT_ERR(__wt_buf_catfmt(session, tmp, "%.*s=%.*s,", (int)k.len, k.str, (int)v.len, v.str)); } + + /* We loop until error, and the expected error is WT_NOTFOUND. */ if (ret != WT_NOTFOUND) goto err; diff --git a/src/config/config_def.c b/src/config/config_def.c index c7bbdf50280..7a75db8857d 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -292,6 +292,7 @@ static const WT_CONFIG_CHECK confchk_WT_SESSION_create[] = { }; static const WT_CONFIG_CHECK confchk_WT_SESSION_drop[] = { + { "checkpoint_wait", "boolean", NULL, NULL, NULL, 0 }, { "force", "boolean", NULL, NULL, NULL, 0 }, { "lock_wait", "boolean", NULL, NULL, NULL, 0 }, { "remove_files", "boolean", NULL, NULL, NULL, 0 }, @@ -1034,8 +1035,8 @@ static const WT_CONFIG_ENTRY config_entries[] = { confchk_WT_SESSION_create, 40 }, { "WT_SESSION.drop", - "force=0,lock_wait=,remove_files=", - confchk_WT_SESSION_drop, 3 + "checkpoint_wait=,force=0,lock_wait=,remove_files=", + confchk_WT_SESSION_drop, 4 }, { "WT_SESSION.join", "bloom_bit_count=16,bloom_hash_count=8,compare=\"eq\",count=," diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index 18ad383ec74..279e3d4a8b5 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -1919,16 +1919,16 @@ __conn_chk_file_system(WT_SESSION_IMPL *session, bool readonly) WT_RET_MSG(session, EINVAL, \ "a WT_FILE_SYSTEM.%s method must be configured", #name) - WT_CONN_SET_FILE_SYSTEM_REQ(directory_list); - WT_CONN_SET_FILE_SYSTEM_REQ(directory_list_free); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_directory_list); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_directory_list_free); /* not required: directory_sync */ - WT_CONN_SET_FILE_SYSTEM_REQ(exist); - WT_CONN_SET_FILE_SYSTEM_REQ(open_file); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_exist); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_open_file); if (!readonly) { - WT_CONN_SET_FILE_SYSTEM_REQ(remove); - WT_CONN_SET_FILE_SYSTEM_REQ(rename); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_remove); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_rename); } - WT_CONN_SET_FILE_SYSTEM_REQ(size); + WT_CONN_SET_FILE_SYSTEM_REQ(fs_size); return (0); } @@ -2012,6 +2012,14 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, WT_ERR(__wt_os_stdio(session)); __wt_event_handler_set(session, event_handler); + /* + * Set the default session's strerror method. If one of the extensions + * being loaded reports an error via the WT_EXTENSION_API strerror + * method, but doesn't supply that method a WT_SESSION handle, we'll + * use the WT_CONNECTION_IMPL's default session and its strerror method. + */ + conn->default_session->iface.strerror = __wt_session_strerror; + /* Basic initialization of the connection structure. */ WT_ERR(__wt_connection_init(conn)); diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c index 1e34b514aa7..898bd09ece9 100644 --- a/src/conn/conn_cache_pool.c +++ b/src/conn/conn_cache_pool.c @@ -571,6 +571,7 @@ __cache_pool_adjust(WT_SESSION_IMPL *session, cp = __wt_process.cache_pool; grow = false; pool_full = cp->currently_used >= cp->size; + pct_full = 0; /* Highest as a percentage, avoid 0 */ highest_percentile = (highest / 100) + 1; diff --git a/src/cursor/cur_join.c b/src/cursor/cur_join.c index fd7de53c981..b35558e04b3 100644 --- a/src/cursor/cur_join.c +++ b/src/cursor/cur_join.c @@ -45,7 +45,6 @@ __wt_curjoin_joined(WT_CURSOR *cursor) /* * __curjoin_iter_init -- * Initialize an iteration for the index managed by a join entry. - * */ static int __curjoin_iter_init(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, @@ -66,7 +65,6 @@ __curjoin_iter_init(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, /* * __curjoin_iter_close -- * Close the iteration, release resources. - * */ static int __curjoin_iter_close(WT_CURSOR_JOIN_ITER *iter) @@ -82,7 +80,6 @@ __curjoin_iter_close(WT_CURSOR_JOIN_ITER *iter) /* * __curjoin_iter_close_all -- * Free the iterator and all of its children recursively. - * */ static int __curjoin_iter_close_all(WT_CURSOR_JOIN_ITER *iter) @@ -105,7 +102,6 @@ __curjoin_iter_close_all(WT_CURSOR_JOIN_ITER *iter) /* * __curjoin_iter_reset -- * Reset an iteration to the starting point. - * */ static int __curjoin_iter_reset(WT_CURSOR_JOIN_ITER *iter) @@ -120,7 +116,6 @@ __curjoin_iter_reset(WT_CURSOR_JOIN_ITER *iter) /* * __curjoin_iter_ready -- * Check the positioned flag for all nested iterators. - * */ static bool __curjoin_iter_ready(WT_CURSOR_JOIN_ITER *iter) @@ -136,7 +131,6 @@ __curjoin_iter_ready(WT_CURSOR_JOIN_ITER *iter) /* * __curjoin_iter_set_entry -- * Set the current entry for an iterator. - * */ static int __curjoin_iter_set_entry(WT_CURSOR_JOIN_ITER *iter, u_int entry_pos) @@ -146,13 +140,13 @@ __curjoin_iter_set_entry(WT_CURSOR_JOIN_ITER *iter, u_int entry_pos) WT_CURSOR_JOIN_ENTRY *entry; WT_DECL_RET; WT_SESSION_IMPL *session; - char *uri; + size_t size; const char *raw_cfg[] = { WT_CONFIG_BASE( iter->session, WT_SESSION_open_cursor), "raw", NULL }; const char *def_cfg[] = { WT_CONFIG_BASE( iter->session, WT_SESSION_open_cursor), NULL }; const char **config; - size_t size; + char *uri; session = iter->session; cjoin = iter->cjoin; @@ -402,8 +396,7 @@ __curjoin_endpoint_init_key(WT_SESSION_IMPL *session, endpoint->recno_buf, sizeof(endpoint->recno_buf), &endpoint->key)); - } - else + } else endpoint->key = *k; } } @@ -422,8 +415,8 @@ __curjoin_entries_in_range(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_CURSOR_JOIN_ENTRY *entry; WT_CURSOR_JOIN_ITER *iter; WT_DECL_RET; - int fastret, slowret; u_int pos; + int fastret, slowret; iter = iterarg; if (F_ISSET(cjoin, WT_CURJOIN_DISJUNCTION)) { @@ -459,8 +452,8 @@ __curjoin_entry_in_range(WT_SESSION_IMPL *session, WT_CURSOR_JOIN_ENTRY *entry, WT_COLLATOR *collator; WT_CURSOR_JOIN_ENDPOINT *end, *endmax; bool disjunction, passed; - int cmp; u_int pos; + int cmp; collator = (entry->index != NULL) ? entry->index->collator : NULL; endmax = &entry->ends[entry->ends_next]; @@ -758,15 +751,15 @@ __curjoin_init_bloom(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_COLLATOR *collator; WT_CURSOR *c; WT_CURSOR_JOIN_ENDPOINT *end, *endmax; - WT_DECL_RET; WT_DECL_ITEM(uribuf); + WT_DECL_RET; WT_ITEM curkey, curvalue; - const char *raw_cfg[] = { WT_CONFIG_BASE( - session, WT_SESSION_open_cursor), "raw", NULL }; - const char *uri; size_t size; u_int skip; int cmp; + const char *uri; + const char *raw_cfg[] = { WT_CONFIG_BASE( + session, WT_SESSION_open_cursor), "raw", NULL }; c = NULL; skip = 0; @@ -905,18 +898,18 @@ __curjoin_init_next(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, bool iterable) { WT_BLOOM *bloom; - WT_DECL_RET; WT_CURSOR *origcur; - WT_CURSOR_JOIN_ENTRY *je, *jeend, *je2; WT_CURSOR_JOIN_ENDPOINT *end; + WT_CURSOR_JOIN_ENTRY *je, *jeend, *je2; + WT_DECL_RET; + size_t size; + uint32_t f, k; char *mainbuf; const char *def_cfg[] = { WT_CONFIG_BASE( session, WT_SESSION_open_cursor), NULL }; const char *raw_cfg[] = { WT_CONFIG_BASE( session, WT_SESSION_open_cursor), "raw", NULL }; const char **config, *proj, *urimain; - size_t size; - uint32_t f, k; mainbuf = NULL; if (cjoin->entries_next == 0) @@ -1140,10 +1133,10 @@ __curjoin_open_main(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, { WT_DECL_RET; WT_INDEX *idx; + size_t len, newsize; char *main_uri, *newformat; const char *raw_cfg[] = { WT_CONFIG_BASE( session, WT_SESSION_open_cursor), "raw", NULL }; - size_t len, newsize; main_uri = NULL; idx = entry->index; @@ -1151,8 +1144,7 @@ __curjoin_open_main(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, newsize = strlen(cjoin->table->name) + idx->colconf.len + 1; WT_ERR(__wt_calloc(session, 1, newsize, &main_uri)); snprintf(main_uri, newsize, "%s%.*s", - cjoin->table->name, (int)idx->colconf.len, - idx->colconf.str); + cjoin->table->name, (int)idx->colconf.len, idx->colconf.str); WT_ERR(__wt_open_cursor(session, main_uri, (WT_CURSOR *)cjoin, raw_cfg, &entry->main)); if (idx->extractor == NULL) { @@ -1165,8 +1157,7 @@ __curjoin_open_main(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, */ len = strlen(entry->main->value_format) + 3; WT_ERR(__wt_calloc(session, len, 1, &newformat)); - snprintf(newformat, len, "%s0x", - entry->main->value_format); + snprintf(newformat, len, "%s0x", entry->main->value_format); __wt_free(session, entry->main->value_format); entry->main->value_format = newformat; } @@ -1364,9 +1355,9 @@ __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count) { WT_CURSOR_INDEX *cindex; + WT_CURSOR_JOIN *child; WT_CURSOR_JOIN_ENDPOINT *end; WT_CURSOR_JOIN_ENTRY *entry; - WT_CURSOR_JOIN *child; bool hasins, needbloom, nested, range_eq; size_t len; u_int i, ins, nonbloom; diff --git a/src/docs/custom-file-systems.dox b/src/docs/custom-file-systems.dox index 4b012952e15..cddec0e4258 100644 --- a/src/docs/custom-file-systems.dox +++ b/src/docs/custom-file-systems.dox @@ -5,21 +5,34 @@ used by WiredTiger to interact with the I/O subsystem using the WT_FILE_SYSTEM and WT_FILE_HANDLE interfaces. It is not necessary for all file system providers to implement all methods -in the WT_FILE_SYSTEM and WT_FILE_HANDLE structures. The documentation for +in the WT_FILE_SYSTEM and WT_FILE_HANDLE structures, and documentation for those structures indicate which methods are optional. Methods which are not -provided should be set to NULL. Generally the function pointers should not -be changed once a handle is created. There is one exception to this, which -are the fallocate and fallocate_nolock - for an example of how fallocate -can be changed after create see the WiredTiger POSIX file system -implementation. +provided should be set to NULL. + +Generally, function pointers should not be changed once a handle is +created. An exception to this are the WT_FILE_HANDLE::fallocate and +WT_FILE_HANDLE::fallocate_nolock methods, because a file system +implementation may not know what support the system provides until file +allocation is attempted. See the WiredTiger POSIX file system +implementation for an example of how the fallocate method might be +changed after initialization. WT_FILE_SYSTEM and WT_FILE_HANDLE methods which fail but not fatally -(for example, a file truncation call which fails because the file is -currently mapped into memory), should return EBUSY. +(for example, a WT_FILE_HANDLE::truncate method call which fails because +the file is currently mapped into memory), should return EBUSY. + +WT_FILE_SYSTEM and WT_FILE_HANDLE methods which fail fatally, but not +in all cases (for example, a WT_FILE_HANDLE::fadvise method call which +only supports ::WT_FILE_HANDLE_WILLNEED), should return ENOTSUP. Unless explicitly stated otherwise, WiredTiger may invoke methods on the WT_FILE_SYSTEM and WT_FILE_HANDLE interfaces from multiple threads concurrently. It is the responsibility of the implementation to protect any shared data. +See @ex_ref{ex_file_system.c} for an example implementation of a custom +file system; the WiredTiger code for a POSIX standard file system is in +the public domain and may also be useful as a starting point for a custom +file system implementation. + */ diff --git a/src/docs/spell.ok b/src/docs/spell.ok index d197b5517f2..96fe04d7426 100644 --- a/src/docs/spell.ok +++ b/src/docs/spell.ok @@ -81,6 +81,7 @@ Seward's SiH TXT URIs +WILLNEED WiredTiger WiredTiger's WiredTigerCheckpoint @@ -210,8 +211,8 @@ erlang errno exe fadvise -fallocate failchk +fallocate fd's fdatasync fieldname diff --git a/src/docs/wtperf.dox b/src/docs/wtperf.dox index 6d8dcab8f65..e06272d117c 100644 --- a/src/docs/wtperf.dox +++ b/src/docs/wtperf.dox @@ -232,6 +232,8 @@ operation,two for every second operation, three for every third operation etc. @par sess_config (string, default=) session configuration string +@par session_count_idle (unsigned int, default=0) +number of idle sessions to create. Default 0. @par table_config (string, default=key_format=S,value_format=S,type=lsm,exclusive=true,allocation_size=4kb,internal_page_max=64kb,leaf_page_max=4kb,split_pct=100) table configuration string @par table_count (unsigned int, default=1) diff --git a/src/include/btree.i b/src/include/btree.i index 4c8166ca6a6..e0102a11511 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -1360,7 +1360,7 @@ __wt_page_hazard_check(WT_SESSION_IMPL *session, WT_PAGE *page) WT_CONNECTION_IMPL *conn; WT_HAZARD *hp; WT_SESSION_IMPL *s; - uint32_t i, hazard_size, session_cnt; + uint32_t i, j, hazard_size, max, session_cnt; conn = S2C(session); @@ -1372,15 +1372,28 @@ __wt_page_hazard_check(WT_SESSION_IMPL *session, WT_PAGE *page) * come or go, we'll check the slots for all of the sessions that could * have been active when we started our check. */ + WT_STAT_FAST_CONN_INCR(session, cache_hazard_checks); WT_ORDERED_READ(session_cnt, conn->session_cnt); - for (s = conn->sessions, i = 0; i < session_cnt; ++s, ++i) { + for (s = conn->sessions, i = 0, j = 0, max = 0; + i < session_cnt; ++s, ++i) { if (!s->active) continue; WT_ORDERED_READ(hazard_size, s->hazard_size); - for (hp = s->hazard; hp < s->hazard + hazard_size; ++hp) - if (hp->page == page) + if (s->hazard_size > max) { + max = s->hazard_size; + WT_STAT_FAST_CONN_SET(session, + cache_hazard_max, max); + } + for (hp = s->hazard; hp < s->hazard + hazard_size; ++hp) { + ++j; + if (hp->page == page) { + WT_STAT_FAST_CONN_INCRV(session, + cache_hazard_walks, j); return (hp); + } + } } + WT_STAT_FAST_CONN_INCRV(session, cache_hazard_walks, j); return (NULL); } diff --git a/src/include/cache.i b/src/include/cache.i index 8cf7555e716..72c8307756d 100644 --- a/src/include/cache.i +++ b/src/include/cache.i @@ -166,6 +166,13 @@ __wt_eviction_needed(WT_SESSION_IMPL *session, u_int *pct_fullp) cache = conn->cache; /* + * If the connection is closing we do not need eviction from an + * application thread. The eviction subsystem is already closed. + */ + if (F_ISSET(conn, WT_CONN_CLOSING)) + return (false); + + /* * Avoid division by zero if the cache size has not yet been set in a * shared cache. */ @@ -179,6 +186,15 @@ __wt_eviction_needed(WT_SESSION_IMPL *session, u_int *pct_fullp) pct_full = (u_int)((100 * bytes_inuse) / bytes_max); if (pct_fullp != NULL) *pct_fullp = pct_full; + /* + * If the connection is closing we do not need eviction from an + * application thread. The eviction subsystem is already closed. + * We return here because some callers depend on the percent full + * having been filled in. + */ + if (F_ISSET(conn, WT_CONN_CLOSING)) + return (false); + if (pct_full > cache->eviction_trigger) return (true); diff --git a/src/include/extern.h b/src/include/extern.h index 53e49e51a26..e8c20930aaf 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -570,6 +570,7 @@ extern int __wt_open_cursor(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR extern int __wt_session_create( WT_SESSION_IMPL *session, const char *uri, const char *config); extern int __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]); extern int __wt_session_range_truncate(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *start, WT_CURSOR *stop); +extern const char *__wt_session_strerror(WT_SESSION *wt_session, int error); extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, bool open_metadata, WT_SESSION_IMPL **sessionp); extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name, bool open_metadata, uint32_t session_flags, WT_SESSION_IMPL **sessionp); extern int __wt_session_compact( WT_SESSION *wt_session, const char *uri, const char *config); @@ -730,7 +731,7 @@ extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, b extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp); extern int __wt_errno(void); extern int __wt_filename(WT_SESSION_IMPL *session, const char *name, char **path); -extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fsp); +extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fstrp); extern int __wt_get_vm_pagesize(void); extern int __wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **envp); extern int __wt_getlasterror(void); diff --git a/src/include/os.h b/src/include/os.h index bf60f32f764..1e08683bc83 100644 --- a/src/include/os.h +++ b/src/include/os.h @@ -141,7 +141,8 @@ struct __wt_fstream { uint32_t flags; int (*close)(WT_SESSION_IMPL *, WT_FSTREAM *); - int (*flush)(WT_SESSION_IMPL *, WT_FSTREAM *); - int (*getline)(WT_SESSION_IMPL *, WT_FSTREAM *, WT_ITEM *); - int (*printf)(WT_SESSION_IMPL *, WT_FSTREAM *, const char *, va_list); + int (*fstr_flush)(WT_SESSION_IMPL *, WT_FSTREAM *); + int (*fstr_getline)(WT_SESSION_IMPL *, WT_FSTREAM *, WT_ITEM *); + int (*fstr_printf)( + WT_SESSION_IMPL *, WT_FSTREAM *, const char *, va_list); }; diff --git a/src/include/os_fhandle.i b/src/include/os_fhandle.i index 8d2cda4b305..cf790d6bc4d 100644 --- a/src/include/os_fhandle.i +++ b/src/include/os_fhandle.i @@ -22,11 +22,11 @@ __wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block) handle = fh->handle; if (block) - return (handle->sync == NULL ? 0 : - handle->sync(handle, (WT_SESSION *)session)); + return (handle->fh_sync == NULL ? 0 : + handle->fh_sync(handle, (WT_SESSION *)session)); else - return (handle->sync_nowait == NULL ? 0 : - handle->sync_nowait(handle, (WT_SESSION *)session)); + return (handle->fh_sync_nowait == NULL ? 0 : + handle->fh_sync_nowait(handle, (WT_SESSION *)session)); } /* @@ -55,14 +55,14 @@ __wt_fallocate( * flavor, that failed, and we have to fallback to the locking flavor. */ handle = fh->handle; - if (handle->fallocate_nolock != NULL) { - if ((ret = handle->fallocate_nolock( + if (handle->fh_allocate_nolock != NULL) { + if ((ret = handle->fh_allocate_nolock( handle, (WT_SESSION *)session, offset, len)) == 0) return (0); WT_RET_ERROR_OK(ret, ENOTSUP); } - if (handle->fallocate != NULL) - return (handle->fallocate( + if (handle->fh_allocate != NULL) + return (handle->fh_allocate( handle, (WT_SESSION *)session, offset, len)); return (ENOTSUP); } @@ -80,8 +80,8 @@ __wt_file_lock(WT_SESSION_IMPL * session, WT_FH *fh, bool lock) "%s: handle-lock: %s", fh->handle->name, lock ? "lock" : "unlock")); handle = fh->handle; - return (handle->lock == NULL ? 0 : - handle->lock(handle, (WT_SESSION*)session, lock)); + return (handle->fh_lock == NULL ? 0 : + handle->fh_lock(handle, (WT_SESSION*)session, lock)); } /* @@ -98,7 +98,7 @@ __wt_read( WT_STAT_FAST_CONN_INCR(session, read_io); - return (fh->handle->read( + return (fh->handle->fh_read( fh->handle, (WT_SESSION *)session, offset, len, buf)); } @@ -112,7 +112,7 @@ __wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep) WT_RET(__wt_verbose( session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->handle->name)); - return (fh->handle->size(fh->handle, (WT_SESSION *)session, sizep)); + return (fh->handle->fh_size(fh->handle, (WT_SESSION *)session, sizep)); } /* @@ -128,7 +128,8 @@ __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len) "%s: handle-truncate: %" PRIuMAX, fh->handle->name, (uintmax_t)len)); - return (fh->handle->truncate(fh->handle, (WT_SESSION *)session, len)); + return (fh->handle->fh_truncate( + fh->handle, (WT_SESSION *)session, len)); } /* @@ -149,6 +150,6 @@ __wt_write(WT_SESSION_IMPL *session, WT_STAT_FAST_CONN_INCR(session, write_io); - return (fh->handle->write( + return (fh->handle->fh_write( fh->handle, (WT_SESSION *)session, offset, len, buf)); } diff --git a/src/include/os_fs.i b/src/include/os_fs.i index 151898711d8..88ee71d953a 100644 --- a/src/include/os_fs.i +++ b/src/include/os_fs.i @@ -30,7 +30,7 @@ __wt_fs_directory_list(WT_SESSION_IMPL *session, file_system = S2C(session)->file_system; wt_session = (WT_SESSION *)session; - ret = file_system->directory_list( + ret = file_system->fs_directory_list( file_system, wt_session, path, prefix, dirlistp, countp); __wt_free(session, path); @@ -52,7 +52,7 @@ __wt_fs_directory_list_free( if (*dirlistp != NULL) { file_system = S2C(session)->file_system; wt_session = (WT_SESSION *)session; - ret = file_system->directory_list_free( + ret = file_system->fs_directory_list_free( file_system, wt_session, *dirlistp, count); } @@ -88,7 +88,7 @@ __wt_fs_directory_sync(WT_SESSION_IMPL *session, const char *name) * needed. */ file_system = S2C(session)->file_system; - if (file_system->directory_sync == NULL) + if (file_system->fs_directory_sync == NULL) return (0); copy = NULL; @@ -109,7 +109,7 @@ __wt_fs_directory_sync(WT_SESSION_IMPL *session, const char *name) } wt_session = (WT_SESSION *)session; - ret = file_system->directory_sync(file_system, wt_session, name); + ret = file_system->fs_directory_sync(file_system, wt_session, name); __wt_free(session, copy); return (ret); @@ -133,7 +133,7 @@ __wt_fs_exist(WT_SESSION_IMPL *session, const char *name, bool *existp) file_system = S2C(session)->file_system; wt_session = (WT_SESSION *)session; - ret = file_system->exist(file_system, wt_session, path, existp); + ret = file_system->fs_exist(file_system, wt_session, path, existp); __wt_free(session, path); return (ret); @@ -169,7 +169,7 @@ __wt_fs_remove(WT_SESSION_IMPL *session, const char *name) file_system = S2C(session)->file_system; wt_session = (WT_SESSION *)session; - ret = file_system->remove(file_system, wt_session, path); + ret = file_system->fs_remove(file_system, wt_session, path); __wt_free(session, path); return (ret); @@ -211,7 +211,8 @@ __wt_fs_rename(WT_SESSION_IMPL *session, const char *from, const char *to) file_system = S2C(session)->file_system; wt_session = (WT_SESSION *)session; - ret = file_system->rename(file_system, wt_session, from_path, to_path); + ret = file_system->fs_rename( + file_system, wt_session, from_path, to_path); err: __wt_free(session, from_path); __wt_free(session, to_path); @@ -236,7 +237,7 @@ __wt_fs_size(WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep) file_system = S2C(session)->file_system; wt_session = (WT_SESSION *)session; - ret = file_system->size(file_system, wt_session, path, sizep); + ret = file_system->fs_size(file_system, wt_session, path, sizep); __wt_free(session, path); return (ret); diff --git a/src/include/os_fstream.i b/src/include/os_fstream.i index 37a6039d1b7..8c0fdadbdb0 100644 --- a/src/include/os_fstream.i +++ b/src/include/os_fstream.i @@ -11,9 +11,9 @@ * Get a line from a stream. */ static inline int -__wt_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) +__wt_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fstr, WT_ITEM *buf) { - return (fs->getline(session, fs, buf)); + return (fstr->fstr_getline(session, fstr, buf)); } /* @@ -21,14 +21,14 @@ __wt_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) * Close a stream. */ static inline int -__wt_fclose(WT_SESSION_IMPL *session, WT_FSTREAM **fsp) +__wt_fclose(WT_SESSION_IMPL *session, WT_FSTREAM **fstrp) { - WT_FSTREAM *fs; + WT_FSTREAM *fstr; - if ((fs = *fsp) == NULL) + if ((fstr = *fstrp) == NULL) return (0); - *fsp = NULL; - return (fs->close(session, fs)); + *fstrp = NULL; + return (fstr->close(session, fstr)); } /* @@ -36,9 +36,9 @@ __wt_fclose(WT_SESSION_IMPL *session, WT_FSTREAM **fsp) * Flush a stream. */ static inline int -__wt_fflush(WT_SESSION_IMPL *session, WT_FSTREAM *fs) +__wt_fflush(WT_SESSION_IMPL *session, WT_FSTREAM *fstr) { - return (fs->flush(session, fs)); + return (fstr->fstr_flush(session, fstr)); } /* @@ -47,12 +47,12 @@ __wt_fflush(WT_SESSION_IMPL *session, WT_FSTREAM *fs) */ static inline int __wt_vfprintf( - WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, va_list ap) + WT_SESSION_IMPL *session, WT_FSTREAM *fstr, const char *fmt, va_list ap) { WT_RET(__wt_verbose( - session, WT_VERB_HANDLEOPS, "%s: handle-printf", fs->name)); + session, WT_VERB_HANDLEOPS, "%s: handle-printf", fstr->name)); - return (fs->printf(session, fs, fmt, ap)); + return (fstr->fstr_printf(session, fstr, fmt, ap)); } /* @@ -60,14 +60,14 @@ __wt_vfprintf( * ANSI C fprintf. */ static inline int -__wt_fprintf(WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, ...) +__wt_fprintf(WT_SESSION_IMPL *session, WT_FSTREAM *fstr, const char *fmt, ...) WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4))) { WT_DECL_RET; va_list ap; va_start(ap, fmt); - ret = __wt_vfprintf(session, fs, fmt, ap); + ret = __wt_vfprintf(session, fstr, fmt, ap); va_end(ap); return (ret); @@ -79,18 +79,18 @@ __wt_fprintf(WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, ...) */ static inline int __wt_sync_and_rename(WT_SESSION_IMPL *session, - WT_FSTREAM **fsp, const char *from, const char *to) + WT_FSTREAM **fstrp, const char *from, const char *to) { WT_DECL_RET; - WT_FSTREAM *fs; + WT_FSTREAM *fstr; - fs = *fsp; - *fsp = NULL; + fstr = *fstrp; + *fstrp = NULL; /* Flush to disk and close the handle. */ - WT_TRET(__wt_fflush(session, fs)); - WT_TRET(__wt_fsync(session, fs->fh, true)); - WT_TRET(__wt_fclose(session, &fs)); + WT_TRET(__wt_fflush(session, fstr)); + WT_TRET(__wt_fsync(session, fstr->fh, true)); + WT_TRET(__wt_fclose(session, &fstr)); WT_RET(ret); return (__wt_rename_and_sync_directory(session, from, to)); diff --git a/src/include/session.h b/src/include/session.h index 7fdb7fc2548..aa51dae58c4 100644 --- a/src/include/session.h +++ b/src/include/session.h @@ -198,7 +198,7 @@ struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_session_impl { ((s)->hazard == NULL) /* The number of hazard pointers grows dynamically. */ -#define WT_HAZARD_INCR 10 +#define WT_HAZARD_INCR 1 uint32_t hazard_size; /* Allocated slots in hazard array. */ uint32_t nhazard; /* Count of active hazard pointers */ WT_HAZARD *hazard; /* Hazard pointer array */ diff --git a/src/include/stat.h b/src/include/stat.h index 18461b1ee38..a71e0fa208e 100644 --- a/src/include/stat.h +++ b/src/include/stat.h @@ -275,6 +275,9 @@ struct __wt_connection_stats { int64_t cache_eviction_worker_evicting; int64_t cache_eviction_force_fail; int64_t cache_eviction_hazard; + int64_t cache_hazard_checks; + int64_t cache_hazard_walks; + int64_t cache_hazard_max; int64_t cache_inmem_splittable; int64_t cache_inmem_split; int64_t cache_eviction_internal; diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 007df44f257..6de92b72051 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -1229,9 +1229,6 @@ struct __wt_session { * @configstart{WT_SESSION.drop, see dist/api_data.py} * @config{force, return success if the object does not exist., a * boolean flag; default \c false.} - * @config{lock_wait, wait for locks\, if \c lock_wait=false\, fail if - * any required locks are not available immediately., a boolean flag; - * default \c true.} * @config{remove_files, should the underlying files be removed?., a * boolean flag; default \c true.} * @configend @@ -3756,9 +3753,9 @@ struct __wt_file_system { * directory. * @param[out] countp the method the number of entries returned */ - int (*directory_list)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, - const char *directory, const char *prefix, char ***dirlist, - uint32_t *countp); + int (*fs_directory_list)(WT_FILE_SYSTEM *file_system, + WT_SESSION *session, const char *directory, const char *prefix, + char ***dirlist, uint32_t *countp); /*! * Free memory allocated by WT_FILE_SYSTEM::directory_list. @@ -3770,7 +3767,7 @@ struct __wt_file_system { * @param dirlist array returned by WT_FILE_SYSTEM::directory_list * @param count count returned by WT_FILE_SYSTEM::directory_list */ - int (*directory_list_free)(WT_FILE_SYSTEM *file_system, + int (*fs_directory_list_free)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, char **dirlist, uint32_t count); /*! @@ -3787,7 +3784,7 @@ struct __wt_file_system { * @param session the current WiredTiger session * @param directory the name of the directory */ - int (*directory_sync)(WT_FILE_SYSTEM *file_system, + int (*fs_directory_sync)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *directory); /*! @@ -3800,7 +3797,7 @@ struct __wt_file_system { * @param name the name of the file * @param[out] existp If the named file system object exists */ - int (*exist)(WT_FILE_SYSTEM *file_system, + int (*fs_exist)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *name, bool *existp); /*! @@ -3824,7 +3821,7 @@ struct __wt_file_system { * with the WT_FILE_HANDLE:: structure should declare and allocate * their own structure as a superset of a WT_FILE_HANDLE:: structure. */ - int (*open_file)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, + int (*fs_open_file)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *name, WT_OPEN_FILE_TYPE file_type, uint32_t flags, WT_FILE_HANDLE **file_handlep); @@ -3840,7 +3837,7 @@ struct __wt_file_system { * @param session the current WiredTiger session * @param name the name of the file system object */ - int (*remove)( + int (*fs_remove)( WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *name); /*! @@ -3856,7 +3853,7 @@ struct __wt_file_system { * @param from the original name of the object * @param to the new name for the object */ - int (*rename)(WT_FILE_SYSTEM *file_system, + int (*fs_rename)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *from, const char *to); /*! @@ -3869,7 +3866,7 @@ struct __wt_file_system { * @param name the name of the file system object * @param[out] sizep the size of the file system entry */ - int (*size)(WT_FILE_SYSTEM *file_system, + int (*fs_size)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *name, wt_off_t *sizep); /*! @@ -3938,7 +3935,7 @@ struct __wt_file_handle { * @param advice one of ::WT_FILE_HANDLE_WILLNEED or * ::WT_FILE_HANDLE_DONTNEED. */ - int (*fadvise)(WT_FILE_HANDLE *file_handle, + int (*fh_advise)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t offset, wt_off_t len, int advice); /*! @@ -3960,7 +3957,7 @@ struct __wt_file_handle { * @param offset the file offset * @param len the size of the advisory */ - int (*fallocate)(WT_FILE_HANDLE *file_handle, + int (*fh_allocate)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t, wt_off_t); /*! @@ -3982,7 +3979,7 @@ struct __wt_file_handle { * @param offset the file offset * @param len the size of the advisory */ - int (*fallocate_nolock)(WT_FILE_HANDLE *file_handle, + int (*fh_allocate_nolock)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t, wt_off_t); /*! @@ -3995,7 +3992,7 @@ struct __wt_file_handle { * @param session the current WiredTiger session * @param lock whether to lock or unlock */ - int (*lock)( + int (*fh_lock)( WT_FILE_HANDLE *file_handle, WT_SESSION *session, bool lock); /*! @@ -4016,7 +4013,7 @@ struct __wt_file_handle { * which can be optionally stored a pointer to an opaque cookie * which is subsequently passed to WT_FILE_HANDLE::unmap. */ - int (*map)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, + int (*fh_map)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, void *mapped_regionp, size_t *lengthp, void *mapped_cookiep); /*! @@ -4035,7 +4032,7 @@ struct __wt_file_handle { * @param length the length of the mapped region to discard * @param mapped_cookie any cookie set by the WT_FILE_HANDLE::map method */ - int (*map_discard)(WT_FILE_HANDLE *file_handle, + int (*fh_map_discard)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, void *map, size_t length, void *mapped_cookie); /*! @@ -4054,7 +4051,7 @@ struct __wt_file_handle { * @param length the size of the mapped region to preload * @param mapped_cookie any cookie set by the WT_FILE_HANDLE::map method */ - int (*map_preload)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, + int (*fh_map_preload)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, const void *map, size_t length, void *mapped_cookie); /*! @@ -4072,7 +4069,7 @@ struct __wt_file_handle { * @param length the length of the mapped region * @param mapped_cookie any cookie set by the WT_FILE_HANDLE::map method */ - int (*unmap)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, + int (*fh_unmap)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, void *mapped_region, size_t length, void *mapped_cookie); /*! @@ -4086,7 +4083,7 @@ struct __wt_file_handle { * @param len the amount to read * @param[out] buf buffer to hold the content read from file */ - int (*read)(WT_FILE_HANDLE *file_handle, + int (*fh_read)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t offset, size_t len, void *buf); /*! @@ -4098,7 +4095,7 @@ struct __wt_file_handle { * @param session the current WiredTiger session * @param sizep the size of the file */ - int (*size)( + int (*fh_size)( WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t *sizep); /*! @@ -4113,7 +4110,7 @@ struct __wt_file_handle { * @param file_handle the WT_FILE_HANDLE * @param session the current WiredTiger session */ - int (*sync)(WT_FILE_HANDLE *file_handle, WT_SESSION *session); + int (*fh_sync)(WT_FILE_HANDLE *file_handle, WT_SESSION *session); /*! * Schedule the outstanding file writes required for durability and @@ -4127,7 +4124,7 @@ struct __wt_file_handle { * @param file_handle the WT_FILE_HANDLE * @param session the current WiredTiger session */ - int (*sync_nowait)(WT_FILE_HANDLE *file_handle, WT_SESSION *session); + int (*fh_sync_nowait)(WT_FILE_HANDLE *file_handle, WT_SESSION *session); /*! * Lengthen or shorten a file to the specified length, based on the @@ -4142,7 +4139,7 @@ struct __wt_file_handle { * @param session the current WiredTiger session * @param length desired file size after truncate */ - int (*truncate)( + int (*fh_truncate)( WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t length); /*! @@ -4159,7 +4156,7 @@ struct __wt_file_handle { * @param length amount of data to write * @param buf content to be written to the file */ - int (*write)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, + int (*fh_write)(WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t offset, size_t length, const void *buf); }; #endif /* !defined(SWIG) */ @@ -4303,257 +4300,263 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1046 /*! cache: hazard pointer blocked page eviction */ #define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1047 +/*! cache: hazard pointer check calls */ +#define WT_STAT_CONN_CACHE_HAZARD_CHECKS 1048 +/*! cache: hazard pointer check entries walked */ +#define WT_STAT_CONN_CACHE_HAZARD_WALKS 1049 +/*! cache: hazard pointer maximum array length */ +#define WT_STAT_CONN_CACHE_HAZARD_MAX 1050 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1048 +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1051 /*! cache: in-memory page splits */ -#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1049 +#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1052 /*! cache: internal pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1050 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1053 /*! cache: internal pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1051 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1054 /*! cache: leaf pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1052 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1055 /*! cache: lookaside table insert calls */ -#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1053 +#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1056 /*! cache: lookaside table remove calls */ -#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1054 +#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1057 /*! cache: maximum bytes configured */ -#define WT_STAT_CONN_CACHE_BYTES_MAX 1055 +#define WT_STAT_CONN_CACHE_BYTES_MAX 1058 /*! cache: maximum page size at eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1056 +#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1059 /*! cache: modified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1057 +#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1060 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1058 +#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1061 /*! cache: page written requiring lookaside records */ -#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1059 +#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1062 /*! cache: pages currently held in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_INUSE 1060 +#define WT_STAT_CONN_CACHE_PAGES_INUSE 1063 /*! cache: pages evicted because they exceeded the in-memory maximum */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1061 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1064 /*! cache: pages evicted because they had chains of deleted items */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1062 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1065 /*! cache: pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP 1063 +#define WT_STAT_CONN_CACHE_EVICTION_APP 1066 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1064 +#define WT_STAT_CONN_CACHE_READ 1067 /*! cache: pages read into cache requiring lookaside entries */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1065 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1068 /*! cache: pages requested from the cache */ -#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1066 +#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1069 /*! cache: pages selected for eviction unable to be evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1067 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1070 /*! cache: pages walked for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK 1068 +#define WT_STAT_CONN_CACHE_EVICTION_WALK 1071 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1069 +#define WT_STAT_CONN_CACHE_WRITE 1072 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1070 +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1073 /*! cache: percentage overhead */ -#define WT_STAT_CONN_CACHE_OVERHEAD 1071 +#define WT_STAT_CONN_CACHE_OVERHEAD 1074 /*! cache: tracked bytes belonging to internal pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1072 +#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1075 /*! cache: tracked bytes belonging to leaf pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_LEAF 1073 +#define WT_STAT_CONN_CACHE_BYTES_LEAF 1076 /*! cache: tracked bytes belonging to overflow pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1074 +#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1077 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1075 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1078 /*! cache: tracked dirty pages in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1076 +#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1079 /*! cache: unmodified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1077 +#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1080 /*! connection: auto adjusting condition resets */ -#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1078 +#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1081 /*! connection: auto adjusting condition wait calls */ -#define WT_STAT_CONN_COND_AUTO_WAIT 1079 +#define WT_STAT_CONN_COND_AUTO_WAIT 1082 /*! connection: files currently open */ -#define WT_STAT_CONN_FILE_OPEN 1080 +#define WT_STAT_CONN_FILE_OPEN 1083 /*! connection: memory allocations */ -#define WT_STAT_CONN_MEMORY_ALLOCATION 1081 +#define WT_STAT_CONN_MEMORY_ALLOCATION 1084 /*! connection: memory frees */ -#define WT_STAT_CONN_MEMORY_FREE 1082 +#define WT_STAT_CONN_MEMORY_FREE 1085 /*! connection: memory re-allocations */ -#define WT_STAT_CONN_MEMORY_GROW 1083 +#define WT_STAT_CONN_MEMORY_GROW 1086 /*! connection: pthread mutex condition wait calls */ -#define WT_STAT_CONN_COND_WAIT 1084 +#define WT_STAT_CONN_COND_WAIT 1087 /*! connection: pthread mutex shared lock read-lock calls */ -#define WT_STAT_CONN_RWLOCK_READ 1085 +#define WT_STAT_CONN_RWLOCK_READ 1088 /*! connection: pthread mutex shared lock write-lock calls */ -#define WT_STAT_CONN_RWLOCK_WRITE 1086 +#define WT_STAT_CONN_RWLOCK_WRITE 1089 /*! connection: total read I/Os */ -#define WT_STAT_CONN_READ_IO 1087 +#define WT_STAT_CONN_READ_IO 1090 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1088 +#define WT_STAT_CONN_WRITE_IO 1091 /*! cursor: cursor create calls */ -#define WT_STAT_CONN_CURSOR_CREATE 1089 +#define WT_STAT_CONN_CURSOR_CREATE 1092 /*! cursor: cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT 1090 +#define WT_STAT_CONN_CURSOR_INSERT 1093 /*! cursor: cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT 1091 +#define WT_STAT_CONN_CURSOR_NEXT 1094 /*! cursor: cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV 1092 +#define WT_STAT_CONN_CURSOR_PREV 1095 /*! cursor: cursor remove calls */ -#define WT_STAT_CONN_CURSOR_REMOVE 1093 +#define WT_STAT_CONN_CURSOR_REMOVE 1096 /*! cursor: cursor reset calls */ -#define WT_STAT_CONN_CURSOR_RESET 1094 +#define WT_STAT_CONN_CURSOR_RESET 1097 /*! cursor: cursor restarted searches */ -#define WT_STAT_CONN_CURSOR_RESTART 1095 +#define WT_STAT_CONN_CURSOR_RESTART 1098 /*! cursor: cursor search calls */ -#define WT_STAT_CONN_CURSOR_SEARCH 1096 +#define WT_STAT_CONN_CURSOR_SEARCH 1099 /*! cursor: cursor search near calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1097 +#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1100 /*! cursor: cursor update calls */ -#define WT_STAT_CONN_CURSOR_UPDATE 1098 +#define WT_STAT_CONN_CURSOR_UPDATE 1101 /*! cursor: truncate calls */ -#define WT_STAT_CONN_CURSOR_TRUNCATE 1099 +#define WT_STAT_CONN_CURSOR_TRUNCATE 1102 /*! data-handle: connection data handles currently active */ -#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1100 +#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1103 /*! data-handle: connection sweep candidate became referenced */ -#define WT_STAT_CONN_DH_SWEEP_REF 1101 +#define WT_STAT_CONN_DH_SWEEP_REF 1104 /*! data-handle: connection sweep dhandles closed */ -#define WT_STAT_CONN_DH_SWEEP_CLOSE 1102 +#define WT_STAT_CONN_DH_SWEEP_CLOSE 1105 /*! data-handle: connection sweep dhandles removed from hash list */ -#define WT_STAT_CONN_DH_SWEEP_REMOVE 1103 +#define WT_STAT_CONN_DH_SWEEP_REMOVE 1106 /*! data-handle: connection sweep time-of-death sets */ -#define WT_STAT_CONN_DH_SWEEP_TOD 1104 +#define WT_STAT_CONN_DH_SWEEP_TOD 1107 /*! data-handle: connection sweeps */ -#define WT_STAT_CONN_DH_SWEEPS 1105 +#define WT_STAT_CONN_DH_SWEEPS 1108 /*! data-handle: session dhandles swept */ -#define WT_STAT_CONN_DH_SESSION_HANDLES 1106 +#define WT_STAT_CONN_DH_SESSION_HANDLES 1109 /*! data-handle: session sweep attempts */ -#define WT_STAT_CONN_DH_SESSION_SWEEPS 1107 +#define WT_STAT_CONN_DH_SESSION_SWEEPS 1110 /*! log: busy returns attempting to switch slots */ -#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1108 +#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1111 /*! log: consolidated slot closures */ -#define WT_STAT_CONN_LOG_SLOT_CLOSES 1109 +#define WT_STAT_CONN_LOG_SLOT_CLOSES 1112 /*! log: consolidated slot join races */ -#define WT_STAT_CONN_LOG_SLOT_RACES 1110 +#define WT_STAT_CONN_LOG_SLOT_RACES 1113 /*! log: consolidated slot join transitions */ -#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1111 +#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1114 /*! log: consolidated slot joins */ -#define WT_STAT_CONN_LOG_SLOT_JOINS 1112 +#define WT_STAT_CONN_LOG_SLOT_JOINS 1115 /*! log: consolidated slot unbuffered writes */ -#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1113 +#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1116 /*! log: log bytes of payload data */ -#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1114 +#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1117 /*! log: log bytes written */ -#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1115 +#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1118 /*! log: log files manually zero-filled */ -#define WT_STAT_CONN_LOG_ZERO_FILLS 1116 +#define WT_STAT_CONN_LOG_ZERO_FILLS 1119 /*! log: log flush operations */ -#define WT_STAT_CONN_LOG_FLUSH 1117 +#define WT_STAT_CONN_LOG_FLUSH 1120 /*! log: log force write operations */ -#define WT_STAT_CONN_LOG_FORCE_WRITE 1118 +#define WT_STAT_CONN_LOG_FORCE_WRITE 1121 /*! log: log force write operations skipped */ -#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1119 +#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1122 /*! log: log records compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1120 +#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1123 /*! log: log records not compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1121 +#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1124 /*! log: log records too small to compress */ -#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1122 +#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1125 /*! log: log release advances write LSN */ -#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1123 +#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1126 /*! log: log scan operations */ -#define WT_STAT_CONN_LOG_SCANS 1124 +#define WT_STAT_CONN_LOG_SCANS 1127 /*! log: log scan records requiring two reads */ -#define WT_STAT_CONN_LOG_SCAN_REREADS 1125 +#define WT_STAT_CONN_LOG_SCAN_REREADS 1128 /*! log: log server thread advances write LSN */ -#define WT_STAT_CONN_LOG_WRITE_LSN 1126 +#define WT_STAT_CONN_LOG_WRITE_LSN 1129 /*! log: log server thread write LSN walk skipped */ -#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1127 +#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1130 /*! log: log sync operations */ -#define WT_STAT_CONN_LOG_SYNC 1128 +#define WT_STAT_CONN_LOG_SYNC 1131 /*! log: log sync_dir operations */ -#define WT_STAT_CONN_LOG_SYNC_DIR 1129 +#define WT_STAT_CONN_LOG_SYNC_DIR 1132 /*! log: log write operations */ -#define WT_STAT_CONN_LOG_WRITES 1130 +#define WT_STAT_CONN_LOG_WRITES 1133 /*! log: logging bytes consolidated */ -#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1131 +#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1134 /*! log: maximum log file size */ -#define WT_STAT_CONN_LOG_MAX_FILESIZE 1132 +#define WT_STAT_CONN_LOG_MAX_FILESIZE 1135 /*! log: number of pre-allocated log files to create */ -#define WT_STAT_CONN_LOG_PREALLOC_MAX 1133 +#define WT_STAT_CONN_LOG_PREALLOC_MAX 1136 /*! log: pre-allocated log files not ready and missed */ -#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1134 +#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1137 /*! log: pre-allocated log files prepared */ -#define WT_STAT_CONN_LOG_PREALLOC_FILES 1135 +#define WT_STAT_CONN_LOG_PREALLOC_FILES 1138 /*! log: pre-allocated log files used */ -#define WT_STAT_CONN_LOG_PREALLOC_USED 1136 +#define WT_STAT_CONN_LOG_PREALLOC_USED 1139 /*! log: records processed by log scan */ -#define WT_STAT_CONN_LOG_SCAN_RECORDS 1137 +#define WT_STAT_CONN_LOG_SCAN_RECORDS 1140 /*! log: total in-memory size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_MEM 1138 +#define WT_STAT_CONN_LOG_COMPRESS_MEM 1141 /*! log: total log buffer size */ -#define WT_STAT_CONN_LOG_BUFFER_SIZE 1139 +#define WT_STAT_CONN_LOG_BUFFER_SIZE 1142 /*! log: total size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_LEN 1140 +#define WT_STAT_CONN_LOG_COMPRESS_LEN 1143 /*! log: written slots coalesced */ -#define WT_STAT_CONN_LOG_SLOT_COALESCED 1141 +#define WT_STAT_CONN_LOG_SLOT_COALESCED 1144 /*! log: yields waiting for previous log file close */ -#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1142 +#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1145 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1143 +#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1146 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1144 +#define WT_STAT_CONN_REC_PAGES 1147 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1145 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1148 /*! reconciliation: pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE 1146 +#define WT_STAT_CONN_REC_PAGE_DELETE 1149 /*! reconciliation: split bytes currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1147 +#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1150 /*! reconciliation: split objects currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1148 +#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1151 /*! session: open cursor count */ -#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1149 +#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1152 /*! session: open session count */ -#define WT_STAT_CONN_SESSION_OPEN 1150 +#define WT_STAT_CONN_SESSION_OPEN 1153 /*! thread-yield: page acquire busy blocked */ -#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1151 +#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1154 /*! thread-yield: page acquire eviction blocked */ -#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1152 +#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1155 /*! thread-yield: page acquire locked blocked */ -#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1153 +#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1156 /*! thread-yield: page acquire read blocked */ -#define WT_STAT_CONN_PAGE_READ_BLOCKED 1154 +#define WT_STAT_CONN_PAGE_READ_BLOCKED 1157 /*! thread-yield: page acquire time sleeping (usecs) */ -#define WT_STAT_CONN_PAGE_SLEEP 1155 +#define WT_STAT_CONN_PAGE_SLEEP 1158 /*! transaction: number of named snapshots created */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1156 +#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1159 /*! transaction: number of named snapshots dropped */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1157 +#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1160 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1158 +#define WT_STAT_CONN_TXN_BEGIN 1161 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1159 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1162 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1160 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1163 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1161 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1164 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1162 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1165 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1163 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1166 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1164 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1167 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1165 +#define WT_STAT_CONN_TXN_CHECKPOINT 1168 /*! transaction: transaction failures due to cache overflow */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1166 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1169 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1167 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1170 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1168 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1171 /*! transaction: transaction range of IDs currently pinned by named * snapshots */ -#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1169 +#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1172 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1170 +#define WT_STAT_CONN_TXN_SYNC 1173 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1171 +#define WT_STAT_CONN_TXN_COMMIT 1174 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1172 +#define WT_STAT_CONN_TXN_ROLLBACK 1175 /*! * @} diff --git a/src/meta/meta_turtle.c b/src/meta/meta_turtle.c index 635daf63d7f..4d2b359bbed 100644 --- a/src/meta/meta_turtle.c +++ b/src/meta/meta_turtle.c @@ -18,12 +18,9 @@ __metadata_config(WT_SESSION_IMPL *session, char **metaconfp) WT_DECL_ITEM(buf); WT_DECL_RET; const char *cfg[] = { WT_CONFIG_BASE(session, file_meta), NULL, NULL }; - char *metaconf; *metaconfp = NULL; - metaconf = NULL; - /* Create a turtle file with default values. */ WT_RET(__wt_scr_alloc(session, 0, &buf)); WT_ERR(__wt_buf_fmt(session, buf, @@ -31,14 +28,9 @@ __metadata_config(WT_SESSION_IMPL *session, char **metaconfp) WT_METAFILE_ID, WT_BTREE_MAJOR_VERSION_MAX, WT_BTREE_MINOR_VERSION_MAX)); cfg[1] = buf->data; - WT_ERR(__wt_config_collapse(session, cfg, &metaconf)); + ret = __wt_config_collapse(session, cfg, metaconfp); - *metaconfp = metaconf; - - if (0) { -err: __wt_free(session, metaconf); - } - __wt_scr_free(session, &buf); +err: __wt_scr_free(session, &buf); return (ret); } diff --git a/src/os_common/os_fhandle.c b/src/os_common/os_fhandle.c index 818829203e0..50404c8b354 100644 --- a/src/os_common/os_fhandle.c +++ b/src/os_common/os_fhandle.c @@ -32,13 +32,13 @@ __fhandle_method_finalize( /* not required: map_discard */ /* not required: map_preload */ /* not required: map_unmap */ - WT_HANDLE_METHOD_REQ(read); - WT_HANDLE_METHOD_REQ(size); + WT_HANDLE_METHOD_REQ(fh_read); + WT_HANDLE_METHOD_REQ(fh_size); /* not required: sync */ /* not required: sync_nowait */ if (!readonly) { - WT_HANDLE_METHOD_REQ(truncate); - WT_HANDLE_METHOD_REQ(write); + WT_HANDLE_METHOD_REQ(fh_truncate); + WT_HANDLE_METHOD_REQ(fh_write); } return (0); @@ -255,7 +255,7 @@ __wt_open(WT_SESSION_IMPL *session, WT_ERR(__wt_filename(session, name, &path)); /* Call the underlying open function. */ - WT_ERR(file_system->open_file(file_system, &session->iface, + WT_ERR(file_system->fs_open_file(file_system, &session->iface, path == NULL ? name : path, file_type, flags, &fh->handle)); open_called = true; diff --git a/src/os_common/os_fs_inmemory.c b/src/os_common/os_fs_inmemory.c index 53da3f10e5c..3e4fe628892 100644 --- a/src/os_common/os_fs_inmemory.c +++ b/src/os_common/os_fs_inmemory.c @@ -512,10 +512,10 @@ __im_file_open(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, WT_FILE_HANDLE_INSERT(im_fs, im_fh, bucket); file_handle->close = __im_file_close; - file_handle->read = __im_file_read; - file_handle->size = __im_file_size; - file_handle->truncate = __im_file_truncate; - file_handle->write = __im_file_write; + file_handle->fh_read = __im_file_read; + file_handle->fh_size = __im_file_size; + file_handle->fh_truncate = __im_file_truncate; + file_handle->fh_write = __im_file_write; *file_handlep = file_handle; @@ -576,13 +576,13 @@ __wt_os_inmemory(WT_SESSION_IMPL *session) /* Initialize the in-memory jump table. */ file_system = (WT_FILE_SYSTEM *)im_fs; - file_system->directory_list = __im_fs_directory_list; - file_system->directory_list_free = __im_fs_directory_list_free; - file_system->exist = __im_fs_exist; - file_system->open_file = __im_file_open; - file_system->remove = __im_fs_remove; - file_system->rename = __im_fs_rename; - file_system->size = __im_fs_size; + file_system->fs_directory_list = __im_fs_directory_list; + file_system->fs_directory_list_free = __im_fs_directory_list_free; + file_system->fs_exist = __im_fs_exist; + file_system->fs_open_file = __im_file_open; + file_system->fs_remove = __im_fs_remove; + file_system->fs_rename = __im_fs_rename; + file_system->fs_size = __im_fs_size; file_system->terminate = __im_terminate; /* Switch the file system into place. */ diff --git a/src/os_common/os_fstream.c b/src/os_common/os_fstream.c index fc0daf1c211..0b199529e19 100644 --- a/src/os_common/os_fstream.c +++ b/src/os_common/os_fstream.c @@ -16,16 +16,16 @@ * Close a stream handle. */ static int -__fstream_close(WT_SESSION_IMPL *session, WT_FSTREAM *fs) +__fstream_close(WT_SESSION_IMPL *session, WT_FSTREAM *fstr) { WT_DECL_RET; - if (!F_ISSET(fs, WT_STREAM_READ)) - WT_TRET(fs->flush(session, fs)); + if (!F_ISSET(fstr, WT_STREAM_READ)) + WT_TRET(fstr->fstr_flush(session, fstr)); - WT_TRET(__wt_close(session, &fs->fh)); - __wt_buf_free(session, &fs->buf); - __wt_free(session, fs); + WT_TRET(__wt_close(session, &fstr->fh)); + __wt_buf_free(session, &fstr->buf); + __wt_free(session, fstr); return (ret); } @@ -34,13 +34,13 @@ __fstream_close(WT_SESSION_IMPL *session, WT_FSTREAM *fs) * Flush the data from a stream. */ static int -__fstream_flush(WT_SESSION_IMPL *session, WT_FSTREAM *fs) +__fstream_flush(WT_SESSION_IMPL *session, WT_FSTREAM *fstr) { - if (fs->buf.size > 0) { - WT_RET(__wt_write( - session, fs->fh, fs->off, fs->buf.size, fs->buf.data)); - fs->off += (wt_off_t)fs->buf.size; - fs->buf.size = 0; + if (fstr->buf.size > 0) { + WT_RET(__wt_write(session, + fstr->fh, fstr->off, fstr->buf.size, fstr->buf.data)); + fstr->off += (wt_off_t)fstr->buf.size; + fstr->buf.size = 0; } return (0); @@ -51,9 +51,9 @@ __fstream_flush(WT_SESSION_IMPL *session, WT_FSTREAM *fs) * Stream flush unsupported. */ static int -__fstream_flush_notsup(WT_SESSION_IMPL *session, WT_FSTREAM *fs) +__fstream_flush_notsup(WT_SESSION_IMPL *session, WT_FSTREAM *fstr) { - WT_RET_MSG(session, ENOTSUP, "%s: flush", fs->name); + WT_RET_MSG(session, ENOTSUP, "%s: flush", fstr->name); } /* @@ -68,7 +68,7 @@ __fstream_flush_notsup(WT_SESSION_IMPL *session, WT_FSTREAM *fs) * (so the caller's EOF marker is a returned line length of 0). */ static int -__fstream_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) +__fstream_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fstr, WT_ITEM *buf) { const char *p; size_t len; @@ -82,19 +82,20 @@ __fstream_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) for (;;) { /* Check if we need to refill the buffer. */ - if (WT_PTRDIFF(fs->buf.data, fs->buf.mem) >= fs->buf.size) { + if (WT_PTRDIFF(fstr->buf.data, fstr->buf.mem) >= + fstr->buf.size) { len = WT_MIN(WT_STREAM_BUFSIZE, - (size_t)(fs->size - fs->off)); + (size_t)(fstr->size - fstr->off)); if (len == 0) break; /* EOF */ - WT_RET(__wt_buf_initsize(session, &fs->buf, len)); + WT_RET(__wt_buf_initsize(session, &fstr->buf, len)); WT_RET(__wt_read( - session, fs->fh, fs->off, len, fs->buf.mem)); - fs->off += (wt_off_t)len; + session, fstr->fh, fstr->off, len, fstr->buf.mem)); + fstr->off += (wt_off_t)len; } - c = *(p = fs->buf.data); - fs->buf.data = ++p; + c = *(p = fstr->buf.data); + fstr->buf.data = ++p; /* Leave space for a trailing NUL. */ WT_RET(__wt_buf_extend(session, buf, buf->size + 2)); @@ -116,10 +117,11 @@ __fstream_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) * Stream getline unsupported. */ static int -__fstream_getline_notsup(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) +__fstream_getline_notsup( + WT_SESSION_IMPL *session, WT_FSTREAM *fstr, WT_ITEM *buf) { WT_UNUSED(buf); - WT_RET_MSG(session, ENOTSUP, "%s: getline", fs->name); + WT_RET_MSG(session, ENOTSUP, "%s: getline", fstr->name); } /* @@ -128,14 +130,14 @@ __fstream_getline_notsup(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf) */ static int __fstream_printf( - WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, va_list ap) + WT_SESSION_IMPL *session, WT_FSTREAM *fstr, const char *fmt, va_list ap) { WT_ITEM *buf; va_list ap_copy; size_t len, space; char *p; - buf = &fs->buf; + buf = &fstr->buf; for (;;) { va_copy(ap_copy, ap); @@ -149,7 +151,7 @@ __fstream_printf( buf->size += len; return (buf->size >= WT_STREAM_BUFSIZE ? - __wt_fflush(session, fs) : 0); + __wt_fflush(session, fstr) : 0); } WT_RET(__wt_buf_extend(session, buf, buf->size + len + 1)); } @@ -161,11 +163,11 @@ __fstream_printf( */ static int __fstream_printf_notsup( - WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, va_list ap) + WT_SESSION_IMPL *session, WT_FSTREAM *fstr, const char *fmt, va_list ap) { WT_UNUSED(fmt); WT_UNUSED(ap); - WT_RET_MSG(session, ENOTSUP, "%s: printf", fs->name); + WT_RET_MSG(session, ENOTSUP, "%s: printf", fstr->name); } /* @@ -174,40 +176,42 @@ __fstream_printf_notsup( */ int __wt_fopen(WT_SESSION_IMPL *session, - const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fsp) + const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fstrp) { WT_DECL_RET; WT_FH *fh; - WT_FSTREAM *fs; + WT_FSTREAM *fstr; - fs = NULL; + *fstrp = NULL; + + fstr = NULL; WT_RET(__wt_open( session, name, WT_OPEN_FILE_TYPE_REGULAR, open_flags, &fh)); - WT_ERR(__wt_calloc_one(session, &fs)); - fs->fh = fh; - fs->name = fh->name; - fs->flags = flags; + WT_ERR(__wt_calloc_one(session, &fstr)); + fstr->fh = fh; + fstr->name = fh->name; + fstr->flags = flags; - fs->close = __fstream_close; - WT_ERR(__wt_filesize(session, fh, &fs->size)); + fstr->close = __fstream_close; + WT_ERR(__wt_filesize(session, fh, &fstr->size)); if (LF_ISSET(WT_STREAM_APPEND)) - fs->off = fs->size; + fstr->off = fstr->size; if (LF_ISSET(WT_STREAM_APPEND | WT_STREAM_WRITE)) { - fs->flush = __fstream_flush; - fs->getline = __fstream_getline_notsup; - fs->printf = __fstream_printf; + fstr->fstr_flush = __fstream_flush; + fstr->fstr_getline = __fstream_getline_notsup; + fstr->fstr_printf = __fstream_printf; } else { WT_ASSERT(session, LF_ISSET(WT_STREAM_READ)); - fs->flush = __fstream_flush_notsup; - fs->getline = __fstream_getline; - fs->printf = __fstream_printf_notsup; + fstr->fstr_flush = __fstream_flush_notsup; + fstr->fstr_getline = __fstream_getline; + fstr->fstr_printf = __fstream_printf_notsup; } - *fsp = fs; + *fstrp = fstr; return (0); err: WT_TRET(__wt_close(session, &fh)); - __wt_free(session, *fsp); + __wt_free(session, fstr); return (ret); } diff --git a/src/os_common/os_fstream_stdio.c b/src/os_common/os_fstream_stdio.c index 4b0c761024b..eea2c80ff0e 100644 --- a/src/os_common/os_fstream_stdio.c +++ b/src/os_common/os_fstream_stdio.c @@ -65,9 +65,9 @@ __stdio_init(WT_FSTREAM *fs, const char *name, FILE *fp) fs->fp = fp; fs->close = __stdio_close; - fs->flush = __stdio_flush; - fs->getline = __stdio_getline; - fs->printf = __stdio_printf; + fs->fstr_flush = __stdio_flush; + fs->fstr_getline = __stdio_getline; + fs->fstr_printf = __stdio_printf; } /* diff --git a/src/os_posix/os_fallocate.c b/src/os_posix/os_fallocate.c index a162dbe01a1..9e5d9519900 100644 --- a/src/os_posix/os_fallocate.c +++ b/src/os_posix/os_fallocate.c @@ -125,28 +125,28 @@ __wt_posix_file_fallocate(WT_FILE_HANDLE *file_handle, * avoid locking on Linux if at all possible. */ if (__posix_std_fallocate(file_handle, wt_session, offset, len) == 0) { - file_handle->fallocate_nolock = __posix_std_fallocate; - WT_PUBLISH(file_handle->fallocate, NULL); + file_handle->fh_allocate_nolock = __posix_std_fallocate; + WT_PUBLISH(file_handle->fh_allocate, NULL); return (0); } if (__posix_sys_fallocate(file_handle, wt_session, offset, len) == 0) { - file_handle->fallocate_nolock = __posix_sys_fallocate; - WT_PUBLISH(file_handle->fallocate, NULL); + file_handle->fh_allocate_nolock = __posix_sys_fallocate; + WT_PUBLISH(file_handle->fh_allocate, NULL); return (0); } if (__posix_posix_fallocate( file_handle, wt_session, offset, len) == 0) { #if defined(__linux__) - file_handle->fallocate = __posix_posix_fallocate; + file_handle->fh_allocate = __posix_posix_fallocate; WT_WRITE_BARRIER(); #else - file_handle->fallocate_nolock = __posix_posix_fallocate; - WT_PUBLISH(file_handle->fallocate, NULL); + file_handle->fh_allocate_nolock = __posix_posix_fallocate; + WT_PUBLISH(file_handle->fh_allocate, NULL); #endif return (0); } - file_handle->fallocate = NULL; + file_handle->fh_allocate = NULL; WT_WRITE_BARRIER(); return (ENOTSUP); } diff --git a/src/os_posix/os_fs.c b/src/os_posix/os_fs.c index ab9c82613d6..c05f75f2bd5 100644 --- a/src/os_posix/os_fs.c +++ b/src/os_posix/os_fs.c @@ -1,9 +1,29 @@ /*- - * Copyright (c) 2014-2016 MongoDB, Inc. - * Copyright (c) 2008-2014 WiredTiger, Inc. - * All rights reserved. + * Public Domain 2014-2016 MongoDB, Inc. + * Public Domain 2008-2014 WiredTiger, Inc. * - * See the file LICENSE for redistribution information. + * 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. */ #include "wt_internal.h" @@ -208,7 +228,7 @@ __posix_file_advise(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, * handle method to prevent future calls. */ if (ret == EINVAL) { - file_handle->fadvise = NULL; + file_handle->fh_advise = NULL; return (ENOTSUP); } @@ -603,31 +623,31 @@ directory_open: * interesting. */ if (!pfh->direct_io) - file_handle->fadvise = __posix_file_advise; + file_handle->fh_advise = __posix_file_advise; #endif - file_handle->fallocate = __wt_posix_file_fallocate; - file_handle->lock = __posix_file_lock; + file_handle->fh_allocate = __wt_posix_file_fallocate; + file_handle->fh_lock = __posix_file_lock; #ifdef WORDS_BIGENDIAN /* * The underlying objects are little-endian, mapping objects isn't * currently supported on big-endian systems. */ #else - file_handle->map = __wt_posix_map; + file_handle->fh_map = __wt_posix_map; #ifdef HAVE_POSIX_MADVISE - file_handle->map_discard = __wt_posix_map_discard; - file_handle->map_preload = __wt_posix_map_preload; + file_handle->fh_map_discard = __wt_posix_map_discard; + file_handle->fh_map_preload = __wt_posix_map_preload; #endif - file_handle->unmap = __wt_posix_unmap; + file_handle->fh_unmap = __wt_posix_unmap; #endif - file_handle->read = __posix_file_read; - file_handle->size = __posix_file_size; - file_handle->sync = __posix_file_sync; + file_handle->fh_read = __posix_file_read; + file_handle->fh_size = __posix_file_size; + file_handle->fh_sync = __posix_file_sync; #ifdef HAVE_SYNC_FILE_RANGE - file_handle->sync_nowait = __posix_file_sync_nowait; + file_handle->fh_sync_nowait = __posix_file_sync_nowait; #endif - file_handle->truncate = __posix_file_truncate; - file_handle->write = __posix_file_write; + file_handle->fh_truncate = __posix_file_truncate; + file_handle->fh_write = __posix_file_write; *file_handlep = file_handle; @@ -669,16 +689,16 @@ __wt_os_posix(WT_SESSION_IMPL *session) WT_RET(__wt_calloc_one(session, &file_system)); /* Initialize the POSIX jump table. */ - file_system->directory_list = __wt_posix_directory_list; - file_system->directory_list_free = __wt_posix_directory_list_free; + file_system->fs_directory_list = __wt_posix_directory_list; + file_system->fs_directory_list_free = __wt_posix_directory_list_free; #ifdef __linux__ - file_system->directory_sync = __posix_directory_sync; + file_system->fs_directory_sync = __posix_directory_sync; #endif - file_system->exist = __posix_fs_exist; - file_system->open_file = __posix_open_file; - file_system->remove = __posix_fs_remove; - file_system->rename = __posix_fs_rename; - file_system->size = __posix_fs_size; + file_system->fs_exist = __posix_fs_exist; + file_system->fs_open_file = __posix_open_file; + file_system->fs_remove = __posix_fs_remove; + file_system->fs_rename = __posix_fs_rename; + file_system->fs_size = __posix_fs_size; file_system->terminate = __posix_terminate; /* Switch it into place. */ diff --git a/src/os_posix/os_map.c b/src/os_posix/os_map.c index 7fde4037250..9cdb58b95c8 100644 --- a/src/os_posix/os_map.c +++ b/src/os_posix/os_map.c @@ -40,7 +40,7 @@ __wt_posix_map(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, * underneath us, our caller needs to ensure consistency of the mapped * region vs. any other file activity. */ - WT_RET(fh->size(fh, wt_session, &file_size)); + WT_RET(fh->fh_size(fh, wt_session, &file_size)); len = (size_t)file_size; (void)__wt_verbose(session, WT_VERB_HANDLEOPS, diff --git a/src/os_win/os_fs.c b/src/os_win/os_fs.c index 33e281bf8ae..c4a1235b61b 100644 --- a/src/os_win/os_fs.c +++ b/src/os_win/os_fs.c @@ -498,21 +498,21 @@ directory_open: WT_ERR(__wt_strdup(session, name, &file_handle->name)); file_handle->close = __win_file_close; - file_handle->lock = __win_file_lock; + file_handle->fh_lock = __win_file_lock; #ifdef WORDS_BIGENDIAN /* * The underlying objects are little-endian, mapping objects isn't * currently supported on big-endian systems. */ #else - file_handle->map = __wt_win_map; - file_handle->unmap = __wt_win_unmap; + file_handle->fh_map = __wt_win_map; + file_handle->fh_unmap = __wt_win_unmap; #endif - file_handle->read = __win_file_read; - file_handle->size = __win_file_size; - file_handle->sync = __win_file_sync; - file_handle->truncate = __win_file_truncate; - file_handle->write = __win_file_write; + file_handle->fh_read = __win_file_read; + file_handle->fh_size = __win_file_size; + file_handle->fh_sync = __win_file_sync; + file_handle->fh_truncate = __win_file_truncate; + file_handle->fh_write = __win_file_write; *file_handlep = file_handle; @@ -552,13 +552,13 @@ __wt_os_win(WT_SESSION_IMPL *session) WT_RET(__wt_calloc_one(session, &file_system)); /* Initialize the Windows jump table. */ - file_system->directory_list = __wt_win_directory_list; - file_system->directory_list_free = __wt_win_directory_list_free; - file_system->exist = __win_fs_exist; - file_system->open_file = __win_open_file; - file_system->remove = __win_fs_remove; - file_system->rename = __win_fs_rename; - file_system->size = __wt_win_fs_size; + file_system->fs_directory_list = __wt_win_directory_list; + file_system->fs_directory_list_free = __wt_win_directory_list_free; + file_system->fs_exist = __win_fs_exist; + file_system->fs_open_file = __win_open_file; + file_system->fs_remove = __win_fs_remove; + file_system->fs_rename = __win_fs_rename; + file_system->fs_size = __wt_win_fs_size; file_system->terminate = __win_terminate; /* Switch it into place. */ diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index a46662b4b9d..6e406fc7180 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -383,8 +383,11 @@ __wt_reconcile(WT_SESSION_IMPL *session, mod->last_oldest_id = oldest_id; /* Initialize the reconciliation structure for each new run. */ - WT_RET(__rec_write_init( - session, ref, flags, salvage, &session->reconcile)); + if ((ret = __rec_write_init( + session, ref, flags, salvage, &session->reconcile)) != 0) { + WT_TRET(__wt_fair_unlock(session, &page->page_lock)); + return (ret); + } r = session->reconcile; /* Reconcile the page. */ @@ -4269,14 +4272,14 @@ __rec_col_var(WT_SESSION_IMPL *session, last = r->last; vpack = &_vpack; + WT_RET(__rec_split_init( + session, r, page, pageref->ref_recno, btree->maxleafpage)); + WT_RET(__wt_scr_alloc(session, 0, &orig)); data = NULL; size = 0; upd = NULL; - WT_RET(__rec_split_init( - session, r, page, pageref->ref_recno, btree->maxleafpage)); - /* * The salvage code may be calling us to reconcile a page where there * were missing records in the column-store name space. If taking the @@ -5019,8 +5022,8 @@ __rec_row_leaf(WT_SESSION_IMPL *session, * Temporary buffers in which to instantiate any uninstantiated keys * or value items we need. */ - WT_RET(__wt_scr_alloc(session, 0, &tmpkey)); - WT_RET(__wt_scr_alloc(session, 0, &tmpval)); + WT_ERR(__wt_scr_alloc(session, 0, &tmpkey)); + WT_ERR(__wt_scr_alloc(session, 0, &tmpval)); /* For each entry in the page... */ WT_ROW_FOREACH(page, rip, i) { @@ -5180,7 +5183,7 @@ __rec_row_leaf(WT_SESSION_IMPL *session, * can't remove them from the in-memory * tree; if an overflow key was deleted * without being instantiated (for - * example, cursor-based truncation, do + * example, cursor-based truncation), do * it now. */ if (ikey == NULL) diff --git a/src/session/session_api.c b/src/session/session_api.c index 933f2273902..77d1dc74c84 100644 --- a/src/session/session_api.c +++ b/src/session/session_api.c @@ -722,18 +722,29 @@ __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) { WT_DECL_RET; WT_CONFIG_ITEM cval; - bool lock_wait; + bool checkpoint_wait, lock_wait; + WT_RET(__wt_config_gets_def(session, cfg, "checkpoint_wait", 1, &cval)); + checkpoint_wait = cval.val != 0; WT_RET(__wt_config_gets_def(session, cfg, "lock_wait", 1, &cval)); lock_wait = cval.val != 0 || F_ISSET(session, WT_SESSION_LOCK_NO_WAIT); if (!lock_wait) F_SET(session, WT_SESSION_LOCK_NO_WAIT); - WT_WITH_CHECKPOINT_LOCK(session, ret, - WT_WITH_SCHEMA_LOCK(session, ret, - WT_WITH_TABLE_LOCK(session, ret, - ret = __wt_schema_drop(session, uri, cfg)))); + /* + * The checkpoint lock only is needed to avoid a spurious EBUSY error + * return. + */ + if (checkpoint_wait) + WT_WITH_CHECKPOINT_LOCK(session, ret, + WT_WITH_SCHEMA_LOCK(session, ret, + WT_WITH_TABLE_LOCK(session, ret, + ret = __wt_schema_drop(session, uri, cfg)))); + else + WT_WITH_SCHEMA_LOCK(session, ret, + WT_WITH_TABLE_LOCK(session, ret, + ret = __wt_schema_drop(session, uri, cfg))); if (!lock_wait) F_CLR(session, WT_SESSION_LOCK_NO_WAIT); @@ -1512,11 +1523,11 @@ err: WT_TRET(__wt_writeunlock(session, txn_global->nsnap_rwlock)); } /* - * __session_strerror -- + * __wt_session_strerror -- * WT_SESSION->strerror method. */ -static const char * -__session_strerror(WT_SESSION *wt_session, int error) +const char * +__wt_session_strerror(WT_SESSION *wt_session, int error) { WT_SESSION_IMPL *session; @@ -1539,7 +1550,7 @@ __open_session(WT_CONNECTION_IMPL *conn, NULL, __session_close, __session_reconfigure, - __session_strerror, + __wt_session_strerror, __session_open_cursor, __session_create, __wt_session_compact, @@ -1566,7 +1577,7 @@ __open_session(WT_CONNECTION_IMPL *conn, NULL, __session_close, __session_reconfigure, - __session_strerror, + __wt_session_strerror, __session_open_cursor, __session_create_readonly, __wt_session_compact_readonly, @@ -1675,7 +1686,7 @@ __open_session(WT_CONNECTION_IMPL *conn, * __wt_hazard_close ensures the array is cleared - so it is safe to * reset the starting size on each open. */ - session_ret->hazard_size = WT_HAZARD_INCR; + session_ret->hazard_size = 0; /* * Configuration: currently, the configuration for open_session is the diff --git a/src/support/stat.c b/src/support/stat.c index bb46ad03e43..7514aac56c4 100644 --- a/src/support/stat.c +++ b/src/support/stat.c @@ -562,6 +562,9 @@ static const char * const __stats_connection_desc[] = { "cache: eviction worker thread evicting pages", "cache: failed eviction of pages that exceeded the in-memory maximum", "cache: hazard pointer blocked page eviction", + "cache: hazard pointer check calls", + "cache: hazard pointer check entries walked", + "cache: hazard pointer maximum array length", "cache: in-memory page passed criteria to be split", "cache: in-memory page splits", "cache: internal pages evicted", @@ -765,6 +768,9 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_eviction_worker_evicting = 0; stats->cache_eviction_force_fail = 0; stats->cache_eviction_hazard = 0; + stats->cache_hazard_checks = 0; + stats->cache_hazard_walks = 0; + stats->cache_hazard_max = 0; stats->cache_inmem_splittable = 0; stats->cache_inmem_split = 0; stats->cache_eviction_internal = 0; @@ -905,6 +911,8 @@ void __wt_stat_connection_aggregate( WT_CONNECTION_STATS **from, WT_CONNECTION_STATS *to) { + int64_t v; + to->lsm_work_queue_app += WT_STAT_READ(from, lsm_work_queue_app); to->lsm_work_queue_manager += WT_STAT_READ(from, lsm_work_queue_manager); @@ -972,6 +980,10 @@ __wt_stat_connection_aggregate( WT_STAT_READ(from, cache_eviction_force_fail); to->cache_eviction_hazard += WT_STAT_READ(from, cache_eviction_hazard); + to->cache_hazard_checks += WT_STAT_READ(from, cache_hazard_checks); + to->cache_hazard_walks += WT_STAT_READ(from, cache_hazard_walks); + if ((v = WT_STAT_READ(from, cache_hazard_max)) > to->cache_hazard_max) + to->cache_hazard_max = v; to->cache_inmem_splittable += WT_STAT_READ(from, cache_inmem_splittable); to->cache_inmem_split += WT_STAT_READ(from, cache_inmem_split); diff --git a/src/utilities/util_load.c b/src/utilities/util_load.c index 696dc68630a..a81d06c6866 100644 --- a/src/utilities/util_load.c +++ b/src/utilities/util_load.c @@ -366,6 +366,7 @@ config_update(WT_SESSION *session, char **list) if (WT_PREFIX_MATCH(*listp, "colgroup:") || WT_PREFIX_MATCH(*listp, "file:") || WT_PREFIX_MATCH(*listp, "index:") || + WT_PREFIX_MATCH(*listp, "lsm:") || WT_PREFIX_MATCH(*listp, "table:")) if (config_rename(session, listp, cmdname)) return (1); |