diff options
49 files changed, 975 insertions, 618 deletions
diff --git a/src/third_party/wiredtiger/.clang-format b/src/third_party/wiredtiger/.clang-format index 5cd39db2e69..573572df901 100644 --- a/src/third_party/wiredtiger/.clang-format +++ b/src/third_party/wiredtiger/.clang-format @@ -49,14 +49,16 @@ ForEachMacros: - Q_FOREACH - BOOST_FOREACH - TAILQ_FOREACH + - WT_CELL_FOREACH_BEGIN + - WT_CELL_FOREACH_VRFY - WT_CKPT_FOREACH + - WT_COL_FOREACH - WT_EXT_FOREACH - WT_EXT_FOREACH_OFF - WT_FIX_FOREACH - - WT_CELL_FOREACH_BEGIN - - WT_CELL_FOREACH_VRFY - - WT_COL_FOREACH - WT_INTL_FOREACH_BEGIN + - WT_MODIFY_FOREACH_BEGIN + - WT_MODIFY_FOREACH_REVERSE - WT_ROW_FOREACH - WT_SKIP_FOREACH IncludeCategories: diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf.c b/src/third_party/wiredtiger/bench/wtperf/wtperf.c index 3a076d4244a..75a2ce04c50 100644 --- a/src/third_party/wiredtiger/bench/wtperf/wtperf.c +++ b/src/third_party/wiredtiger/bench/wtperf/wtperf.c @@ -387,7 +387,7 @@ worker_async(void *arg) break; goto op_err; default: - op_err: +op_err: lprintf(wtperf, ret, 0, "%s failed for: %s, range: %" PRIu64, op_name(op), key_buf, wtperf_value_range(wtperf)); goto err; /* can't happen */ @@ -717,7 +717,7 @@ worker(void *arg) if (ret == WT_NOTFOUND) break; - op_err: +op_err: if (ret == WT_ROLLBACK && ops_per_txn != 0) { /* * If we are running with explicit transactions configured and we hit a WT_ROLLBACK, diff --git a/src/third_party/wiredtiger/dist/s_clang-format b/src/third_party/wiredtiger/dist/s_clang-format index 58e4b59f077..1673946ee08 100755 --- a/src/third_party/wiredtiger/dist/s_clang-format +++ b/src/third_party/wiredtiger/dist/s_clang-format @@ -2,6 +2,9 @@ set -o pipefail +t=__wt.$$ +trap 'rm -rf $t' 0 1 2 3 13 15 + download_clang_format() { if [ `uname` = "Linux" ]; then curl https://s3.amazonaws.com/boxes.10gen.com/build/clang-format-3.8-rhel55.tar.gz -o dist/clang-format.tar.gz @@ -45,16 +48,15 @@ esac # Don't format inplace with -i flag. # We want to be able to detect modifications. for f in $search; do - tempfile=$(mktemp) cat "$f" | \ clang-format --fallback-style=none | \ python dist/s_goto.py | \ - python dist/s_comment.py > "$tempfile" || exit 1 - cmp --silent "$f" "$tempfile" + python dist/s_comment.py > "$t" || exit 1 + cmp --silent "$f" "$t" if test $? -ne 0; then if test $# -eq 0 ; then echo "Modifying $f" fi - mv "$tempfile" "$f" + cp "$t" "$f" fi done diff --git a/src/third_party/wiredtiger/dist/s_define.list b/src/third_party/wiredtiger/dist/s_define.list index 4ed32778cbb..c95b565aa37 100644 --- a/src/third_party/wiredtiger/dist/s_define.list +++ b/src/third_party/wiredtiger/dist/s_define.list @@ -73,6 +73,7 @@ WT_TRACK_OP_END WT_TRACK_OP_INIT WT_TRET_ERROR_OK WT_UPDATE_SIZE +WT_USE_OPENAT WT_WITH_LOCK_NOWAIT WT_WITH_LOCK_WAIT __F diff --git a/src/third_party/wiredtiger/dist/s_funcs.list b/src/third_party/wiredtiger/dist/s_funcs.list index bcedc19a459..0218937fffc 100644 --- a/src/third_party/wiredtiger/dist/s_funcs.list +++ b/src/third_party/wiredtiger/dist/s_funcs.list @@ -16,6 +16,7 @@ __wt_config_getone __wt_cursor_get_raw_value __wt_debug_addr __wt_debug_addr_print +__wt_debug_cursor_las __wt_debug_cursor_page __wt_debug_offset __wt_debug_set_verbose diff --git a/src/third_party/wiredtiger/dist/s_goto.py b/src/third_party/wiredtiger/dist/s_goto.py index 032084168cc..a7f35488603 100644 --- a/src/third_party/wiredtiger/dist/s_goto.py +++ b/src/third_party/wiredtiger/dist/s_goto.py @@ -6,7 +6,7 @@ import re, sys # 1. Zero or more whitespace characters. # 2. One or more lowercase ASCII characters. # 3. Colon character. -p = re.compile('^\s*[a-z]+:$') +p = re.compile('^\s*[a-z_]+:$') for line in sys.stdin: m = p.search(line) if m is not None: diff --git a/src/third_party/wiredtiger/dist/s_string.ok b/src/third_party/wiredtiger/dist/s_string.ok index f5f9e4ec814..17beab0f05f 100644 --- a/src/third_party/wiredtiger/dist/s_string.ok +++ b/src/third_party/wiredtiger/dist/s_string.ok @@ -154,6 +154,7 @@ Fsync Fuerst GCC GIDs +GLIBC Gcc Geoff GetEnvironmentVariableA @@ -1044,6 +1045,7 @@ online onpage oo opcode +openat opendir openfile oplist @@ -1206,6 +1208,7 @@ stdin stdout stepp str +strace strcmp strdup strerror diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py index b1849c31fa9..0187de7726d 100644 --- a/src/third_party/wiredtiger/dist/stat_data.py +++ b/src/third_party/wiredtiger/dist/stat_data.py @@ -220,6 +220,10 @@ connection_stats = [ CacheStat('cache_eviction_dirty', 'modified pages evicted'), CacheStat('cache_eviction_empty_score', 'eviction empty score', 'no_clear,no_scale'), CacheStat('cache_eviction_fail', 'pages selected for eviction unable to be evicted'), + CacheStat('cache_eviction_fail_active_children_on_an_internal_page', 'pages selected for eviction unable to be evicted because of active children on an internal page'), + CacheStat('cache_eviction_fail_in_reconciliation', 'pages selected for eviction unable to be evicted because of failure in reconciliation'), + CacheStat('cache_eviction_fail_parent_has_overflow_items', 'pages selected for eviction unable to be evicted as the parent page has overflow items'), + CacheStat('cache_eviction_fail_with_newer_modifications_on_a_clean_page', 'pages selected for eviction unable to be evicted due to newer modifications on a clean page'), CacheStat('cache_eviction_force', 'forced eviction - pages selected count'), CacheStat('cache_eviction_force_clean', 'forced eviction - pages evicted that were clean count'), CacheStat('cache_eviction_force_clean_time', 'forced eviction - pages evicted that were clean time (usecs)'), @@ -234,12 +238,16 @@ connection_stats = [ CacheStat('cache_eviction_get_ref_empty2', 'eviction calls to get a page found queue empty after locking'), CacheStat('cache_eviction_hazard', 'hazard pointer blocked page eviction'), CacheStat('cache_eviction_internal', 'internal pages evicted'), + CacheStat('cache_eviction_internal_pages_seen', 'internal pages seen by eviction walk'), + CacheStat('cache_eviction_internal_pages_already_queued', 'internal pages seen by eviction walk that are already queued'), + CacheStat('cache_eviction_internal_pages_queued', 'internal pages queued for eviction'), CacheStat('cache_eviction_maximum_page_size', 'maximum page size at eviction', 'no_clear,no_scale,size'), CacheStat('cache_eviction_pages_queued', 'pages queued for eviction'), CacheStat('cache_eviction_pages_queued_oldest', 'pages queued for urgent eviction during walk'), CacheStat('cache_eviction_pages_queued_post_lru', 'pages queued for eviction post lru sorting'), CacheStat('cache_eviction_pages_queued_urgent', 'pages queued for urgent eviction'), CacheStat('cache_eviction_pages_seen', 'pages seen by eviction walk'), + CacheStat('cache_eviction_pages_already_queued', 'pages seen by eviction walk that are already queued'), CacheStat('cache_eviction_queue_empty', 'eviction server candidate queue empty when topping up'), CacheStat('cache_eviction_queue_not_empty', 'eviction server candidate queue not empty when topping up'), CacheStat('cache_eviction_server_evicting', 'eviction server evicting pages'), @@ -254,6 +262,9 @@ connection_stats = [ CacheStat('cache_eviction_target_page_lt128', 'eviction walk target pages histogram - 64-128'), CacheStat('cache_eviction_target_page_lt32', 'eviction walk target pages histogram - 10-31'), CacheStat('cache_eviction_target_page_lt64', 'eviction walk target pages histogram - 32-63'), + CacheStat('cache_eviction_target_strategy_clean', 'eviction walk target strategy only clean pages'), + CacheStat('cache_eviction_target_strategy_dirty', 'eviction walk target strategy only dirty pages'), + CacheStat('cache_eviction_target_strategy_both_clean_and_dirty', 'eviction walk target strategy both clean and dirty pages'), CacheStat('cache_eviction_walk', 'pages walked for eviction'), CacheStat('cache_eviction_walk_from_root', 'eviction walks started from root of tree'), CacheStat('cache_eviction_walk_internal_yield', 'eviction server waiting for an internal page yields'), diff --git a/src/third_party/wiredtiger/ext/datasources/helium/helium.c b/src/third_party/wiredtiger/ext/datasources/helium/helium.c index 5ce9844eab2..976bd10fd14 100644 --- a/src/third_party/wiredtiger/ext/datasources/helium/helium.c +++ b/src/third_party/wiredtiger/ext/datasources/helium/helium.c @@ -1794,7 +1794,7 @@ ws_source_open(WT_DATA_SOURCE *wtds, WT_SESSION *session, const char *uri, WT_CO goto bad_name; p = uri + strlen("helium:"); if (p[0] == '/' || (t = strchr(p, '/')) == NULL || t[1] == '\0') - bad_name: +bad_name: ERET(wt_api, session, EINVAL, "%s: illegal name format", uri); len = (size_t)(t - p); diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index f4e6d7e2682..e93ddf4c3e0 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -1,6 +1,6 @@ { - "commit": "e651c9e2742e3b571a26fa13862426260899a5cf", - "github": "wiredtiger/wiredtiger.git", - "vendor": "wiredtiger", - "branch": "mongodb-4.0" + "vendor": "wiredtiger", + "github": "wiredtiger/wiredtiger.git", + "branch": "mongodb-4.0", + "commit": "54a846c423023183195dccc634aff4770f11ba54" } diff --git a/src/third_party/wiredtiger/src/btree/bt_curnext.c b/src/third_party/wiredtiger/src/btree/bt_curnext.c index 1085d26315a..d5857f75bd3 100644 --- a/src/third_party/wiredtiger/src/btree/bt_curnext.c +++ b/src/third_party/wiredtiger/src/btree/bt_curnext.c @@ -60,7 +60,7 @@ __cursor_fix_append_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) cbt->v = 0; cbt->iface.value.data = &cbt->v; } else { - restart_read: +restart_read: WT_RET(__wt_txn_read(session, cbt->ins->upd, &upd)); if (upd == NULL) { cbt->v = 0; @@ -114,7 +114,7 @@ new_page: if (cbt->ins != NULL && cbt->recno != WT_INSERT_RECNO(cbt->ins)) cbt->ins = NULL; if (cbt->ins != NULL) { - restart_read: +restart_read: WT_RET(__wt_txn_read(session, cbt->ins->upd, &upd)); } if (upd == NULL) { @@ -149,12 +149,12 @@ __cursor_var_append_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) for (;;) { cbt->ins = WT_SKIP_NEXT(cbt->ins); - new_page: +new_page: if (cbt->ins == NULL) return (WT_NOTFOUND); __cursor_set_recno(cbt, WT_INSERT_RECNO(cbt->ins)); - restart_read: +restart_read: WT_RET(__wt_txn_read(session, cbt->ins->upd, &upd)); if (upd == NULL) continue; @@ -163,7 +163,7 @@ __cursor_var_append_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) ++cbt->page_deleted_count; continue; } - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); } /* NOTREACHED */ } @@ -213,8 +213,8 @@ __cursor_var_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) return (WT_NOTFOUND); __cursor_set_recno(cbt, cbt->recno + 1); - new_page: - restart_read: +new_page: +restart_read: /* Find the matching WT_COL slot. */ if ((cip = __col_var_search(cbt->ref, cbt->recno, &rle_start)) == NULL) return (WT_NOTFOUND); @@ -232,7 +232,7 @@ __cursor_var_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) ++cbt->page_deleted_count; continue; } - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); } /* @@ -346,9 +346,9 @@ __cursor_row_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) if (cbt->ins != NULL) cbt->ins = WT_SKIP_NEXT(cbt->ins); - new_insert: +new_insert: cbt->iter_retry = WT_CBT_RETRY_INSERT; - restart_read_insert: +restart_read_insert: if ((ins = cbt->ins) != NULL) { WT_RET(__wt_txn_read(session, ins->upd, &upd)); if (upd == NULL) @@ -360,7 +360,7 @@ __cursor_row_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) } key->data = WT_INSERT_KEY(ins); key->size = WT_INSERT_KEY_SIZE(ins); - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); } /* Check for the end of the page. */ @@ -381,7 +381,7 @@ __cursor_row_next(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) cbt->ins = NULL; cbt->iter_retry = WT_CBT_RETRY_PAGE; cbt->slot = cbt->row_iteration_slot / 2 - 1; - restart_read_page: +restart_read_page: rip = &page->pg_row[cbt->slot]; WT_RET(__wt_txn_read(session, WT_ROW_UPDATE(page, rip), &upd)); if (upd != NULL && upd->type == WT_UPDATE_TOMBSTONE) { @@ -489,8 +489,12 @@ __wt_cursor_key_order_check(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool * Initialize key ordering checks for cursor movements after a successful search. */ int -__wt_cursor_key_order_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) +__wt_cursor_key_order_init(WT_CURSOR_BTREE *cbt) { + WT_SESSION_IMPL *session; + + session = (WT_SESSION_IMPL *)cbt->iface.session; + /* * Cursor searches set the position for cursor movements, set the last-key value for diagnostic * checking. diff --git a/src/third_party/wiredtiger/src/btree/bt_curprev.c b/src/third_party/wiredtiger/src/btree/bt_curprev.c index 9aa8d08345d..8abdc5b54e6 100644 --- a/src/third_party/wiredtiger/src/btree/bt_curprev.c +++ b/src/third_party/wiredtiger/src/btree/bt_curprev.c @@ -200,7 +200,7 @@ __cursor_fix_append_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) cbt->iface.value.data = &cbt->v; } else { upd = NULL; - restart_read: +restart_read: WT_RET(__wt_txn_read(session, cbt->ins->upd, &upd)); if (upd == NULL) { cbt->v = 0; @@ -254,7 +254,7 @@ new_page: cbt->ins = NULL; upd = NULL; if (cbt->ins != NULL) { - restart_read: +restart_read: WT_RET(__wt_txn_read(session, cbt->ins->upd, &upd)); } if (upd == NULL) { @@ -289,12 +289,12 @@ __cursor_var_append_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) for (;;) { WT_RET(__cursor_skip_prev(cbt)); - new_page: +new_page: if (cbt->ins == NULL) return (WT_NOTFOUND); __cursor_set_recno(cbt, WT_INSERT_RECNO(cbt->ins)); - restart_read: +restart_read: WT_RET(__wt_txn_read(session, cbt->ins->upd, &upd)); if (upd == NULL) continue; @@ -303,7 +303,7 @@ __cursor_var_append_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) ++cbt->page_deleted_count; continue; } - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); } /* NOTREACHED */ } @@ -351,11 +351,12 @@ __cursor_var_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) for (;;) { __cursor_set_recno(cbt, cbt->recno - 1); - new_page: +new_page: if (cbt->recno < cbt->ref->ref_recno) return (WT_NOTFOUND); - restart_read: /* Find the matching WT_COL slot. */ +restart_read: + /* Find the matching WT_COL slot. */ if ((cip = __col_var_search(cbt->ref, cbt->recno, &rle_start)) == NULL) return (WT_NOTFOUND); cbt->slot = WT_COL_SLOT(page, cip); @@ -372,7 +373,7 @@ __cursor_var_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) ++cbt->page_deleted_count; continue; } - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); } /* @@ -495,9 +496,9 @@ __cursor_row_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) if (cbt->ins != NULL) WT_RET(__cursor_skip_prev(cbt)); - new_insert: +new_insert: cbt->iter_retry = WT_CBT_RETRY_INSERT; - restart_read_insert: +restart_read_insert: if ((ins = cbt->ins) != NULL) { WT_RET(__wt_txn_read(session, ins->upd, &upd)); if (upd == NULL) @@ -509,7 +510,7 @@ __cursor_row_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) } key->data = WT_INSERT_KEY(ins); key->size = WT_INSERT_KEY_SIZE(ins); - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); } /* Check for the beginning of the page. */ @@ -533,7 +534,7 @@ __cursor_row_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) cbt->iter_retry = WT_CBT_RETRY_PAGE; cbt->slot = cbt->row_iteration_slot / 2 - 1; - restart_read_page: +restart_read_page: rip = &page->pg_row[cbt->slot]; WT_RET(__wt_txn_read(session, WT_ROW_UPDATE(page, rip), &upd)); if (upd != NULL && upd->type == WT_UPDATE_TOMBSTONE) { diff --git a/src/third_party/wiredtiger/src/btree/bt_cursor.c b/src/third_party/wiredtiger/src/btree/bt_cursor.c index dc4f30c073b..74dccc4098e 100644 --- a/src/third_party/wiredtiger/src/btree/bt_cursor.c +++ b/src/third_party/wiredtiger/src/btree/bt_cursor.c @@ -87,17 +87,16 @@ __cursor_page_pinned(WT_CURSOR_BTREE *cbt) return (false); /* - * If we are doing an update, we need a page with history, release the page so we get it again - * with history if required. Eviction may be locking the page, wait until we see a "normal" - * state and then test against that state (eviction may have already locked the page again). + * We need a page with history: updates need complete update lists and a read might be based on + * a different timestamp than the one that brought the page into memory. Release the page and + * read it again with history if required. Eviction may be locking the page, wait until we see a + * "normal" state and then test against that state (eviction may have already locked the page + * again). */ - if (F_ISSET(&session->txn, WT_TXN_UPDATE)) { - while ((current_state = cbt->ref->state) == WT_REF_LOCKED) - __wt_yield(); - return (current_state == WT_REF_MEM); - } - - return (true); + while ((current_state = cbt->ref->state) == WT_REF_LOCKED) + __wt_yield(); + WT_ASSERT(session, current_state == WT_REF_LIMBO || current_state == WT_REF_MEM); + return (current_state == WT_REF_MEM); } /* @@ -356,11 +355,14 @@ __wt_cursor_valid(WT_CURSOR_BTREE *cbt, WT_UPDATE **updp, bool *valid) * Column-store search from a cursor. */ static inline int -__cursor_col_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_REF *leaf) +__cursor_col_search(WT_CURSOR_BTREE *cbt, WT_REF *leaf, bool *leaf_foundp) { WT_DECL_RET; + WT_SESSION_IMPL *session; - WT_WITH_PAGE_INDEX(session, ret = __wt_col_search(session, cbt->iface.recno, leaf, cbt, false)); + session = (WT_SESSION_IMPL *)cbt->iface.session; + WT_WITH_PAGE_INDEX( + session, ret = __wt_col_search(cbt, cbt->iface.recno, leaf, false, leaf_foundp)); return (ret); } @@ -369,12 +371,14 @@ __cursor_col_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_REF *leaf * Row-store search from a cursor. */ static inline int -__cursor_row_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_REF *leaf, bool insert) +__cursor_row_search(WT_CURSOR_BTREE *cbt, bool insert, WT_REF *leaf, bool *leaf_foundp) { WT_DECL_RET; + WT_SESSION_IMPL *session; + session = (WT_SESSION_IMPL *)cbt->iface.session; WT_WITH_PAGE_INDEX( - session, ret = __wt_row_search(session, &cbt->iface.key, leaf, cbt, insert, false)); + session, ret = __wt_row_search(cbt, &cbt->iface.key, insert, leaf, false, leaf_foundp)); return (ret); } @@ -383,10 +387,9 @@ __cursor_row_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_REF *leaf * Column-store modify from a cursor, with a separate value. */ static inline int -__cursor_col_modify_v( - WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) +__cursor_col_modify_v(WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) { - return (__wt_col_modify(session, cbt, cbt->iface.recno, value, NULL, modify_type, false)); + return (__wt_col_modify(cbt, cbt->iface.recno, value, NULL, modify_type, false)); } /* @@ -394,10 +397,9 @@ __cursor_col_modify_v( * Row-store modify from a cursor, with a separate value. */ static inline int -__cursor_row_modify_v( - WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) +__cursor_row_modify_v(WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) { - return (__wt_row_modify(session, cbt, &cbt->iface.key, value, NULL, modify_type, false)); + return (__wt_row_modify(cbt, &cbt->iface.key, value, NULL, modify_type, false)); } /* @@ -405,10 +407,9 @@ __cursor_row_modify_v( * Column-store modify from a cursor. */ static inline int -__cursor_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, u_int modify_type) +__cursor_col_modify(WT_CURSOR_BTREE *cbt, u_int modify_type) { - return ( - __wt_col_modify(session, cbt, cbt->iface.recno, &cbt->iface.value, NULL, modify_type, false)); + return (__wt_col_modify(cbt, cbt->iface.recno, &cbt->iface.value, NULL, modify_type, false)); } /* @@ -416,10 +417,9 @@ __cursor_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, u_int modify * Row-store modify from a cursor. */ static inline int -__cursor_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, u_int modify_type) +__cursor_row_modify(WT_CURSOR_BTREE *cbt, u_int modify_type) { - return ( - __wt_row_modify(session, cbt, &cbt->iface.key, &cbt->iface.value, NULL, modify_type, false)); + return (__wt_row_modify(cbt, &cbt->iface.key, &cbt->iface.value, NULL, modify_type, false)); } /* @@ -473,8 +473,8 @@ __wt_btcur_search_uncommitted(WT_CURSOR_BTREE *cbt, WT_UPDATE **updp) session = (WT_SESSION_IMPL *)cursor->session; *updp = upd = NULL; /* -Wuninitialized */ - WT_RET(btree->type == BTREE_ROW ? __cursor_row_search(session, cbt, NULL, false) : - __cursor_col_search(session, cbt, NULL)); + WT_RET(btree->type == BTREE_ROW ? __cursor_row_search(cbt, false, NULL, NULL) : + __cursor_col_search(cbt, NULL, NULL)); /* * Ideally exact match should be found, as this transaction has searched for updates done by @@ -513,7 +513,7 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt) WT_DECL_RET; WT_SESSION_IMPL *session; WT_UPDATE *upd; - bool valid; + bool leaf_found, valid; btree = cbt->btree; cursor = &cbt->iface; @@ -544,18 +544,18 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt) if (__cursor_page_pinned(cbt)) { __wt_txn_cursor_op(session); - WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(session, cbt, cbt->ref, false) : - __cursor_col_search(session, cbt, cbt->ref)); + WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(cbt, false, cbt->ref, &leaf_found) : + __cursor_col_search(cbt, cbt->ref, &leaf_found)); /* Return, if prepare conflict encountered. */ - if (cbt->compare == 0) + if (leaf_found && cbt->compare == 0) WT_ERR(__wt_cursor_valid(cbt, &upd, &valid)); } if (!valid) { WT_ERR(__cursor_func_init(cbt, true)); - WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(session, cbt, NULL, false) : - __cursor_col_search(session, cbt, NULL)); + WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(cbt, false, NULL, NULL) : + __cursor_col_search(cbt, NULL, NULL)); /* Return, if prepare conflict encountered. */ if (cbt->compare == 0) @@ -563,7 +563,7 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt) } if (valid) - ret = __cursor_kv_return(session, cbt, upd); + ret = __cursor_kv_return(cbt, upd); else if (__cursor_fix_implicit(btree, cbt)) { /* * Creating a record past the end of the tree in a fixed-length column-store implicitly @@ -580,7 +580,7 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt) #ifdef HAVE_DIAGNOSTIC if (ret == 0) - WT_ERR(__wt_cursor_key_order_init(session, cbt)); + WT_ERR(__wt_cursor_key_order_init(cbt)); #endif err: @@ -605,7 +605,7 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp) WT_SESSION_IMPL *session; WT_UPDATE *upd; int exact; - bool valid; + bool leaf_found, valid; btree = cbt->btree; cursor = &cbt->iface; @@ -630,37 +630,42 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp) __cursor_state_save(cursor, &state); /* - * If we have a row-store page pinned, search it; if we don't have a - * page pinned, or the search of the pinned page doesn't find an exact - * match, search from the root. Unlike WT_CURSOR.search, ignore pinned - * pages in the case of column-store, search-near isn't an interesting - * enough case for column-store to add the complexity needed to avoid - * the tree search. - * - * Set the "insert" flag for the btree row-store search; we may intend - * to position the cursor at the end of the tree, rather than match an - * existing record. + * If we have a row-store page pinned, search it; if we don't have a page pinned, or the search + * of the pinned page doesn't find an exact match, search from the root. Unlike + * WT_CURSOR.search, ignore pinned pages in the case of column-store, search-near isn't an + * interesting enough case for column-store to add the complexity needed to avoid the tree + * search. */ valid = false; if (btree->type == BTREE_ROW && __cursor_page_pinned(cbt)) { __wt_txn_cursor_op(session); - WT_ERR(__cursor_row_search(session, cbt, cbt->ref, true)); + /* + * Set the "insert" flag for row-store search; we may intend to position the cursor at the + * the end of the tree, rather than match an existing record. (LSM requires this semantic.) + */ + WT_ERR(__cursor_row_search(cbt, true, cbt->ref, &leaf_found)); /* - * Search-near is trickier than search when searching an already pinned page. If search - * returns the first or last page slots, discard the results and search the full tree as the - * neighbor pages might offer better matches. This test is simplistic as we're ignoring - * append lists (there may be no page slots or we might be legitimately positioned after the - * last page slot). Ignore those cases, it makes things too complicated. + * Only use the pinned page search results if search returns an exact match or a slot other + * than the page's boundary slots, if that's not the case, a neighbor page might offer a + * better match. This test is simplistic as we're ignoring append lists (there may be no + * page slots or we might be legitimately positioned after the last page slot). Ignore those + * cases, it makes things too complicated. */ - if (cbt->slot != 0 && cbt->slot != cbt->ref->page->entries - 1) + if (leaf_found && + (cbt->compare == 0 || (cbt->slot != 0 && cbt->slot != cbt->ref->page->entries - 1))) WT_ERR(__wt_cursor_valid(cbt, &upd, &valid)); } if (!valid) { WT_ERR(__cursor_func_init(cbt, true)); - WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(session, cbt, NULL, true) : - __cursor_col_search(session, cbt, NULL)); + + /* + * Set the "insert" flag for row-store search; we may intend to position the cursor at the + * the end of the tree, rather than match an existing record. (LSM requires this semantic.) + */ + WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(cbt, true, NULL, NULL) : + __cursor_col_search(cbt, NULL, NULL)); WT_ERR(__wt_cursor_valid(cbt, &upd, &valid)); } @@ -683,7 +688,7 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp) */ if (valid) { exact = cbt->compare; - ret = __cursor_kv_return(session, cbt, upd); + ret = __cursor_kv_return(cbt, upd); } else if (__cursor_fix_implicit(btree, cbt)) { cbt->recno = cursor->recno; cbt->v = 0; @@ -729,7 +734,7 @@ err: #ifdef HAVE_DIAGNOSTIC if (ret == 0) - WT_TRET(__wt_cursor_key_order_init(session, cbt)); + WT_TRET(__wt_cursor_key_order_init(cbt)); #endif if (ret != 0) { @@ -798,8 +803,8 @@ __wt_btcur_insert(WT_CURSOR_BTREE *cbt) * Correct to an exact match so we can update whatever we're pointing at. */ cbt->compare = 0; - ret = btree->type == BTREE_ROW ? __cursor_row_modify(session, cbt, WT_UPDATE_STANDARD) : - __cursor_col_modify(session, cbt, WT_UPDATE_STANDARD); + ret = btree->type == BTREE_ROW ? __cursor_row_modify(cbt, WT_UPDATE_STANDARD) : + __cursor_col_modify(cbt, WT_UPDATE_STANDARD); if (ret == 0) goto done; @@ -826,7 +831,7 @@ retry: WT_ERR(__cursor_func_init(cbt, true)); if (btree->type == BTREE_ROW) { - WT_ERR(__cursor_row_search(session, cbt, NULL, true)); + WT_ERR(__cursor_row_search(cbt, true, NULL, NULL)); /* * If not overwriting, fail if the key exists, else insert the key/value pair. */ @@ -836,7 +841,7 @@ retry: WT_ERR(WT_DUPLICATE_KEY); } - ret = __cursor_row_modify(session, cbt, WT_UPDATE_STANDARD); + ret = __cursor_row_modify(cbt, WT_UPDATE_STANDARD); } else if (append_key) { /* * Optionally insert a new record (ignoring the application's record number). The real @@ -844,11 +849,11 @@ retry: */ cbt->iface.recno = WT_RECNO_OOB; cbt->compare = 1; - WT_ERR(__cursor_col_search(session, cbt, NULL)); - WT_ERR(__cursor_col_modify(session, cbt, WT_UPDATE_STANDARD)); + WT_ERR(__cursor_col_search(cbt, NULL, NULL)); + WT_ERR(__cursor_col_modify(cbt, WT_UPDATE_STANDARD)); cursor->recno = cbt->recno; } else { - WT_ERR(__cursor_col_search(session, cbt, NULL)); + WT_ERR(__cursor_col_search(cbt, NULL, NULL)); /* * If not overwriting, fail if the key exists. Creating a record past the end of the tree in @@ -864,7 +869,7 @@ retry: WT_ERR(WT_DUPLICATE_KEY); } - WT_ERR(__cursor_col_modify(session, cbt, WT_UPDATE_STANDARD)); + WT_ERR(__cursor_col_modify(cbt, WT_UPDATE_STANDARD)); } err: @@ -944,7 +949,7 @@ __wt_btcur_insert_check(WT_CURSOR_BTREE *cbt) retry: WT_ERR(__cursor_func_init(cbt, true)); - WT_ERR(__cursor_row_search(session, cbt, NULL, true)); + WT_ERR(__cursor_row_search(cbt, true, NULL, NULL)); /* Just check for conflicts. */ ret = __curfile_update_check(cbt); @@ -1023,8 +1028,8 @@ __wt_btcur_remove(WT_CURSOR_BTREE *cbt, bool positioned) * Correct to an exact match so we can remove whatever we're pointing at. */ cbt->compare = 0; - ret = btree->type == BTREE_ROW ? __cursor_row_modify(session, cbt, WT_UPDATE_TOMBSTONE) : - __cursor_col_modify(session, cbt, WT_UPDATE_TOMBSTONE); + ret = btree->type == BTREE_ROW ? __cursor_row_modify(cbt, WT_UPDATE_TOMBSTONE) : + __cursor_col_modify(cbt, WT_UPDATE_TOMBSTONE); if (ret == 0) goto done; goto err; @@ -1046,7 +1051,7 @@ retry: WT_ERR(__cursor_func_init(cbt, true)); if (btree->type == BTREE_ROW) { - ret = __cursor_row_search(session, cbt, NULL, false); + ret = __cursor_row_search(cbt, false, NULL, NULL); if (ret == WT_NOTFOUND) goto search_notfound; WT_ERR(ret); @@ -1060,9 +1065,9 @@ retry: if (!valid) goto search_notfound; - ret = __cursor_row_modify(session, cbt, WT_UPDATE_TOMBSTONE); + ret = __cursor_row_modify(cbt, WT_UPDATE_TOMBSTONE); } else { - ret = __cursor_col_search(session, cbt, NULL); + ret = __cursor_col_search(cbt, NULL, NULL); if (ret == WT_NOTFOUND) goto search_notfound; WT_ERR(ret); @@ -1092,7 +1097,7 @@ retry: */ cbt->recno = cursor->recno; } else - ret = __cursor_col_modify(session, cbt, WT_UPDATE_TOMBSTONE); + ret = __cursor_col_modify(cbt, WT_UPDATE_TOMBSTONE); } err: @@ -1111,7 +1116,7 @@ err: */ if (positioned) { if (searched) - WT_TRET(__wt_key_return(session, cbt)); + WT_TRET(__wt_key_return(cbt)); } else { F_CLR(cursor, WT_CURSTD_KEY_SET); WT_TRET(__cursor_reset(cbt)); @@ -1134,7 +1139,7 @@ err: * subsequent iteration can succeed, we cannot return success.) */ if (0) { - search_notfound: +search_notfound: ret = WT_NOTFOUND; if (!iterating && !positioned && F_ISSET(cursor, WT_CURSTD_OVERWRITE)) ret = 0; @@ -1174,7 +1179,7 @@ __btcur_update(WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) WT_DECL_RET; WT_SESSION_IMPL *session; uint64_t yield_count, sleep_usecs; - bool valid; + bool leaf_found, valid; btree = cbt->btree; cursor = &cbt->iface; @@ -1205,8 +1210,8 @@ __btcur_update(WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) * Correct to an exact match so we can update whatever we're pointing at. */ cbt->compare = 0; - ret = btree->type == BTREE_ROW ? __cursor_row_modify_v(session, cbt, value, modify_type) : - __cursor_col_modify_v(session, cbt, value, modify_type); + ret = btree->type == BTREE_ROW ? __cursor_row_modify_v(cbt, value, modify_type) : + __cursor_col_modify_v(cbt, value, modify_type); if (ret == 0) goto done; @@ -1229,12 +1234,31 @@ __btcur_update(WT_CURSOR_BTREE *cbt, WT_ITEM *value, u_int modify_type) WT_ERR(__cursor_localvalue(cursor)); __cursor_state_save(cursor, &state); + /* If our caller configures for a local search and we have a page pinned, do that search. */ + if (F_ISSET(cursor, WT_CURSTD_UPDATE_LOCAL) && __cursor_page_pinned(cbt)) { + __wt_txn_cursor_op(session); + WT_ERR(__wt_txn_autocommit_check(session)); + + WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(cbt, true, cbt->ref, &leaf_found) : + __cursor_col_search(cbt, cbt->ref, &leaf_found)); + /* + * Only use the pinned page search results if search returns an exact match or a slot other + * than the page's boundary slots, if that's not the case, the record might belong on an + * entirely different page. This test is simplistic as we're ignoring append lists (there + * may be no page slots or we might be legitimately positioned after the last page slot). + * Ignore those cases, it makes things too complicated. + */ + if (leaf_found && + (cbt->compare == 0 || (cbt->slot != 0 && cbt->slot != cbt->ref->page->entries - 1))) + goto update_local; + } + retry: WT_ERR(__cursor_func_init(cbt, true)); - + WT_ERR(btree->type == BTREE_ROW ? __cursor_row_search(cbt, true, NULL, NULL) : + __cursor_col_search(cbt, NULL, NULL)); +update_local: if (btree->type == BTREE_ROW) { - WT_ERR(__cursor_row_search(session, cbt, NULL, true)); - /* * If not overwriting, check for conflicts and fail if the key does not exist. */ @@ -1246,10 +1270,8 @@ retry: if (!valid) WT_ERR(WT_NOTFOUND); } - ret = __cursor_row_modify_v(session, cbt, value, modify_type); + ret = __cursor_row_modify_v(cbt, value, modify_type); } else { - WT_ERR(__cursor_col_search(session, cbt, NULL)); - /* * If not overwriting, fail if the key doesn't exist. If we find an update for the key, * check for conflicts. Update the record if it exists. Creating a record past the end of @@ -1264,7 +1286,7 @@ retry: if ((cbt->compare != 0 || !valid) && !__cursor_fix_implicit(btree, cbt)) WT_ERR(WT_NOTFOUND); } - ret = __cursor_col_modify_v(session, cbt, value, modify_type); + ret = __cursor_col_modify_v(cbt, value, modify_type); } err: @@ -1287,7 +1309,7 @@ done: /* * WT_CURSOR.update returns a key and a value. */ - ret = __cursor_kv_return(session, cbt, cbt->modify_update); + ret = __cursor_kv_return(cbt, cbt->modify_update); break; case WT_UPDATE_RESERVE: /* @@ -1300,7 +1322,7 @@ done: * WT_CURSOR.modify has already created the return value and our job is to leave it * untouched. */ - ret = __wt_key_return(session, cbt); + ret = __wt_key_return(cbt); break; case WT_UPDATE_BIRTHMARK: case WT_UPDATE_TOMBSTONE: @@ -1632,12 +1654,14 @@ __wt_btcur_equals(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *equalp) * Discard a cursor range from row-store or variable-width column-store tree. */ static int -__cursor_truncate(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop, - int (*rmfunc)(WT_SESSION_IMPL *, WT_CURSOR_BTREE *, u_int)) +__cursor_truncate( + WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop, int (*rmfunc)(WT_CURSOR_BTREE *, u_int)) { WT_DECL_RET; + WT_SESSION_IMPL *session; uint64_t yield_count, sleep_usecs; + session = (WT_SESSION_IMPL *)start->iface.session; yield_count = sleep_usecs = 0; /* @@ -1664,7 +1688,7 @@ retry: WT_ASSERT(session, F_MASK((WT_CURSOR *)start, WT_CURSTD_KEY_SET) == WT_CURSTD_KEY_INT); for (;;) { - WT_ERR(rmfunc(session, start, WT_UPDATE_TOMBSTONE)); + WT_ERR(rmfunc(start, WT_UPDATE_TOMBSTONE)); if (stop != NULL && __cursor_equals(start, stop)) return (0); @@ -1689,13 +1713,15 @@ err: * Discard a cursor range from fixed-width column-store tree. */ static int -__cursor_truncate_fix(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop, - int (*rmfunc)(WT_SESSION_IMPL *, WT_CURSOR_BTREE *, u_int)) +__cursor_truncate_fix( + WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop, int (*rmfunc)(WT_CURSOR_BTREE *, u_int)) { WT_DECL_RET; + WT_SESSION_IMPL *session; uint64_t yield_count, sleep_usecs; const uint8_t *value; + session = (WT_SESSION_IMPL *)start->iface.session; yield_count = sleep_usecs = 0; /* @@ -1724,7 +1750,7 @@ retry: for (;;) { value = (const uint8_t *)start->iface.value.data; if (*value != 0) - WT_ERR(rmfunc(session, start, WT_UPDATE_TOMBSTONE)); + WT_ERR(rmfunc(start, WT_UPDATE_TOMBSTONE)); if (stop != NULL && __cursor_equals(start, stop)) return (0); @@ -1759,6 +1785,8 @@ __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop) btree = start->btree; WT_STAT_DATA_INCR(session, cursor_truncate); + WT_RET(__wt_txn_autocommit_check(session)); + /* * For recovery, log the start and stop keys for a truncate operation, * not the individual records removed. On the other hand, for rollback @@ -1773,10 +1801,10 @@ __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop) switch (btree->type) { case BTREE_COL_FIX: - WT_ERR(__cursor_truncate_fix(session, start, stop, __cursor_col_modify)); + WT_ERR(__cursor_truncate_fix(start, stop, __cursor_col_modify)); break; case BTREE_COL_VAR: - WT_ERR(__cursor_truncate(session, start, stop, __cursor_col_modify)); + WT_ERR(__cursor_truncate(start, stop, __cursor_col_modify)); break; case BTREE_ROW: /* @@ -1788,7 +1816,7 @@ __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop) * setting up the truncate so we're good to go: if that ever changes, we'd need to do * something here to ensure a fully instantiated cursor. */ - WT_ERR(__cursor_truncate(session, start, stop, __cursor_row_modify)); + WT_ERR(__cursor_truncate(start, stop, __cursor_row_modify)); break; } diff --git a/src/third_party/wiredtiger/src/btree/bt_debug.c b/src/third_party/wiredtiger/src/btree/bt_debug.c index 3c9e4c260d0..e2d50a8745b 100644 --- a/src/third_party/wiredtiger/src/btree/bt_debug.c +++ b/src/third_party/wiredtiger/src/btree/bt_debug.c @@ -700,6 +700,28 @@ __wt_debug_cursor_page(void *cursor_arg, const char *ofile) } /* + * __wt_debug_cursor_las -- + * Dump the LAS tree given a user cursor. + */ +int +__wt_debug_cursor_las(void *cursor_arg, const char *ofile) + WT_GCC_FUNC_ATTRIBUTE((visibility("default"))) +{ + WT_CONNECTION_IMPL *conn; + WT_CURSOR *cursor; + WT_CURSOR_BTREE *cbt; + WT_SESSION_IMPL *las_session; + + cursor = cursor_arg; + conn = S2C((WT_SESSION_IMPL *)cursor->session); + las_session = conn->cache->las_session[0]; + if (las_session == NULL) + return (0); + cbt = (WT_CURSOR_BTREE *)las_session->las_cursor; + return (__wt_debug_tree_all(las_session, cbt->btree, NULL, ofile)); +} + +/* * __debug_tree -- * Dump the in-memory information for a tree. */ diff --git a/src/third_party/wiredtiger/src/btree/bt_random.c b/src/third_party/wiredtiger/src/btree/bt_random.c index 525728b73dc..c0d4f342bb1 100644 --- a/src/third_party/wiredtiger/src/btree/bt_random.c +++ b/src/third_party/wiredtiger/src/btree/bt_random.c @@ -402,7 +402,7 @@ random_page_entry: WT_ERR(__wt_row_random_leaf(session, cbt)); WT_ERR(__wt_cursor_valid(cbt, &upd, &valid)); if (valid) - WT_ERR(__cursor_kv_return(session, cbt, upd)); + WT_ERR(__cursor_kv_return(cbt, upd)); else { if ((ret = __wt_btcur_next(cbt, false)) == WT_NOTFOUND) ret = __wt_btcur_prev(cbt, false); diff --git a/src/third_party/wiredtiger/src/btree/bt_read.c b/src/third_party/wiredtiger/src/btree/bt_read.c index fc7a05f0083..cda1eee1eeb 100644 --- a/src/third_party/wiredtiger/src/btree/bt_read.c +++ b/src/third_party/wiredtiger/src/btree/bt_read.c @@ -31,8 +31,8 @@ __col_instantiate( __wt_free_update_list(session, upd); /* Search the page and add updates. */ - WT_RET(__wt_col_search(session, recno, ref, cbt, true)); - WT_RET(__wt_col_modify(session, cbt, recno, NULL, updlist, WT_UPDATE_INVALID, false)); + WT_RET(__wt_col_search(cbt, recno, ref, true, NULL)); + WT_RET(__wt_col_modify(cbt, recno, NULL, updlist, WT_UPDATE_INVALID, false)); return (0); } @@ -59,8 +59,8 @@ __row_instantiate( __wt_free_update_list(session, upd); /* Search the page and add updates. */ - WT_RET(__wt_row_search(session, key, ref, cbt, true, true)); - WT_RET(__wt_row_modify(session, cbt, key, NULL, updlist, WT_UPDATE_INVALID, false)); + WT_RET(__wt_row_search(cbt, key, true, ref, true, NULL)); + WT_RET(__wt_row_modify(cbt, key, NULL, updlist, WT_UPDATE_INVALID, false)); return (0); } @@ -752,7 +752,7 @@ read: continue; } - skip_evict: +skip_evict: /* * If we read the page and are configured to not trash * the cache, and no other thread has already used the diff --git a/src/third_party/wiredtiger/src/btree/bt_ret.c b/src/third_party/wiredtiger/src/btree/bt_ret.c index 9c9dbe5c30a..bec7a1f7e5e 100644 --- a/src/third_party/wiredtiger/src/btree/bt_ret.c +++ b/src/third_party/wiredtiger/src/btree/bt_ret.c @@ -13,15 +13,17 @@ * Change the cursor to reference an internal return key. */ static inline int -__key_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) +__key_return(WT_CURSOR_BTREE *cbt) { WT_CURSOR *cursor; WT_ITEM *tmp; WT_PAGE *page; WT_ROW *rip; + WT_SESSION_IMPL *session; page = cbt->ref->page; cursor = &cbt->iface; + session = (WT_SESSION_IMPL *)cbt->iface.session; if (page->type == WT_PAGE_ROW_LEAF) { rip = &page->pg_row[cbt->slot]; @@ -72,7 +74,7 @@ __key_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) * Change the cursor to reference an internal original-page return value. */ static inline int -__value_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) +__value_return(WT_CURSOR_BTREE *cbt) { WT_BTREE *btree; WT_CELL *cell; @@ -80,8 +82,10 @@ __value_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) WT_CURSOR *cursor; WT_PAGE *page; WT_ROW *rip; + WT_SESSION_IMPL *session; uint8_t v; + session = (WT_SESSION_IMPL *)cbt->iface.session; btree = S2BT(session); page = cbt->ref->page; @@ -123,17 +127,18 @@ __value_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) * Change the cursor to reference an internal update structure return value. */ int -__wt_value_return_upd( - WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibility) +__wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibility) { WT_CURSOR *cursor; WT_DECL_RET; + WT_SESSION_IMPL *session; WT_UPDATE **listp, *list[WT_MODIFY_ARRAY_SIZE]; size_t allocated_bytes; u_int i; bool skipped_birthmark; cursor = &cbt->iface; + session = (WT_SESSION_IMPL *)cbt->iface.session; allocated_bytes = 0; /* @@ -213,7 +218,7 @@ __wt_value_return_upd( */ WT_ASSERT(session, cbt->slot != UINT32_MAX); - WT_ERR(__value_return(session, cbt)); + WT_ERR(__value_return(cbt)); } } else if (upd->type == WT_UPDATE_TOMBSTONE) WT_ERR(__wt_buf_set(session, &cursor->value, "", 0)); @@ -237,7 +242,7 @@ err: * Change the cursor to reference an internal return key. */ int -__wt_key_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) +__wt_key_return(WT_CURSOR_BTREE *cbt) { WT_CURSOR *cursor; @@ -253,7 +258,7 @@ __wt_key_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) */ F_CLR(cursor, WT_CURSTD_KEY_EXT); if (!F_ISSET(cursor, WT_CURSTD_KEY_INT)) { - WT_RET(__key_return(session, cbt)); + WT_RET(__key_return(cbt)); F_SET(cursor, WT_CURSTD_KEY_INT); } return (0); @@ -264,7 +269,7 @@ __wt_key_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) * Change the cursor to reference an internal return value. */ int -__wt_value_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) +__wt_value_return(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) { WT_CURSOR *cursor; @@ -272,9 +277,9 @@ __wt_value_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd F_CLR(cursor, WT_CURSTD_VALUE_EXT); if (upd == NULL) - WT_RET(__value_return(session, cbt)); + WT_RET(__value_return(cbt)); else - WT_RET(__wt_value_return_upd(session, cbt, upd, false)); + WT_RET(__wt_value_return_upd(cbt, upd, false)); F_SET(cursor, WT_CURSTD_VALUE_INT); return (0); } diff --git a/src/third_party/wiredtiger/src/btree/bt_slvg.c b/src/third_party/wiredtiger/src/btree/bt_slvg.c index fea2da9ae03..04ec016a3be 100644 --- a/src/third_party/wiredtiger/src/btree/bt_slvg.c +++ b/src/third_party/wiredtiger/src/btree/bt_slvg.c @@ -869,7 +869,7 @@ __slvg_col_range_overlap(WT_SESSION_IMPL *session, uint32_t a_slot, uint32_t b_s * Case #5: a_trk is a superset of b_trk and a_trk is more desirable -- discard b_trk. */ if (a_trk->trk_gen > b_trk->trk_gen) { - delete_b: +delete_b: /* * After page and overflow reconciliation, one (and only one) * page can reference an overflow record. But, if we split a @@ -1460,7 +1460,7 @@ __slvg_row_range_overlap(WT_SESSION_IMPL *session, uint32_t a_slot, uint32_t b_s * Case #5: a_trk is a superset of b_trk and a_trk is more desirable -- discard b_trk. */ if (a_trk->trk_gen > b_trk->trk_gen) { - delete_b: +delete_b: /* * After page and overflow reconciliation, one (and only one) * page can reference an overflow record. But, if we split a diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c index 5a7f9279bd4..80d523ae5ee 100644 --- a/src/third_party/wiredtiger/src/btree/bt_split.c +++ b/src/third_party/wiredtiger/src/btree/bt_split.c @@ -1425,10 +1425,10 @@ __split_multi_inmem(WT_SESSION_IMPL *session, WT_PAGE *orig, WT_MULTI *multi, WT recno = WT_INSERT_RECNO(supd->ins); /* Search the page. */ - WT_ERR(__wt_col_search(session, recno, ref, &cbt, true)); + WT_ERR(__wt_col_search(&cbt, recno, ref, true, NULL)); /* Apply the modification. */ - WT_ERR(__wt_col_modify(session, &cbt, recno, NULL, upd, WT_UPDATE_INVALID, true)); + WT_ERR(__wt_col_modify(&cbt, recno, NULL, upd, WT_UPDATE_INVALID, true)); break; case WT_PAGE_ROW_LEAF: /* Build a key. */ @@ -1447,15 +1447,13 @@ __split_multi_inmem(WT_SESSION_IMPL *session, WT_PAGE *orig, WT_MULTI *multi, WT WT_ASSERT(session, __wt_count_birthmarks(upd) <= 1); /* Search the page. */ - WT_ERR(__wt_row_search(session, key, ref, &cbt, true, true)); + WT_ERR(__wt_row_search(&cbt, key, true, ref, true, NULL)); - /* - * Birthmarks should only be applied to on-page values. - */ + /* Birthmarks should only be applied to on-page values. */ WT_ASSERT(session, cbt.compare == 0 || upd->type != WT_UPDATE_BIRTHMARK); /* Apply the modification. */ - WT_ERR(__wt_row_modify(session, &cbt, key, NULL, upd, WT_UPDATE_INVALID, true)); + WT_ERR(__wt_row_modify(&cbt, key, NULL, upd, WT_UPDATE_INVALID, true)); break; default: WT_ERR(__wt_illegal_value(session, orig->type)); diff --git a/src/third_party/wiredtiger/src/btree/bt_vrfy.c b/src/third_party/wiredtiger/src/btree/bt_vrfy.c index d796436752d..6fa2dbda197 100644 --- a/src/third_party/wiredtiger/src/btree/bt_vrfy.c +++ b/src/third_party/wiredtiger/src/btree/bt_vrfy.c @@ -366,7 +366,7 @@ __verify_tree(WT_SESSION_IMPL *session, WT_REF *ref, WT_VSTUFF *vs) goto recno_chk; case WT_PAGE_COL_VAR: recno = ref->ref_recno; - recno_chk: +recno_chk: if (recno != vs->record_total + 1) WT_RET_MSG(session, WT_ERROR, "page at %s has a starting record of %" PRIu64 " when the expected starting record is %" PRIu64, @@ -422,7 +422,7 @@ __verify_tree(WT_SESSION_IMPL *session, WT_REF *ref, WT_VSTUFF *vs) case WT_PAGE_COL_INT: case WT_PAGE_ROW_INT: if (unpack->raw != WT_CELL_ADDR_INT) - celltype_err: +celltype_err: WT_RET_MSG(session, WT_ERROR, "page at %s, of type %s, is referenced in " "its parent by a cell of type %s", diff --git a/src/third_party/wiredtiger/src/btree/bt_vrfy_dsk.c b/src/third_party/wiredtiger/src/btree/bt_vrfy_dsk.c index 603b379f928..831627d53e4 100644 --- a/src/third_party/wiredtiger/src/btree/bt_vrfy_dsk.c +++ b/src/third_party/wiredtiger/src/btree/bt_vrfy_dsk.c @@ -357,7 +357,7 @@ __verify_dsk_row(WT_SESSION_IMPL *session, const char *tag, const WT_PAGE_HEADER current->size = prefix + unpack->size; } - key_compare: +key_compare: /* * Compare the current key against the last key. * @@ -550,7 +550,7 @@ __verify_dsk_col_var(WT_SESSION_IMPL *session, const char *tag, const WT_PAGE_HE goto match_err; } else if (cell_type == WT_CELL_VALUE && last_data != NULL && last_size == unpack->size && memcmp(last_data, unpack->data, last_size) == 0) - match_err: +match_err: WT_RET_VRFY(session, "data entries %" PRIu32 " and %" PRIu32 " on page at %s are identical and should " "have been run-length encoded", diff --git a/src/third_party/wiredtiger/src/btree/col_modify.c b/src/third_party/wiredtiger/src/btree/col_modify.c index 273797b19fc..3610ca6bbdc 100644 --- a/src/third_party/wiredtiger/src/btree/col_modify.c +++ b/src/third_party/wiredtiger/src/btree/col_modify.c @@ -15,8 +15,8 @@ static int __col_insert_alloc(WT_SESSION_IMPL *, uint64_t, u_int, WT_INSERT **, * Column-store delete, insert, and update. */ int -__wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, - const WT_ITEM *value, WT_UPDATE *upd_arg, u_int modify_type, bool exclusive) +__wt_col_modify(WT_CURSOR_BTREE *cbt, uint64_t recno, const WT_ITEM *value, WT_UPDATE *upd_arg, + u_int modify_type, bool exclusive) { static const WT_ITEM col_fix_remove = {"", 1, NULL, 0, 0}; WT_BTREE *btree; @@ -25,6 +25,7 @@ __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, WT_INSERT_HEAD *ins_head, **ins_headp; WT_PAGE *page; WT_PAGE_MODIFY *mod; + WT_SESSION_IMPL *session; WT_UPDATE *old_upd, *upd; size_t ins_size, upd_size; u_int i, skipdepth; @@ -33,6 +34,7 @@ __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, btree = cbt->btree; ins = NULL; page = cbt->ref->page; + session = (WT_SESSION_IMPL *)cbt->iface.session; upd = upd_arg; append = logged = false; diff --git a/src/third_party/wiredtiger/src/btree/col_srch.c b/src/third_party/wiredtiger/src/btree/col_srch.c index f202dbd7f7b..2a74d37cb39 100644 --- a/src/third_party/wiredtiger/src/btree/col_srch.c +++ b/src/third_party/wiredtiger/src/btree/col_srch.c @@ -59,7 +59,7 @@ __check_leaf_key_range(WT_SESSION_IMPL *session, uint64_t recno, WT_REF *leaf, W */ int __wt_col_search( - WT_SESSION_IMPL *session, uint64_t search_recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt, bool restore) + WT_CURSOR_BTREE *cbt, uint64_t search_recno, WT_REF *leaf, bool leaf_safe, bool *leaf_foundp) { WT_BTREE *btree; WT_COL *cip; @@ -69,10 +69,12 @@ __wt_col_search( WT_PAGE *page; WT_PAGE_INDEX *pindex, *parent_pindex; WT_REF *current, *descent; + WT_SESSION_IMPL *session; uint64_t recno; uint32_t base, indx, limit, read_flags; int depth; + session = (WT_SESSION_IMPL *)cbt->iface.session; btree = S2BT(session); current = NULL; @@ -88,23 +90,18 @@ __wt_col_search( /* * We may be searching only a single leaf page, not the full tree. In the normal case where we * are searching a tree, check the page's parent keys before doing the full search, it's faster - * when the cursor is being re-positioned. Skip this if the page is being re-instantiated in - * memory. + * when the cursor is being re-positioned. Skip that check if we know the page is the right one + * (for example, when re-instantiating a page in memory, in that case we know the target must be + * on the current page). */ if (leaf != NULL) { WT_ASSERT(session, search_recno != WT_RECNO_OOB); - if (!restore) { + if (!leaf_safe) { WT_RET(__check_leaf_key_range(session, recno, leaf, cbt)); - if (cbt->compare != 0) { - /* - * !!! - * WT_CURSOR.search_near uses the slot value to - * decide if there was an on-page match. - */ - cbt->slot = 0; + *leaf_foundp = cbt->compare == 0; + if (!*leaf_foundp) return (0); - } } current = leaf; diff --git a/src/third_party/wiredtiger/src/btree/row_key.c b/src/third_party/wiredtiger/src/btree/row_key.c index 35e8373ef6f..3c609e9344f 100644 --- a/src/third_party/wiredtiger/src/btree/row_key.c +++ b/src/third_party/wiredtiger/src/btree/row_key.c @@ -162,7 +162,7 @@ __wt_row_leaf_key_work( direction = BACKWARD; for (slot_offset = 0;;) { if (0) { - switch_and_jump: +switch_and_jump: /* Switching to a forward roll. */ WT_ASSERT(session, direction == BACKWARD); direction = FORWARD; diff --git a/src/third_party/wiredtiger/src/btree/row_modify.c b/src/third_party/wiredtiger/src/btree/row_modify.c index c6c35de6e6f..7d9425b4ac0 100644 --- a/src/third_party/wiredtiger/src/btree/row_modify.c +++ b/src/third_party/wiredtiger/src/btree/row_modify.c @@ -41,14 +41,15 @@ err: * Row-store insert, update and delete. */ int -__wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, const WT_ITEM *key, - const WT_ITEM *value, WT_UPDATE *upd_arg, u_int modify_type, bool exclusive) +__wt_row_modify(WT_CURSOR_BTREE *cbt, const WT_ITEM *key, const WT_ITEM *value, WT_UPDATE *upd_arg, + u_int modify_type, bool exclusive) { WT_DECL_RET; WT_INSERT *ins; WT_INSERT_HEAD *ins_head, **ins_headp; WT_PAGE *page; WT_PAGE_MODIFY *mod; + WT_SESSION_IMPL *session; WT_UPDATE *old_upd, *upd, **upd_entry; size_t ins_size, upd_size; uint32_t ins_slot; @@ -57,6 +58,7 @@ __wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, const WT_ITEM *k ins = NULL; page = cbt->ref->page; + session = (WT_SESSION_IMPL *)cbt->iface.session; upd = upd_arg; logged = false; @@ -295,6 +297,7 @@ __wt_update_obsolete_check( WT_UPDATE *first, *next, *prev; size_t size; u_int count; + bool upd_visible_all_seen; txn_global = &S2C(session)->txn_global; @@ -309,21 +312,38 @@ __wt_update_obsolete_check( * Only updates with globally visible, self-contained data can terminate * update chains. * - * Birthmarks are a special case: once a birthmark becomes obsolete, it - * can be discarded and subsequent reads will see the on-page value (as - * expected). Inserting updates into the lookaside table relies on - * this behavior to avoid creating update chains with multiple - * birthmarks. + * Birthmarks are a special case: once a birthmark becomes obsolete, it can be discarded if + * there is a globally visible update before it and subsequent reads will see the on-page value + * (as expected). Inserting updates into the lookaside table relies on this behavior to avoid + * creating update chains with multiple birthmarks. We cannot discard the birthmark if it's the + * first globally visible update as the previous updates can be aborted and be freed causing the + * entire update chain being removed. */ - for (first = prev = NULL, count = 0; upd != NULL; prev = upd, upd = upd->next, count++) { + for (first = prev = NULL, upd_visible_all_seen = false, count = 0; upd != NULL; + prev = upd, upd = upd->next, count++) { if (upd->txnid == WT_TXN_ABORTED) continue; + if (!__wt_txn_upd_visible_all(session, upd)) first = NULL; - else if (first == NULL && upd->type == WT_UPDATE_BIRTHMARK) - first = prev; - else if (first == NULL && WT_UPDATE_DATA_VALUE(upd)) - first = upd; + else { + if (first == NULL) { + /* + * If we have seen a globally visible update before the birthmark, the birthmark can + * be discarded. + */ + if (upd_visible_all_seen && upd->type == WT_UPDATE_BIRTHMARK) + first = prev; + /* + * We cannot discard the birthmark if it is the first globally visible update as the + * previous updates can be aborted resulting the entire update chain being removed. + */ + else if (upd->type == WT_UPDATE_BIRTHMARK || WT_UPDATE_DATA_VALUE(upd)) + first = upd; + } + + upd_visible_all_seen = true; + } } /* diff --git a/src/third_party/wiredtiger/src/btree/row_srch.c b/src/third_party/wiredtiger/src/btree/row_srch.c index a7a9c282564..87d11f84b83 100644 --- a/src/third_party/wiredtiger/src/btree/row_srch.c +++ b/src/third_party/wiredtiger/src/btree/row_srch.c @@ -199,8 +199,8 @@ __check_leaf_key_range( * Search a row-store tree for a specific key. */ int -__wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CURSOR_BTREE *cbt, - bool insert, bool restore) +__wt_row_search(WT_CURSOR_BTREE *cbt, WT_ITEM *srch_key, bool insert, WT_REF *leaf, bool leaf_safe, + bool *leaf_foundp) { WT_BTREE *btree; WT_COLLATOR *collator; @@ -211,11 +211,13 @@ __wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CU WT_PAGE_INDEX *pindex, *parent_pindex; WT_REF *current, *descent; WT_ROW *rip; + WT_SESSION_IMPL *session; size_t match, skiphigh, skiplow; uint32_t base, indx, limit, read_flags; int cmp, depth; bool append_check, descend_right, done; + session = (WT_SESSION_IMPL *)cbt->iface.session; btree = S2BT(session); collator = btree->collator; item = cbt->tmp; @@ -245,21 +247,16 @@ __wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CU /* * We may be searching only a single leaf page, not the full tree. In the normal case where we * are searching a tree, check the page's parent keys before doing the full search, it's faster - * when the cursor is being re-positioned. Skip this if the page is being re-instantiated in - * memory. + * when the cursor is being re-positioned. Skip that check if we know the page is the right one + * (for example, when re-instantiating a page in memory, in that case we know the target must be + * on the current page). */ if (leaf != NULL) { - if (!restore) { + if (!leaf_safe) { WT_RET(__check_leaf_key_range(session, srch_key, leaf, cbt)); - if (cbt->compare != 0) { - /* - * !!! - * WT_CURSOR.search_near uses the slot value to - * decide if there was an on-page match. - */ - cbt->slot = 0; + *leaf_foundp = cbt->compare == 0; + if (!*leaf_foundp) return (0); - } } current = leaf; @@ -540,7 +537,7 @@ leaf_only: * read-mostly workload. Check that case and get out fast. */ if (0) { - leaf_match: +leaf_match: cbt->compare = 0; cbt->slot = WT_ROW_SLOT(page, rip); return (0); diff --git a/src/third_party/wiredtiger/src/cache/cache_las.c b/src/third_party/wiredtiger/src/cache/cache_las.c index 511af9c869c..fbd62e16a6f 100644 --- a/src/third_party/wiredtiger/src/cache/cache_las.c +++ b/src/third_party/wiredtiger/src/cache/cache_las.c @@ -653,6 +653,9 @@ __wt_las_insert_block( WT_ERR(__wt_txn_begin(session, NULL)); local_txn = true; + /* Inserts should be on the same page absent a split, search any pinned leaf page. */ + F_SET(cursor, WT_CURSTD_UPDATE_LOCAL); + /* Enter each update in the boundary's list into the lookaside store. */ for (las_counter = 0, i = 0, list = multi->supd; i < multi->supd_entries; ++i, ++list) { /* Lookaside table key component: source key. */ @@ -752,8 +755,8 @@ __wt_las_insert_block( cursor, upd->txnid, upd->timestamp, upd->prepare_state, upd->type, &las_value); /* - * Using update looks a little strange because the keys are guaranteed to not exist, but - * since we're appending, we want the cursor to stay positioned in between inserts. + * Using update instead of insert so the page stays pinned and can be searched before + * the tree. */ WT_ERR(cursor->update(cursor)); ++insert_cnt; @@ -778,6 +781,7 @@ err: ret = __wt_txn_commit(session, NULL); else WT_TRET(__wt_txn_rollback(session, NULL)); + F_CLR(cursor, WT_CURSTD_UPDATE_LOCAL); /* Adjust the entry count. */ if (ret == 0) { @@ -1030,7 +1034,6 @@ __wt_las_sweep(WT_SESSION_IMPL *session) WT_DECL_RET; WT_ITEM las_key, las_value; WT_ITEM *sweep_key; - WT_TXN_ISOLATION saved_isolation; wt_timestamp_t las_timestamp; uint64_t cnt, remove_cnt, las_pageid, saved_pageid, visit_cnt; uint64_t las_counter, las_txnid; @@ -1061,7 +1064,6 @@ __wt_las_sweep(WT_SESSION_IMPL *session) */ __wt_las_cursor(session, &cursor, &session_flags); WT_ASSERT(session, cursor->session == &session->iface); - __las_set_isolation(session, &saved_isolation); WT_ERR(__wt_txn_begin(session, NULL)); local_txn = true; @@ -1232,7 +1234,6 @@ err: (void)__wt_atomic_add64(&cache->las_remove_count, remove_cnt); } - __las_restore_isolation(session, saved_isolation); WT_TRET(__wt_las_cursor_close(session, &cursor, session_flags)); if (locked) diff --git a/src/third_party/wiredtiger/src/config/config_collapse.c b/src/third_party/wiredtiger/src/config/config_collapse.c index a53f2c7a974..aeda22d803e 100644 --- a/src/third_party/wiredtiger/src/config/config_collapse.c +++ b/src/third_party/wiredtiger/src/config/config_collapse.c @@ -56,9 +56,8 @@ __wt_config_collapse(WT_SESSION_IMPL *session, const char **cfg, char **config_r goto err; /* - * If the caller passes us no valid configuration strings, we get here - * with no bytes to copy -- that's OK, the underlying string copy can - * handle empty strings. + * If the caller passes us no valid configuration strings, we get here with no bytes to copy -- + * that's OK, the underlying string copy can handle empty strings. * * Strip any trailing comma. */ diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c index 028b32de539..500a44cec63 100644 --- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c +++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c @@ -25,6 +25,7 @@ __conn_dhandle_config_clear(WT_SESSION_IMPL *session) for (a = dhandle->cfg; *a != NULL; ++a) __wt_free(session, *a); __wt_free(session, dhandle->cfg); + __wt_free(session, dhandle->meta_base); } /* @@ -36,9 +37,12 @@ __conn_dhandle_config_set(WT_SESSION_IMPL *session) { WT_DATA_HANDLE *dhandle; WT_DECL_RET; - char *metaconf; + char *metaconf, *tmp; + const char *base, *cfg[3]; dhandle = session->dhandle; + base = NULL; + tmp = NULL; /* * Read the object's entry from the metadata file, we're done if we don't find one. @@ -66,17 +70,45 @@ __conn_dhandle_config_set(WT_SESSION_IMPL *session) WT_ERR(__wt_calloc_def(session, 3, &dhandle->cfg)); switch (dhandle->type) { case WT_DHANDLE_TYPE_BTREE: + /* + * We are stripping out the checkpoint and checkpoint_lsn information from the config + * string. We save the rest of the metadata string, that is essentially static and + * unchanging and then concatenate the new checkpoint and LSN information on each + * checkpoint. The reason is performance and avoiding a lot of calls to the config parsing + * functions during a checkpoint for information that changes in a very well known way. + */ + cfg[0] = metaconf; + cfg[1] = "checkpoint=()"; + cfg[2] = NULL; WT_ERR(__wt_strdup(session, WT_CONFIG_BASE(session, file_meta), &dhandle->cfg[0])); + WT_ASSERT(session, dhandle->meta_base == NULL); + /* + * First collapse and overwrite any checkpoint information because we do not know the name + * or how many checkpoints may be in this metadata. So first we have to set the string to + * the empty checkpoint string and call collapse to overwrite anything existing. + */ + WT_ERR(__wt_config_collapse(session, cfg, &tmp)); + /* + * Now strip out the checkpoint and checkpoint LSN items from the configuration string and + * that is now our base metadata string. + */ + cfg[0] = tmp; + cfg[1] = NULL; + WT_ERR(__wt_config_merge(session, cfg, "checkpoint=,checkpoint_lsn=", &base)); + __wt_free(session, tmp); break; case WT_DHANDLE_TYPE_TABLE: WT_ERR(__wt_strdup(session, WT_CONFIG_BASE(session, table_meta), &dhandle->cfg[0])); break; } dhandle->cfg[1] = metaconf; + dhandle->meta_base = base; return (0); err: + __wt_free(session, base); __wt_free(session, metaconf); + __wt_free(session, tmp); return (ret); } diff --git a/src/third_party/wiredtiger/src/cursor/cur_stat.c b/src/third_party/wiredtiger/src/cursor/cur_stat.c index 7cc4e4f2312..24babfac916 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_stat.c +++ b/src/third_party/wiredtiger/src/cursor/cur_stat.c @@ -715,7 +715,7 @@ __wt_curstat_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *other, c WT_ERR(__wt_cursor_init(cursor, uri, NULL, cfg, cursorp)); if (0) { - config_err: +config_err: WT_ERR_MSG(session, EINVAL, "cursor's statistics configuration doesn't match the " "database statistics configuration"); diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c index e378e336665..13f6b8db11c 100644 --- a/src/third_party/wiredtiger/src/evict/evict_lru.c +++ b/src/third_party/wiredtiger/src/evict/evict_lru.c @@ -1605,7 +1605,8 @@ __evict_walk_tree(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue, u_int max_ent WT_EVICT_ENTRY *end, *evict, *start; WT_PAGE *last_parent, *page; WT_REF *ref; - uint64_t min_pages, pages_seen, pages_queued, refs_walked; + uint64_t internal_pages_already_queued, internal_pages_queued, internal_pages_seen; + uint64_t min_pages, pages_already_queued, pages_seen, pages_queued, refs_walked; uint32_t read_flags, remaining_slots, target_pages, walk_flags; int restarts; bool give_up, modified, urgent_queued; @@ -1666,8 +1667,13 @@ __evict_walk_tree(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue, u_int max_ent * only looking for dirty pages, search the tree for longer. */ min_pages = 10 * (uint64_t)target_pages; - if (F_ISSET(cache, WT_CACHE_EVICT_DIRTY) && !F_ISSET(cache, WT_CACHE_EVICT_CLEAN)) + if (!F_ISSET(cache, WT_CACHE_EVICT_DIRTY) && F_ISSET(cache, WT_CACHE_EVICT_CLEAN)) + WT_STAT_CONN_INCR(session, cache_eviction_target_strategy_clean); + else if (F_ISSET(cache, WT_CACHE_EVICT_DIRTY) && !F_ISSET(cache, WT_CACHE_EVICT_CLEAN)) { min_pages *= 10; + WT_STAT_CONN_INCR(session, cache_eviction_target_strategy_dirty); + } else + WT_STAT_CONN_INCR(session, cache_eviction_target_strategy_both_clean_and_dirty); if (btree->evict_ref == NULL) { WT_STAT_CONN_INCR(session, cache_eviction_walk_from_root); @@ -1723,7 +1729,8 @@ __evict_walk_tree(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue, u_int max_ent * Once we hit the page limit, do one more step through the walk in * case we are appending and only the last page in the file is live. */ - for (evict = start, pages_queued = pages_seen = refs_walked = 0; + internal_pages_already_queued = internal_pages_queued = internal_pages_seen = 0; + for (evict = start, pages_already_queued = pages_queued = pages_seen = refs_walked = 0; evict < end && (ret == 0 || ret == WT_NOTFOUND); last_parent = ref == NULL ? NULL : ref->home, ret = __wt_tree_walk_count(session, &ref, &refs_walked, walk_flags)) { @@ -1791,11 +1798,19 @@ __evict_walk_tree(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue, u_int max_ent modified = __wt_page_is_modified(page); page->evict_pass_gen = cache->evict_pass_gen; + /* count internal pages seen. */ + if (WT_PAGE_IS_INTERNAL(page)) + internal_pages_seen++; + /* * Use the EVICT_LRU flag to avoid putting pages onto the list multiple times. */ - if (F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU)) + if (F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU)) { + pages_already_queued++; + if (WT_PAGE_IS_INTERNAL(page)) + internal_pages_already_queued++; continue; + } /* Don't queue dirty pages in trees during checkpoints. */ if (modified && WT_BTREE_SYNCING(btree)) @@ -1896,6 +1911,10 @@ fast: ++pages_queued; ++btree->evict_walk_progress; + /* count internal pages queued. */ + if (WT_PAGE_IS_INTERNAL(page)) + internal_pages_queued++; + __wt_verbose(session, WT_VERB_EVICTSERVER, "select: %p, size %" WT_SIZET_FMT, (void *)page, page->memory_footprint); } @@ -1950,6 +1969,11 @@ fast: WT_STAT_CONN_INCRV(session, cache_eviction_walk, refs_walked); WT_STAT_CONN_INCRV(session, cache_eviction_pages_seen, pages_seen); WT_STAT_DATA_INCRV(session, cache_eviction_pages_seen, pages_seen); + WT_STAT_CONN_INCRV(session, cache_eviction_pages_already_queued, pages_already_queued); + WT_STAT_CONN_INCRV(session, cache_eviction_internal_pages_seen, internal_pages_seen); + WT_STAT_CONN_INCRV( + session, cache_eviction_internal_pages_already_queued, internal_pages_already_queued); + WT_STAT_CONN_INCRV(session, cache_eviction_internal_pages_queued, internal_pages_queued); WT_STAT_CONN_INCRV(session, cache_eviction_walk_passes, 1); WT_STAT_DATA_INCRV(session, cache_eviction_walk_passes, 1); diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c index 785c6219c6b..fe56aa65ccf 100644 --- a/src/third_party/wiredtiger/src/evict/evict_page.c +++ b/src/third_party/wiredtiger/src/evict/evict_page.c @@ -555,6 +555,8 @@ __evict_review(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t evict_flags, bool */ if (WT_PAGE_IS_INTERNAL(page)) { WT_WITH_PAGE_INDEX(session, ret = __evict_child_check(session, ref)); + if (ret != 0) + WT_STAT_CONN_INCR(session, cache_eviction_fail_active_children_on_an_internal_page); WT_RET(ret); } @@ -692,6 +694,9 @@ __evict_review(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t evict_flags, bool ret = __wt_reconcile(session, ref, NULL, flags, NULL); } + if (ret != 0) + WT_STAT_CONN_INCR(session, cache_eviction_fail_in_reconciliation); + WT_RET(ret); /* diff --git a/src/third_party/wiredtiger/src/include/btree.i b/src/third_party/wiredtiger/src/include/btree.i index c78f893017c..89915c05f42 100644 --- a/src/third_party/wiredtiger/src/include/btree.i +++ b/src/third_party/wiredtiger/src/include/btree.i @@ -491,6 +491,12 @@ __wt_page_only_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) if (page->modify->page_state < WT_PAGE_DIRTY && __wt_atomic_add32(&page->modify->page_state, 1) == WT_PAGE_DIRTY_FIRST) { __wt_cache_dirty_incr(session, page); + /* + * In the event we dirty a page which is flagged for eviction soon, we update its read + * generation to avoid evicting a dirty page prematurely. + */ + if (page->read_gen == WT_READGEN_WONT_NEED) + __wt_cache_read_gen_new(session, page); /* * We won the race to dirty the page, but another thread could @@ -1348,8 +1354,10 @@ __wt_page_can_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool *inmem_splitp) * overflow item, because the split into the parent frees the backing blocks for any * no-longer-used overflow keys, which will corrupt the checkpoint's block management. */ - if (!__wt_btree_can_evict_dirty(session) && F_ISSET_ATOMIC(ref->home, WT_PAGE_OVERFLOW_KEYS)) + if (!__wt_btree_can_evict_dirty(session) && F_ISSET_ATOMIC(ref->home, WT_PAGE_OVERFLOW_KEYS)) { + WT_STAT_CONN_INCR(session, cache_eviction_fail_parent_has_overflow_items); return (false); + } /* * Check for in-memory splits before other eviction tests. If the page should split in-memory, @@ -1393,8 +1401,10 @@ __wt_page_can_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool *inmem_splitp) /* * If the page is clean but has modifications that appear too new to evict, skip it. */ - if (!modified && !__wt_txn_visible_all(session, mod->rec_max_txn, mod->rec_max_timestamp)) + if (!modified && !__wt_txn_visible_all(session, mod->rec_max_txn, mod->rec_max_timestamp)) { + WT_STAT_CONN_INCR(session, cache_eviction_fail_with_newer_modifications_on_a_clean_page); return (false); + } return (true); } diff --git a/src/third_party/wiredtiger/src/include/cursor.i b/src/third_party/wiredtiger/src/include/cursor.i index 78dca24c974..34e4321f2b8 100644 --- a/src/third_party/wiredtiger/src/include/cursor.i +++ b/src/third_party/wiredtiger/src/include/cursor.i @@ -303,10 +303,10 @@ __wt_cursor_dhandle_decr_use(WT_SESSION_IMPL *session) * Return a page referenced key/value pair to the application. */ static inline int -__cursor_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) +__cursor_kv_return(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) { - WT_RET(__wt_key_return(session, cbt)); - WT_RET(__wt_value_return(session, cbt, upd)); + WT_RET(__wt_key_return(cbt)); + WT_RET(__wt_value_return(cbt, upd)); return (0); } @@ -445,7 +445,7 @@ value: * (if any) is visible. */ if (upd != NULL) - return (__wt_value_return(session, cbt, upd)); + return (__wt_value_return(cbt, upd)); /* Else, simple values have their location encoded in the WT_ROW. */ if (__wt_row_leaf_value(page, rip, vb)) diff --git a/src/third_party/wiredtiger/src/include/dhandle.h b/src/third_party/wiredtiger/src/include/dhandle.h index 1ba38a9e140..feee7fa3f31 100644 --- a/src/third_party/wiredtiger/src/include/dhandle.h +++ b/src/third_party/wiredtiger/src/include/dhandle.h @@ -69,6 +69,7 @@ struct __wt_data_handle { uint64_t name_hash; /* Hash of name */ const char *checkpoint; /* Checkpoint name (or NULL) */ const char **cfg; /* Configuration information */ + const char *meta_base; /* Base metadata configuration */ /* * Sessions holding a connection's data handle will have a non-zero reference count; sessions diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index a0a3b6c10ce..6c0e23aa823 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -193,7 +193,7 @@ extern int __wt_compact_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, void *c WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_cursor_key_order_check(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_cursor_key_order_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) +extern int __wt_cursor_key_order_init(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern void __wt_cursor_key_order_reset(WT_CURSOR_BTREE *cbt); extern void __wt_btcur_iterate_setup(WT_CURSOR_BTREE *cbt); @@ -251,6 +251,8 @@ extern int __wt_debug_page(void *session_arg, WT_BTREE *btree, WT_REF *ref, cons WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_debug_cursor_page(void *cursor_arg, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_debug_cursor_las(void *cursor_arg, const char *ofile) WT_GCC_FUNC_DECL_ATTRIBUTE( + (visibility("default"))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_delete_page_rollback(WT_SESSION_IMPL *session, WT_REF *ref) @@ -318,11 +320,10 @@ extern int __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t fla ); extern int __wt_bt_rebalance(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_value_return_upd(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, - bool ignore_visibility) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_key_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) +extern int __wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibility) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_value_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) +extern int __wt_key_return(WT_CURSOR_BTREE *cbt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_value_return(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_bt_salvage(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); @@ -359,11 +360,11 @@ extern int __wt_tree_walk_custom_skip(WT_SESSION_IMPL *session, WT_REF **refp, WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_tree_walk_skip(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *skipleafcntp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, - const WT_ITEM *value, WT_UPDATE *upd_arg, u_int modify_type, bool exclusive) +extern int __wt_col_modify(WT_CURSOR_BTREE *cbt, uint64_t recno, const WT_ITEM *value, + WT_UPDATE *upd_arg, u_int modify_type, bool exclusive) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_col_search(WT_SESSION_IMPL *session, uint64_t search_recno, WT_REF *leaf, - WT_CURSOR_BTREE *cbt, bool restore) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_col_search(WT_CURSOR_BTREE *cbt, uint64_t search_recno, WT_REF *leaf, + bool leaf_safe, bool *leaf_foundp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_row_leaf_keys(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_row_leaf_key_copy(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip, @@ -378,8 +379,8 @@ extern int __wt_row_ikey(WT_SESSION_IMPL *session, uint32_t cell_offset, const v size_t size, WT_REF *ref) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_page_modify_alloc(WT_SESSION_IMPL *session, WT_PAGE *page) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, const WT_ITEM *key, - const WT_ITEM *value, WT_UPDATE *upd_arg, u_int modify_type, bool exclusive) +extern int __wt_row_modify(WT_CURSOR_BTREE *cbt, const WT_ITEM *key, const WT_ITEM *value, + WT_UPDATE *upd_arg, u_int modify_type, bool exclusive) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_row_insert_alloc(WT_SESSION_IMPL *session, const WT_ITEM *key, u_int skipdepth, WT_INSERT **insp, size_t *ins_sizep) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); @@ -389,8 +390,8 @@ extern WT_UPDATE *__wt_update_obsolete_check( WT_SESSION_IMPL *session, WT_PAGE *page, WT_UPDATE *upd, bool update_accounting); extern int __wt_search_insert(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_INSERT_HEAD *ins_head, WT_ITEM *srch_key) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, - WT_CURSOR_BTREE *cbt, bool insert, bool restore) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_row_search(WT_CURSOR_BTREE *cbt, WT_ITEM *srch_key, bool insert, WT_REF *leaf, + bool leaf_safe, bool *leaf_foundp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_las_config(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_las_empty(WT_SESSION_IMPL *session) @@ -1474,6 +1475,8 @@ extern int __wt_huffman_encode(WT_SESSION_IMPL *session, void *huffman_arg, cons size_t from_len, WT_ITEM *to_buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_huffman_decode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern bool __wt_modify_idempotent(const void *modify) + WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_modify_pack(WT_SESSION_IMPL *session, WT_ITEM **modifyp, WT_MODIFY *entries, int nentries) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_modify_apply_api(WT_SESSION_IMPL *session, WT_CURSOR *cursor, WT_MODIFY *entries, diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h index e52afc436b3..2f59f2e0cbe 100644 --- a/src/third_party/wiredtiger/src/include/stat.h +++ b/src/third_party/wiredtiger/src/include/stat.h @@ -377,6 +377,9 @@ struct __wt_connection_stats { int64_t cache_eviction_target_page_ge128; int64_t cache_eviction_target_page_lt64; int64_t cache_eviction_target_page_lt128; + int64_t cache_eviction_target_strategy_both_clean_and_dirty; + int64_t cache_eviction_target_strategy_clean; + int64_t cache_eviction_target_strategy_dirty; int64_t cache_eviction_walks_abandoned; int64_t cache_eviction_walks_stopped; int64_t cache_eviction_walks_gave_up_no_targets; @@ -407,6 +410,9 @@ struct __wt_connection_stats { int64_t cache_inmem_splittable; int64_t cache_inmem_split; int64_t cache_eviction_internal; + int64_t cache_eviction_internal_pages_queued; + int64_t cache_eviction_internal_pages_seen; + int64_t cache_eviction_internal_pages_already_queued; int64_t cache_eviction_split_internal; int64_t cache_eviction_split_leaf; int64_t cache_bytes_max; @@ -433,7 +439,12 @@ struct __wt_connection_stats { int64_t cache_read_lookaside_delay_checkpoint; int64_t cache_pages_requested; int64_t cache_eviction_pages_seen; + int64_t cache_eviction_pages_already_queued; int64_t cache_eviction_fail; + int64_t cache_eviction_fail_parent_has_overflow_items; + int64_t cache_eviction_fail_active_children_on_an_internal_page; + int64_t cache_eviction_fail_in_reconciliation; + int64_t cache_eviction_fail_with_newer_modifications_on_a_clean_page; int64_t cache_eviction_walk; int64_t cache_write; int64_t cache_write_restore; diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index 29f23585339..b3fa068047e 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -711,8 +711,9 @@ struct __wt_cursor { #define WT_CURSTD_OVERWRITE 0x02000u #define WT_CURSTD_RAW 0x04000u #define WT_CURSTD_RAW_SEARCH 0x08000u -#define WT_CURSTD_VALUE_EXT 0x10000u /* Value points out of tree. */ -#define WT_CURSTD_VALUE_INT 0x20000u /* Value points into tree. */ +#define WT_CURSTD_UPDATE_LOCAL 0x10000u +#define WT_CURSTD_VALUE_EXT 0x20000u /* Value points out of tree. */ +#define WT_CURSTD_VALUE_INT 0x40000u /* Value points into tree. */ /* AUTOMATIC FLAG VALUE GENERATION STOP */ #define WT_CURSTD_KEY_SET (WT_CURSTD_KEY_EXT | WT_CURSTD_KEY_INT) #define WT_CURSTD_VALUE_SET (WT_CURSTD_VALUE_EXT | WT_CURSTD_VALUE_INT) @@ -4905,693 +4906,727 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT64 1069 /*! cache: eviction walk target pages histogram - 64-128 */ #define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT128 1070 +/*! cache: eviction walk target strategy both clean and dirty pages */ +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_STRATEGY_BOTH_CLEAN_AND_DIRTY 1071 +/*! cache: eviction walk target strategy only clean pages */ +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_STRATEGY_CLEAN 1072 +/*! cache: eviction walk target strategy only dirty pages */ +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_STRATEGY_DIRTY 1073 /*! cache: eviction walks abandoned */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ABANDONED 1071 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ABANDONED 1074 /*! cache: eviction walks gave up because they restarted their walk twice */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STOPPED 1072 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STOPPED 1075 /*! * cache: eviction walks gave up because they saw too many pages and * found no candidates */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_NO_TARGETS 1073 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_NO_TARGETS 1076 /*! * cache: eviction walks gave up because they saw too many pages and * found too few candidates */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_RATIO 1074 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_RATIO 1077 /*! cache: eviction walks reached end of tree */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ENDED 1075 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ENDED 1078 /*! cache: eviction walks started from root of tree */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK_FROM_ROOT 1076 +#define WT_STAT_CONN_CACHE_EVICTION_WALK_FROM_ROOT 1079 /*! cache: eviction walks started from saved location in tree */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK_SAVED_POS 1077 +#define WT_STAT_CONN_CACHE_EVICTION_WALK_SAVED_POS 1080 /*! cache: eviction worker thread active */ -#define WT_STAT_CONN_CACHE_EVICTION_ACTIVE_WORKERS 1078 +#define WT_STAT_CONN_CACHE_EVICTION_ACTIVE_WORKERS 1081 /*! cache: eviction worker thread created */ -#define WT_STAT_CONN_CACHE_EVICTION_WORKER_CREATED 1079 +#define WT_STAT_CONN_CACHE_EVICTION_WORKER_CREATED 1082 /*! cache: eviction worker thread evicting pages */ -#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1080 +#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1083 /*! cache: eviction worker thread removed */ -#define WT_STAT_CONN_CACHE_EVICTION_WORKER_REMOVED 1081 +#define WT_STAT_CONN_CACHE_EVICTION_WORKER_REMOVED 1084 /*! cache: eviction worker thread stable number */ -#define WT_STAT_CONN_CACHE_EVICTION_STABLE_STATE_WORKERS 1082 +#define WT_STAT_CONN_CACHE_EVICTION_STABLE_STATE_WORKERS 1085 /*! cache: files with active eviction walks */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ACTIVE 1083 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ACTIVE 1086 /*! cache: files with new eviction walks started */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STARTED 1084 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STARTED 1087 /*! cache: force re-tuning of eviction workers once in a while */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_RETUNE 1085 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_RETUNE 1088 /*! cache: forced eviction - pages evicted that were clean count */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_CLEAN 1086 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_CLEAN 1089 /*! cache: forced eviction - pages evicted that were clean time (usecs) */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_CLEAN_TIME 1087 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_CLEAN_TIME 1090 /*! cache: forced eviction - pages evicted that were dirty count */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DIRTY 1088 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DIRTY 1091 /*! cache: forced eviction - pages evicted that were dirty time (usecs) */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DIRTY_TIME 1089 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DIRTY_TIME 1092 /*! * cache: forced eviction - pages selected because of too many deleted * items count */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1090 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1093 /*! cache: forced eviction - pages selected count */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1091 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1094 /*! cache: forced eviction - pages selected unable to be evicted count */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1092 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1095 /*! cache: forced eviction - pages selected unable to be evicted time */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL_TIME 1093 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL_TIME 1096 /*! cache: hazard pointer blocked page eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1094 +#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1097 /*! cache: hazard pointer check calls */ -#define WT_STAT_CONN_CACHE_HAZARD_CHECKS 1095 +#define WT_STAT_CONN_CACHE_HAZARD_CHECKS 1098 /*! cache: hazard pointer check entries walked */ -#define WT_STAT_CONN_CACHE_HAZARD_WALKS 1096 +#define WT_STAT_CONN_CACHE_HAZARD_WALKS 1099 /*! cache: hazard pointer maximum array length */ -#define WT_STAT_CONN_CACHE_HAZARD_MAX 1097 +#define WT_STAT_CONN_CACHE_HAZARD_MAX 1100 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1098 +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1101 /*! cache: in-memory page splits */ -#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1099 +#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1102 /*! cache: internal pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1100 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1103 +/*! cache: internal pages queued for eviction */ +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_QUEUED 1104 +/*! cache: internal pages seen by eviction walk */ +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_SEEN 1105 +/*! cache: internal pages seen by eviction walk that are already queued */ +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_ALREADY_QUEUED 1106 /*! cache: internal pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1101 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1107 /*! cache: leaf pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1102 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1108 /*! cache: maximum bytes configured */ -#define WT_STAT_CONN_CACHE_BYTES_MAX 1103 +#define WT_STAT_CONN_CACHE_BYTES_MAX 1109 /*! cache: maximum page size at eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1104 +#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1110 /*! cache: modified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1105 +#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1111 /*! cache: modified pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1106 +#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1112 /*! cache: operations timed out waiting for space in cache */ -#define WT_STAT_CONN_CACHE_TIMED_OUT_OPS 1107 +#define WT_STAT_CONN_CACHE_TIMED_OUT_OPS 1113 /*! cache: overflow pages read into cache */ -#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1108 +#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1114 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1109 +#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1115 /*! cache: page written requiring cache overflow records */ -#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1110 +#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1116 /*! cache: pages currently held in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_INUSE 1111 +#define WT_STAT_CONN_CACHE_PAGES_INUSE 1117 /*! cache: pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP 1112 +#define WT_STAT_CONN_CACHE_EVICTION_APP 1118 /*! cache: pages queued for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1113 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1119 /*! cache: pages queued for eviction post lru sorting */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_POST_LRU 1114 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_POST_LRU 1120 /*! cache: pages queued for urgent eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1115 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1121 /*! cache: pages queued for urgent eviction during walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1116 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1122 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1117 +#define WT_STAT_CONN_CACHE_READ 1123 /*! cache: pages read into cache after truncate */ -#define WT_STAT_CONN_CACHE_READ_DELETED 1118 +#define WT_STAT_CONN_CACHE_READ_DELETED 1124 /*! cache: pages read into cache after truncate in prepare state */ -#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1119 +#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1125 /*! cache: pages read into cache requiring cache overflow entries */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1120 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1126 /*! cache: pages read into cache requiring cache overflow for checkpoint */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_CHECKPOINT 1121 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_CHECKPOINT 1127 /*! cache: pages read into cache skipping older cache overflow entries */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_SKIPPED 1122 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_SKIPPED 1128 /*! * cache: pages read into cache with skipped cache overflow entries * needed later */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_DELAY 1123 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_DELAY 1129 /*! * cache: pages read into cache with skipped cache overflow entries * needed later by checkpoint */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_DELAY_CHECKPOINT 1124 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE_DELAY_CHECKPOINT 1130 /*! cache: pages requested from the cache */ -#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1125 +#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1131 /*! cache: pages seen by eviction walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1126 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1132 +/*! cache: pages seen by eviction walk that are already queued */ +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_ALREADY_QUEUED 1133 /*! cache: pages selected for eviction unable to be evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1127 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1134 +/*! + * cache: pages selected for eviction unable to be evicted as the parent + * page has overflow items + */ +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_PARENT_HAS_OVERFLOW_ITEMS 1135 +/*! + * cache: pages selected for eviction unable to be evicted because of + * active children on an internal page + */ +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_ACTIVE_CHILDREN_ON_AN_INTERNAL_PAGE 1136 +/*! + * cache: pages selected for eviction unable to be evicted because of + * failure in reconciliation + */ +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_IN_RECONCILIATION 1137 +/*! + * cache: pages selected for eviction unable to be evicted due to newer + * modifications on a clean page + */ +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_WITH_NEWER_MODIFICATIONS_ON_A_CLEAN_PAGE 1138 /*! cache: pages walked for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK 1128 +#define WT_STAT_CONN_CACHE_EVICTION_WALK 1139 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1129 +#define WT_STAT_CONN_CACHE_WRITE 1140 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1130 +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1141 /*! cache: percentage overhead */ -#define WT_STAT_CONN_CACHE_OVERHEAD 1131 +#define WT_STAT_CONN_CACHE_OVERHEAD 1142 /*! cache: tracked bytes belonging to internal pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1132 +#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1143 /*! cache: tracked bytes belonging to leaf pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_LEAF 1133 +#define WT_STAT_CONN_CACHE_BYTES_LEAF 1144 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1134 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1145 /*! cache: tracked dirty pages in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1135 +#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1146 /*! cache: unmodified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1136 +#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1147 /*! capacity: background fsync file handles considered */ -#define WT_STAT_CONN_FSYNC_ALL_FH_TOTAL 1137 +#define WT_STAT_CONN_FSYNC_ALL_FH_TOTAL 1148 /*! capacity: background fsync file handles synced */ -#define WT_STAT_CONN_FSYNC_ALL_FH 1138 +#define WT_STAT_CONN_FSYNC_ALL_FH 1149 /*! capacity: background fsync time (msecs) */ -#define WT_STAT_CONN_FSYNC_ALL_TIME 1139 +#define WT_STAT_CONN_FSYNC_ALL_TIME 1150 /*! capacity: threshold to call fsync */ -#define WT_STAT_CONN_CAPACITY_THRESHOLD 1140 +#define WT_STAT_CONN_CAPACITY_THRESHOLD 1151 /*! capacity: throttled bytes read */ -#define WT_STAT_CONN_CAPACITY_BYTES_READ 1141 +#define WT_STAT_CONN_CAPACITY_BYTES_READ 1152 /*! capacity: throttled bytes written for checkpoint */ -#define WT_STAT_CONN_CAPACITY_BYTES_CKPT 1142 +#define WT_STAT_CONN_CAPACITY_BYTES_CKPT 1153 /*! capacity: throttled bytes written for eviction */ -#define WT_STAT_CONN_CAPACITY_BYTES_EVICT 1143 +#define WT_STAT_CONN_CAPACITY_BYTES_EVICT 1154 /*! capacity: throttled bytes written for log */ -#define WT_STAT_CONN_CAPACITY_BYTES_LOG 1144 +#define WT_STAT_CONN_CAPACITY_BYTES_LOG 1155 /*! capacity: throttled bytes written total */ -#define WT_STAT_CONN_CAPACITY_BYTES_WRITTEN 1145 +#define WT_STAT_CONN_CAPACITY_BYTES_WRITTEN 1156 /*! capacity: time waiting due to total capacity (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_TOTAL 1146 +#define WT_STAT_CONN_CAPACITY_TIME_TOTAL 1157 /*! capacity: time waiting during checkpoint (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_CKPT 1147 +#define WT_STAT_CONN_CAPACITY_TIME_CKPT 1158 /*! capacity: time waiting during eviction (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_EVICT 1148 +#define WT_STAT_CONN_CAPACITY_TIME_EVICT 1159 /*! capacity: time waiting during logging (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_LOG 1149 +#define WT_STAT_CONN_CAPACITY_TIME_LOG 1160 /*! capacity: time waiting during read (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_READ 1150 +#define WT_STAT_CONN_CAPACITY_TIME_READ 1161 /*! connection: auto adjusting condition resets */ -#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1151 +#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1162 /*! connection: auto adjusting condition wait calls */ -#define WT_STAT_CONN_COND_AUTO_WAIT 1152 +#define WT_STAT_CONN_COND_AUTO_WAIT 1163 /*! connection: detected system time went backwards */ -#define WT_STAT_CONN_TIME_TRAVEL 1153 +#define WT_STAT_CONN_TIME_TRAVEL 1164 /*! connection: files currently open */ -#define WT_STAT_CONN_FILE_OPEN 1154 +#define WT_STAT_CONN_FILE_OPEN 1165 /*! connection: memory allocations */ -#define WT_STAT_CONN_MEMORY_ALLOCATION 1155 +#define WT_STAT_CONN_MEMORY_ALLOCATION 1166 /*! connection: memory frees */ -#define WT_STAT_CONN_MEMORY_FREE 1156 +#define WT_STAT_CONN_MEMORY_FREE 1167 /*! connection: memory re-allocations */ -#define WT_STAT_CONN_MEMORY_GROW 1157 +#define WT_STAT_CONN_MEMORY_GROW 1168 /*! connection: pthread mutex condition wait calls */ -#define WT_STAT_CONN_COND_WAIT 1158 +#define WT_STAT_CONN_COND_WAIT 1169 /*! connection: pthread mutex shared lock read-lock calls */ -#define WT_STAT_CONN_RWLOCK_READ 1159 +#define WT_STAT_CONN_RWLOCK_READ 1170 /*! connection: pthread mutex shared lock write-lock calls */ -#define WT_STAT_CONN_RWLOCK_WRITE 1160 +#define WT_STAT_CONN_RWLOCK_WRITE 1171 /*! connection: total fsync I/Os */ -#define WT_STAT_CONN_FSYNC_IO 1161 +#define WT_STAT_CONN_FSYNC_IO 1172 /*! connection: total read I/Os */ -#define WT_STAT_CONN_READ_IO 1162 +#define WT_STAT_CONN_READ_IO 1173 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1163 +#define WT_STAT_CONN_WRITE_IO 1174 /*! cursor: cached cursor count */ -#define WT_STAT_CONN_CURSOR_CACHED_COUNT 1164 +#define WT_STAT_CONN_CURSOR_CACHED_COUNT 1175 /*! cursor: cursor close calls that result in cache */ -#define WT_STAT_CONN_CURSOR_CACHE 1165 +#define WT_STAT_CONN_CURSOR_CACHE 1176 /*! cursor: cursor create calls */ -#define WT_STAT_CONN_CURSOR_CREATE 1166 +#define WT_STAT_CONN_CURSOR_CREATE 1177 /*! cursor: cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT 1167 +#define WT_STAT_CONN_CURSOR_INSERT 1178 /*! cursor: cursor modify calls */ -#define WT_STAT_CONN_CURSOR_MODIFY 1168 +#define WT_STAT_CONN_CURSOR_MODIFY 1179 /*! cursor: cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT 1169 +#define WT_STAT_CONN_CURSOR_NEXT 1180 /*! cursor: cursor operation restarted */ -#define WT_STAT_CONN_CURSOR_RESTART 1170 +#define WT_STAT_CONN_CURSOR_RESTART 1181 /*! cursor: cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV 1171 +#define WT_STAT_CONN_CURSOR_PREV 1182 /*! cursor: cursor remove calls */ -#define WT_STAT_CONN_CURSOR_REMOVE 1172 +#define WT_STAT_CONN_CURSOR_REMOVE 1183 /*! cursor: cursor reserve calls */ -#define WT_STAT_CONN_CURSOR_RESERVE 1173 +#define WT_STAT_CONN_CURSOR_RESERVE 1184 /*! cursor: cursor reset calls */ -#define WT_STAT_CONN_CURSOR_RESET 1174 +#define WT_STAT_CONN_CURSOR_RESET 1185 /*! cursor: cursor search calls */ -#define WT_STAT_CONN_CURSOR_SEARCH 1175 +#define WT_STAT_CONN_CURSOR_SEARCH 1186 /*! cursor: cursor search near calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1176 +#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1187 /*! cursor: cursor sweep buckets */ -#define WT_STAT_CONN_CURSOR_SWEEP_BUCKETS 1177 +#define WT_STAT_CONN_CURSOR_SWEEP_BUCKETS 1188 /*! cursor: cursor sweep cursors closed */ -#define WT_STAT_CONN_CURSOR_SWEEP_CLOSED 1178 +#define WT_STAT_CONN_CURSOR_SWEEP_CLOSED 1189 /*! cursor: cursor sweep cursors examined */ -#define WT_STAT_CONN_CURSOR_SWEEP_EXAMINED 1179 +#define WT_STAT_CONN_CURSOR_SWEEP_EXAMINED 1190 /*! cursor: cursor sweeps */ -#define WT_STAT_CONN_CURSOR_SWEEP 1180 +#define WT_STAT_CONN_CURSOR_SWEEP 1191 /*! cursor: cursor update calls */ -#define WT_STAT_CONN_CURSOR_UPDATE 1181 +#define WT_STAT_CONN_CURSOR_UPDATE 1192 /*! cursor: cursors reused from cache */ -#define WT_STAT_CONN_CURSOR_REOPEN 1182 +#define WT_STAT_CONN_CURSOR_REOPEN 1193 /*! cursor: open cursor count */ -#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1183 +#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1194 /*! cursor: truncate calls */ -#define WT_STAT_CONN_CURSOR_TRUNCATE 1184 +#define WT_STAT_CONN_CURSOR_TRUNCATE 1195 /*! data-handle: connection data handles currently active */ -#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1185 +#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1196 /*! data-handle: connection sweep candidate became referenced */ -#define WT_STAT_CONN_DH_SWEEP_REF 1186 +#define WT_STAT_CONN_DH_SWEEP_REF 1197 /*! data-handle: connection sweep dhandles closed */ -#define WT_STAT_CONN_DH_SWEEP_CLOSE 1187 +#define WT_STAT_CONN_DH_SWEEP_CLOSE 1198 /*! data-handle: connection sweep dhandles removed from hash list */ -#define WT_STAT_CONN_DH_SWEEP_REMOVE 1188 +#define WT_STAT_CONN_DH_SWEEP_REMOVE 1199 /*! data-handle: connection sweep time-of-death sets */ -#define WT_STAT_CONN_DH_SWEEP_TOD 1189 +#define WT_STAT_CONN_DH_SWEEP_TOD 1200 /*! data-handle: connection sweeps */ -#define WT_STAT_CONN_DH_SWEEPS 1190 +#define WT_STAT_CONN_DH_SWEEPS 1201 /*! data-handle: session dhandles swept */ -#define WT_STAT_CONN_DH_SESSION_HANDLES 1191 +#define WT_STAT_CONN_DH_SESSION_HANDLES 1202 /*! data-handle: session sweep attempts */ -#define WT_STAT_CONN_DH_SESSION_SWEEPS 1192 +#define WT_STAT_CONN_DH_SESSION_SWEEPS 1203 /*! lock: checkpoint lock acquisitions */ -#define WT_STAT_CONN_LOCK_CHECKPOINT_COUNT 1193 +#define WT_STAT_CONN_LOCK_CHECKPOINT_COUNT 1204 /*! lock: checkpoint lock application thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_APPLICATION 1194 +#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_APPLICATION 1205 /*! lock: checkpoint lock internal thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_INTERNAL 1195 +#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_INTERNAL 1206 /*! * lock: commit timestamp queue lock application thread time waiting * (usecs) */ -#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_WAIT_APPLICATION 1196 +#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_WAIT_APPLICATION 1207 /*! lock: commit timestamp queue lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_WAIT_INTERNAL 1197 +#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_WAIT_INTERNAL 1208 /*! lock: commit timestamp queue read lock acquisitions */ -#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_READ_COUNT 1198 +#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_READ_COUNT 1209 /*! lock: commit timestamp queue write lock acquisitions */ -#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_WRITE_COUNT 1199 +#define WT_STAT_CONN_LOCK_COMMIT_TIMESTAMP_WRITE_COUNT 1210 /*! lock: dhandle lock application thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_APPLICATION 1200 +#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_APPLICATION 1211 /*! lock: dhandle lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_INTERNAL 1201 +#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_INTERNAL 1212 /*! lock: dhandle read lock acquisitions */ -#define WT_STAT_CONN_LOCK_DHANDLE_READ_COUNT 1202 +#define WT_STAT_CONN_LOCK_DHANDLE_READ_COUNT 1213 /*! lock: dhandle write lock acquisitions */ -#define WT_STAT_CONN_LOCK_DHANDLE_WRITE_COUNT 1203 +#define WT_STAT_CONN_LOCK_DHANDLE_WRITE_COUNT 1214 /*! lock: metadata lock acquisitions */ -#define WT_STAT_CONN_LOCK_METADATA_COUNT 1204 +#define WT_STAT_CONN_LOCK_METADATA_COUNT 1215 /*! lock: metadata lock application thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_METADATA_WAIT_APPLICATION 1205 +#define WT_STAT_CONN_LOCK_METADATA_WAIT_APPLICATION 1216 /*! lock: metadata lock internal thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_METADATA_WAIT_INTERNAL 1206 +#define WT_STAT_CONN_LOCK_METADATA_WAIT_INTERNAL 1217 /*! * lock: read timestamp queue lock application thread time waiting * (usecs) */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_APPLICATION 1207 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_APPLICATION 1218 /*! lock: read timestamp queue lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_INTERNAL 1208 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_INTERNAL 1219 /*! lock: read timestamp queue read lock acquisitions */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_READ_COUNT 1209 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_READ_COUNT 1220 /*! lock: read timestamp queue write lock acquisitions */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WRITE_COUNT 1210 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WRITE_COUNT 1221 /*! lock: schema lock acquisitions */ -#define WT_STAT_CONN_LOCK_SCHEMA_COUNT 1211 +#define WT_STAT_CONN_LOCK_SCHEMA_COUNT 1222 /*! lock: schema lock application thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_APPLICATION 1212 +#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_APPLICATION 1223 /*! lock: schema lock internal thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_INTERNAL 1213 +#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_INTERNAL 1224 /*! * lock: table lock application thread time waiting for the table lock * (usecs) */ -#define WT_STAT_CONN_LOCK_TABLE_WAIT_APPLICATION 1214 +#define WT_STAT_CONN_LOCK_TABLE_WAIT_APPLICATION 1225 /*! * lock: table lock internal thread time waiting for the table lock * (usecs) */ -#define WT_STAT_CONN_LOCK_TABLE_WAIT_INTERNAL 1215 +#define WT_STAT_CONN_LOCK_TABLE_WAIT_INTERNAL 1226 /*! lock: table read lock acquisitions */ -#define WT_STAT_CONN_LOCK_TABLE_READ_COUNT 1216 +#define WT_STAT_CONN_LOCK_TABLE_READ_COUNT 1227 /*! lock: table write lock acquisitions */ -#define WT_STAT_CONN_LOCK_TABLE_WRITE_COUNT 1217 +#define WT_STAT_CONN_LOCK_TABLE_WRITE_COUNT 1228 /*! lock: txn global lock application thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_APPLICATION 1218 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_APPLICATION 1229 /*! lock: txn global lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_INTERNAL 1219 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_INTERNAL 1230 /*! lock: txn global read lock acquisitions */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_READ_COUNT 1220 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_READ_COUNT 1231 /*! lock: txn global write lock acquisitions */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WRITE_COUNT 1221 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WRITE_COUNT 1232 /*! log: busy returns attempting to switch slots */ -#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1222 +#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1233 /*! log: force archive time sleeping (usecs) */ -#define WT_STAT_CONN_LOG_FORCE_ARCHIVE_SLEEP 1223 +#define WT_STAT_CONN_LOG_FORCE_ARCHIVE_SLEEP 1234 /*! log: log bytes of payload data */ -#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1224 +#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1235 /*! log: log bytes written */ -#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1225 +#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1236 /*! log: log files manually zero-filled */ -#define WT_STAT_CONN_LOG_ZERO_FILLS 1226 +#define WT_STAT_CONN_LOG_ZERO_FILLS 1237 /*! log: log flush operations */ -#define WT_STAT_CONN_LOG_FLUSH 1227 +#define WT_STAT_CONN_LOG_FLUSH 1238 /*! log: log force write operations */ -#define WT_STAT_CONN_LOG_FORCE_WRITE 1228 +#define WT_STAT_CONN_LOG_FORCE_WRITE 1239 /*! log: log force write operations skipped */ -#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1229 +#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1240 /*! log: log records compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1230 +#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1241 /*! log: log records not compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1231 +#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1242 /*! log: log records too small to compress */ -#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1232 +#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1243 /*! log: log release advances write LSN */ -#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1233 +#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1244 /*! log: log scan operations */ -#define WT_STAT_CONN_LOG_SCANS 1234 +#define WT_STAT_CONN_LOG_SCANS 1245 /*! log: log scan records requiring two reads */ -#define WT_STAT_CONN_LOG_SCAN_REREADS 1235 +#define WT_STAT_CONN_LOG_SCAN_REREADS 1246 /*! log: log server thread advances write LSN */ -#define WT_STAT_CONN_LOG_WRITE_LSN 1236 +#define WT_STAT_CONN_LOG_WRITE_LSN 1247 /*! log: log server thread write LSN walk skipped */ -#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1237 +#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1248 /*! log: log sync operations */ -#define WT_STAT_CONN_LOG_SYNC 1238 +#define WT_STAT_CONN_LOG_SYNC 1249 /*! log: log sync time duration (usecs) */ -#define WT_STAT_CONN_LOG_SYNC_DURATION 1239 +#define WT_STAT_CONN_LOG_SYNC_DURATION 1250 /*! log: log sync_dir operations */ -#define WT_STAT_CONN_LOG_SYNC_DIR 1240 +#define WT_STAT_CONN_LOG_SYNC_DIR 1251 /*! log: log sync_dir time duration (usecs) */ -#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1241 +#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1252 /*! log: log write operations */ -#define WT_STAT_CONN_LOG_WRITES 1242 +#define WT_STAT_CONN_LOG_WRITES 1253 /*! log: logging bytes consolidated */ -#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1243 +#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1254 /*! log: maximum log file size */ -#define WT_STAT_CONN_LOG_MAX_FILESIZE 1244 +#define WT_STAT_CONN_LOG_MAX_FILESIZE 1255 /*! log: number of pre-allocated log files to create */ -#define WT_STAT_CONN_LOG_PREALLOC_MAX 1245 +#define WT_STAT_CONN_LOG_PREALLOC_MAX 1256 /*! log: pre-allocated log files not ready and missed */ -#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1246 +#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1257 /*! log: pre-allocated log files prepared */ -#define WT_STAT_CONN_LOG_PREALLOC_FILES 1247 +#define WT_STAT_CONN_LOG_PREALLOC_FILES 1258 /*! log: pre-allocated log files used */ -#define WT_STAT_CONN_LOG_PREALLOC_USED 1248 +#define WT_STAT_CONN_LOG_PREALLOC_USED 1259 /*! log: records processed by log scan */ -#define WT_STAT_CONN_LOG_SCAN_RECORDS 1249 +#define WT_STAT_CONN_LOG_SCAN_RECORDS 1260 /*! log: slot close lost race */ -#define WT_STAT_CONN_LOG_SLOT_CLOSE_RACE 1250 +#define WT_STAT_CONN_LOG_SLOT_CLOSE_RACE 1261 /*! log: slot close unbuffered waits */ -#define WT_STAT_CONN_LOG_SLOT_CLOSE_UNBUF 1251 +#define WT_STAT_CONN_LOG_SLOT_CLOSE_UNBUF 1262 /*! log: slot closures */ -#define WT_STAT_CONN_LOG_SLOT_CLOSES 1252 +#define WT_STAT_CONN_LOG_SLOT_CLOSES 1263 /*! log: slot join atomic update races */ -#define WT_STAT_CONN_LOG_SLOT_RACES 1253 +#define WT_STAT_CONN_LOG_SLOT_RACES 1264 /*! log: slot join calls atomic updates raced */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_RACE 1254 +#define WT_STAT_CONN_LOG_SLOT_YIELD_RACE 1265 /*! log: slot join calls did not yield */ -#define WT_STAT_CONN_LOG_SLOT_IMMEDIATE 1255 +#define WT_STAT_CONN_LOG_SLOT_IMMEDIATE 1266 /*! log: slot join calls found active slot closed */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_CLOSE 1256 +#define WT_STAT_CONN_LOG_SLOT_YIELD_CLOSE 1267 /*! log: slot join calls slept */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_SLEEP 1257 +#define WT_STAT_CONN_LOG_SLOT_YIELD_SLEEP 1268 /*! log: slot join calls yielded */ -#define WT_STAT_CONN_LOG_SLOT_YIELD 1258 +#define WT_STAT_CONN_LOG_SLOT_YIELD 1269 /*! log: slot join found active slot closed */ -#define WT_STAT_CONN_LOG_SLOT_ACTIVE_CLOSED 1259 +#define WT_STAT_CONN_LOG_SLOT_ACTIVE_CLOSED 1270 /*! log: slot joins yield time (usecs) */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_DURATION 1260 +#define WT_STAT_CONN_LOG_SLOT_YIELD_DURATION 1271 /*! log: slot transitions unable to find free slot */ -#define WT_STAT_CONN_LOG_SLOT_NO_FREE_SLOTS 1261 +#define WT_STAT_CONN_LOG_SLOT_NO_FREE_SLOTS 1272 /*! log: slot unbuffered writes */ -#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1262 +#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1273 /*! log: total in-memory size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_MEM 1263 +#define WT_STAT_CONN_LOG_COMPRESS_MEM 1274 /*! log: total log buffer size */ -#define WT_STAT_CONN_LOG_BUFFER_SIZE 1264 +#define WT_STAT_CONN_LOG_BUFFER_SIZE 1275 /*! log: total size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_LEN 1265 +#define WT_STAT_CONN_LOG_COMPRESS_LEN 1276 /*! log: written slots coalesced */ -#define WT_STAT_CONN_LOG_SLOT_COALESCED 1266 +#define WT_STAT_CONN_LOG_SLOT_COALESCED 1277 /*! log: yields waiting for previous log file close */ -#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1267 +#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1278 /*! perf: file system read latency histogram (bucket 1) - 10-49ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT50 1268 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT50 1279 /*! perf: file system read latency histogram (bucket 2) - 50-99ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT100 1269 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT100 1280 /*! perf: file system read latency histogram (bucket 3) - 100-249ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT250 1270 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT250 1281 /*! perf: file system read latency histogram (bucket 4) - 250-499ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT500 1271 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT500 1282 /*! perf: file system read latency histogram (bucket 5) - 500-999ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT1000 1272 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT1000 1283 /*! perf: file system read latency histogram (bucket 6) - 1000ms+ */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_GT1000 1273 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_GT1000 1284 /*! perf: file system write latency histogram (bucket 1) - 10-49ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT50 1274 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT50 1285 /*! perf: file system write latency histogram (bucket 2) - 50-99ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT100 1275 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT100 1286 /*! perf: file system write latency histogram (bucket 3) - 100-249ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT250 1276 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT250 1287 /*! perf: file system write latency histogram (bucket 4) - 250-499ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT500 1277 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT500 1288 /*! perf: file system write latency histogram (bucket 5) - 500-999ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT1000 1278 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT1000 1289 /*! perf: file system write latency histogram (bucket 6) - 1000ms+ */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_GT1000 1279 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_GT1000 1290 /*! perf: operation read latency histogram (bucket 1) - 100-249us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT250 1280 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT250 1291 /*! perf: operation read latency histogram (bucket 2) - 250-499us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT500 1281 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT500 1292 /*! perf: operation read latency histogram (bucket 3) - 500-999us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT1000 1282 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT1000 1293 /*! perf: operation read latency histogram (bucket 4) - 1000-9999us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT10000 1283 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT10000 1294 /*! perf: operation read latency histogram (bucket 5) - 10000us+ */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_GT10000 1284 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_GT10000 1295 /*! perf: operation write latency histogram (bucket 1) - 100-249us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT250 1285 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT250 1296 /*! perf: operation write latency histogram (bucket 2) - 250-499us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT500 1286 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT500 1297 /*! perf: operation write latency histogram (bucket 3) - 500-999us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT1000 1287 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT1000 1298 /*! perf: operation write latency histogram (bucket 4) - 1000-9999us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT10000 1288 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT10000 1299 /*! perf: operation write latency histogram (bucket 5) - 10000us+ */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_GT10000 1289 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_GT10000 1300 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1290 +#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1301 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1291 +#define WT_STAT_CONN_REC_PAGES 1302 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1292 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1303 /*! reconciliation: pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE 1293 +#define WT_STAT_CONN_REC_PAGE_DELETE 1304 /*! reconciliation: split bytes currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1294 +#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1305 /*! reconciliation: split objects currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1295 +#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1306 /*! session: open session count */ -#define WT_STAT_CONN_SESSION_OPEN 1296 +#define WT_STAT_CONN_SESSION_OPEN 1307 /*! session: session query timestamp calls */ -#define WT_STAT_CONN_SESSION_QUERY_TS 1297 +#define WT_STAT_CONN_SESSION_QUERY_TS 1308 /*! session: table alter failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_ALTER_FAIL 1298 +#define WT_STAT_CONN_SESSION_TABLE_ALTER_FAIL 1309 /*! session: table alter successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_ALTER_SUCCESS 1299 +#define WT_STAT_CONN_SESSION_TABLE_ALTER_SUCCESS 1310 /*! session: table alter unchanged and skipped */ -#define WT_STAT_CONN_SESSION_TABLE_ALTER_SKIP 1300 +#define WT_STAT_CONN_SESSION_TABLE_ALTER_SKIP 1311 /*! session: table compact failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1301 +#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1312 /*! session: table compact successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1302 +#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1313 /*! session: table create failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1303 +#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1314 /*! session: table create successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1304 +#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1315 /*! session: table drop failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1305 +#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1316 /*! session: table drop successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1306 +#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1317 /*! session: table rebalance failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_FAIL 1307 +#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_FAIL 1318 /*! session: table rebalance successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_SUCCESS 1308 +#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_SUCCESS 1319 /*! session: table rename failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1309 +#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1320 /*! session: table rename successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1310 +#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1321 /*! session: table salvage failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1311 +#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1322 /*! session: table salvage successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1312 +#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1323 /*! session: table truncate failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1313 +#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1324 /*! session: table truncate successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1314 +#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1325 /*! session: table verify failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1315 +#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1326 /*! session: table verify successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1316 +#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1327 /*! thread-state: active filesystem fsync calls */ -#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1317 +#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1328 /*! thread-state: active filesystem read calls */ -#define WT_STAT_CONN_THREAD_READ_ACTIVE 1318 +#define WT_STAT_CONN_THREAD_READ_ACTIVE 1329 /*! thread-state: active filesystem write calls */ -#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1319 +#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1330 /*! thread-yield: application thread time evicting (usecs) */ -#define WT_STAT_CONN_APPLICATION_EVICT_TIME 1320 +#define WT_STAT_CONN_APPLICATION_EVICT_TIME 1331 /*! thread-yield: application thread time waiting for cache (usecs) */ -#define WT_STAT_CONN_APPLICATION_CACHE_TIME 1321 +#define WT_STAT_CONN_APPLICATION_CACHE_TIME 1332 /*! * thread-yield: connection close blocked waiting for transaction state * stabilization */ -#define WT_STAT_CONN_TXN_RELEASE_BLOCKED 1322 +#define WT_STAT_CONN_TXN_RELEASE_BLOCKED 1333 /*! thread-yield: connection close yielded for lsm manager shutdown */ -#define WT_STAT_CONN_CONN_CLOSE_BLOCKED_LSM 1323 +#define WT_STAT_CONN_CONN_CLOSE_BLOCKED_LSM 1334 /*! thread-yield: data handle lock yielded */ -#define WT_STAT_CONN_DHANDLE_LOCK_BLOCKED 1324 +#define WT_STAT_CONN_DHANDLE_LOCK_BLOCKED 1335 /*! * thread-yield: get reference for page index and slot time sleeping * (usecs) */ -#define WT_STAT_CONN_PAGE_INDEX_SLOT_REF_BLOCKED 1325 +#define WT_STAT_CONN_PAGE_INDEX_SLOT_REF_BLOCKED 1336 /*! thread-yield: log server sync yielded for log write */ -#define WT_STAT_CONN_LOG_SERVER_SYNC_BLOCKED 1326 +#define WT_STAT_CONN_LOG_SERVER_SYNC_BLOCKED 1337 /*! thread-yield: page access yielded due to prepare state change */ -#define WT_STAT_CONN_PREPARED_TRANSITION_BLOCKED_PAGE 1327 +#define WT_STAT_CONN_PREPARED_TRANSITION_BLOCKED_PAGE 1338 /*! thread-yield: page acquire busy blocked */ -#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1328 +#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1339 /*! thread-yield: page acquire eviction blocked */ -#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1329 +#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1340 /*! thread-yield: page acquire locked blocked */ -#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1330 +#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1341 /*! thread-yield: page acquire read blocked */ -#define WT_STAT_CONN_PAGE_READ_BLOCKED 1331 +#define WT_STAT_CONN_PAGE_READ_BLOCKED 1342 /*! thread-yield: page acquire time sleeping (usecs) */ -#define WT_STAT_CONN_PAGE_SLEEP 1332 +#define WT_STAT_CONN_PAGE_SLEEP 1343 /*! * thread-yield: page delete rollback time sleeping for state change * (usecs) */ -#define WT_STAT_CONN_PAGE_DEL_ROLLBACK_BLOCKED 1333 +#define WT_STAT_CONN_PAGE_DEL_ROLLBACK_BLOCKED 1344 /*! thread-yield: page reconciliation yielded due to child modification */ -#define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1334 +#define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1345 /*! transaction: Number of prepared updates */ -#define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1335 +#define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1346 /*! transaction: Number of prepared updates added to cache overflow */ -#define WT_STAT_CONN_TXN_PREPARED_UPDATES_LOOKASIDE_INSERTS 1336 +#define WT_STAT_CONN_TXN_PREPARED_UPDATES_LOOKASIDE_INSERTS 1347 /*! transaction: Number of prepared updates resolved */ -#define WT_STAT_CONN_TXN_PREPARED_UPDATES_RESOLVED 1337 +#define WT_STAT_CONN_TXN_PREPARED_UPDATES_RESOLVED 1348 /*! transaction: commit timestamp queue entries walked */ -#define WT_STAT_CONN_TXN_COMMIT_QUEUE_WALKED 1338 +#define WT_STAT_CONN_TXN_COMMIT_QUEUE_WALKED 1349 /*! transaction: commit timestamp queue insert to empty */ -#define WT_STAT_CONN_TXN_COMMIT_QUEUE_EMPTY 1339 +#define WT_STAT_CONN_TXN_COMMIT_QUEUE_EMPTY 1350 /*! transaction: commit timestamp queue inserts to head */ -#define WT_STAT_CONN_TXN_COMMIT_QUEUE_HEAD 1340 +#define WT_STAT_CONN_TXN_COMMIT_QUEUE_HEAD 1351 /*! transaction: commit timestamp queue inserts total */ -#define WT_STAT_CONN_TXN_COMMIT_QUEUE_INSERTS 1341 +#define WT_STAT_CONN_TXN_COMMIT_QUEUE_INSERTS 1352 /*! transaction: commit timestamp queue length */ -#define WT_STAT_CONN_TXN_COMMIT_QUEUE_LEN 1342 +#define WT_STAT_CONN_TXN_COMMIT_QUEUE_LEN 1353 /*! transaction: number of named snapshots created */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1343 +#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1354 /*! transaction: number of named snapshots dropped */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1344 +#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1355 /*! transaction: prepared transactions */ -#define WT_STAT_CONN_TXN_PREPARE 1345 +#define WT_STAT_CONN_TXN_PREPARE 1356 /*! transaction: prepared transactions committed */ -#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1346 +#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1357 /*! transaction: prepared transactions currently active */ -#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1347 +#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1358 /*! transaction: prepared transactions rolled back */ -#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1348 +#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1359 /*! transaction: query timestamp calls */ -#define WT_STAT_CONN_TXN_QUERY_TS 1349 +#define WT_STAT_CONN_TXN_QUERY_TS 1360 /*! transaction: read timestamp queue entries walked */ -#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1350 +#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1361 /*! transaction: read timestamp queue insert to empty */ -#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1351 +#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1362 /*! transaction: read timestamp queue inserts to head */ -#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1352 +#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1363 /*! transaction: read timestamp queue inserts total */ -#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1353 +#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1364 /*! transaction: read timestamp queue length */ -#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1354 +#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1365 /*! transaction: rollback to stable calls */ -#define WT_STAT_CONN_TXN_ROLLBACK_TO_STABLE 1355 +#define WT_STAT_CONN_TXN_ROLLBACK_TO_STABLE 1366 /*! transaction: rollback to stable updates aborted */ -#define WT_STAT_CONN_TXN_ROLLBACK_UPD_ABORTED 1356 +#define WT_STAT_CONN_TXN_ROLLBACK_UPD_ABORTED 1367 /*! transaction: rollback to stable updates removed from cache overflow */ -#define WT_STAT_CONN_TXN_ROLLBACK_LAS_REMOVED 1357 +#define WT_STAT_CONN_TXN_ROLLBACK_LAS_REMOVED 1368 /*! transaction: set timestamp calls */ -#define WT_STAT_CONN_TXN_SET_TS 1358 +#define WT_STAT_CONN_TXN_SET_TS 1369 /*! transaction: set timestamp commit calls */ -#define WT_STAT_CONN_TXN_SET_TS_COMMIT 1359 +#define WT_STAT_CONN_TXN_SET_TS_COMMIT 1370 /*! transaction: set timestamp commit updates */ -#define WT_STAT_CONN_TXN_SET_TS_COMMIT_UPD 1360 +#define WT_STAT_CONN_TXN_SET_TS_COMMIT_UPD 1371 /*! transaction: set timestamp oldest calls */ -#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1361 +#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1372 /*! transaction: set timestamp oldest updates */ -#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1362 +#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1373 /*! transaction: set timestamp stable calls */ -#define WT_STAT_CONN_TXN_SET_TS_STABLE 1363 +#define WT_STAT_CONN_TXN_SET_TS_STABLE 1374 /*! transaction: set timestamp stable updates */ -#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1364 +#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1375 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1365 +#define WT_STAT_CONN_TXN_BEGIN 1376 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1366 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1377 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1367 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1378 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1368 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1379 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1369 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1380 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1370 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1381 /*! transaction: transaction checkpoint scrub dirty target */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1371 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1382 /*! transaction: transaction checkpoint scrub time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1372 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1383 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1373 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1384 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1374 +#define WT_STAT_CONN_TXN_CHECKPOINT 1385 /*! * transaction: transaction checkpoints skipped because database was * clean */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1375 +#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1386 /*! transaction: transaction failures due to cache overflow */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1376 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1387 /*! * transaction: transaction fsync calls for checkpoint after allocating * the transaction ID */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1377 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1388 /*! * transaction: transaction fsync duration for checkpoint after * allocating the transaction ID (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1378 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1389 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1379 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1390 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1380 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1391 /*! * transaction: transaction range of IDs currently pinned by named * snapshots */ -#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1381 +#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1392 /*! transaction: transaction range of timestamps currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1382 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1393 /*! transaction: transaction range of timestamps pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1383 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1394 /*! * transaction: transaction range of timestamps pinned by the oldest * timestamp */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1384 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1395 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1385 +#define WT_STAT_CONN_TXN_SYNC 1396 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1386 +#define WT_STAT_CONN_TXN_COMMIT 1397 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1387 +#define WT_STAT_CONN_TXN_ROLLBACK 1398 /*! transaction: update conflicts */ -#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1388 +#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1399 /*! * @} diff --git a/src/third_party/wiredtiger/src/include/wt_internal.h b/src/third_party/wiredtiger/src/include/wt_internal.h index 840e1353410..ec0d520653b 100644 --- a/src/third_party/wiredtiger/src/include/wt_internal.h +++ b/src/third_party/wiredtiger/src/include/wt_internal.h @@ -343,6 +343,16 @@ typedef uint64_t wt_timestamp_t; #elif defined(_MSC_VER) #include "msvc.h" #endif +/* + * GLIBC 2.26 and later use the openat syscall to implement open. Set this flag so that our strace + * tests know to expect this. + */ +#ifdef __GLIBC_PREREQ +#if __GLIBC_PREREQ(2, 26) +#define WT_USE_OPENAT 1 +#endif +#endif + #include "hardware.h" #include "swap.h" diff --git a/src/third_party/wiredtiger/src/meta/meta_ckpt.c b/src/third_party/wiredtiger/src/meta/meta_ckpt.c index 5c352ce0114..2494acdc236 100644 --- a/src/third_party/wiredtiger/src/meta/meta_ckpt.c +++ b/src/third_party/wiredtiger/src/meta/meta_ckpt.c @@ -12,7 +12,7 @@ static int __ckpt_last(WT_SESSION_IMPL *, const char *, WT_CKPT *); static int __ckpt_last_name(WT_SESSION_IMPL *, const char *, const char **); static int __ckpt_load(WT_SESSION_IMPL *, WT_CONFIG_ITEM *, WT_CONFIG_ITEM *, WT_CKPT *); static int __ckpt_named(WT_SESSION_IMPL *, const char *, const char *, WT_CKPT *); -static int __ckpt_set(WT_SESSION_IMPL *, const char *, const char *); +static int __ckpt_set(WT_SESSION_IMPL *, const char *, const char *, bool); static int __ckpt_version_chk(WT_SESSION_IMPL *, const char *, const char *); /* @@ -92,7 +92,7 @@ __wt_meta_checkpoint_clear(WT_SESSION_IMPL *session, const char *fname) * If we are unrolling a failed create, we may have already removed the metadata entry. If no * entry is found to update and we're trying to clear the checkpoint, just ignore it. */ - WT_RET_NOTFOUND_OK(__ckpt_set(session, fname, NULL)); + WT_RET_NOTFOUND_OK(__ckpt_set(session, fname, NULL, false)); return (0); } @@ -102,25 +102,40 @@ __wt_meta_checkpoint_clear(WT_SESSION_IMPL *session, const char *fname) * Set a file's checkpoint. */ static int -__ckpt_set(WT_SESSION_IMPL *session, const char *fname, const char *v) +__ckpt_set(WT_SESSION_IMPL *session, const char *fname, const char *v, bool use_base) { + WT_DECL_ITEM(tmp); WT_DECL_RET; char *config, *newcfg; - const char *cfg[3]; + const char *cfg[3], *str; + /* + * If the caller knows we're on a path like checkpoints where we have a valid checkpoint and + * checkpoint LSN and should use the base, then use that faster path. Some paths don't have a + * dhandle or want to have the older value retained from the existing metadata. In those cases, + * use the slower path through configuration parsing functions. + */ config = newcfg = NULL; - - /* Retrieve the metadata for this file. */ - WT_ERR(__wt_metadata_search(session, fname, &config)); - - /* Replace the checkpoint entry. */ - cfg[0] = config; - cfg[1] = v == NULL ? "checkpoint=()" : v; - cfg[2] = NULL; - WT_ERR(__wt_config_collapse(session, cfg, &newcfg)); - WT_ERR(__wt_metadata_update(session, fname, newcfg)); + str = v == NULL ? "checkpoint=(),checkpoint_lsn=" : v; + if (use_base && session->dhandle != NULL) { + WT_ERR(__wt_scr_alloc(session, 0, &tmp)); + WT_ASSERT(session, strcmp(session->dhandle->name, fname) == 0); + /* Concatenate the metadata base string with the checkpoint string. */ + WT_ERR(__wt_buf_fmt(session, tmp, "%s,%s", session->dhandle->meta_base, str)); + WT_ERR(__wt_metadata_update(session, fname, tmp->mem)); + } else { + /* Retrieve the metadata for this file. */ + WT_ERR(__wt_metadata_search(session, fname, &config)); + /* Replace the checkpoint entry. */ + cfg[0] = config; + cfg[1] = str; + cfg[2] = NULL; + WT_ERR(__wt_config_collapse(session, cfg, &newcfg)); + WT_ERR(__wt_metadata_update(session, fname, newcfg)); + } err: + __wt_scr_free(session, &tmp); __wt_free(session, config); __wt_free(session, newcfg); return (ret); @@ -368,6 +383,7 @@ __wt_meta_ckptlist_set( time_t secs; int64_t maxorder; const char *sep; + bool has_lsn; WT_ERR(__wt_scr_alloc(session, 0, &buf)); maxorder = 0; @@ -426,10 +442,13 @@ __wt_meta_ckptlist_set( sep = ","; } WT_ERR(__wt_buf_catfmt(session, buf, ")")); + + has_lsn = ckptlsn != NULL; if (ckptlsn != NULL) WT_ERR(__wt_buf_catfmt(session, buf, ",checkpoint_lsn=(%" PRIu32 ",%" PRIuMAX ")", ckptlsn->l.file, (uintmax_t)ckptlsn->l.offset)); - WT_ERR(__ckpt_set(session, fname, buf->mem)); + + WT_ERR(__ckpt_set(session, fname, buf->mem, has_lsn)); err: __wt_scr_free(session, &buf); diff --git a/src/third_party/wiredtiger/src/reconcile/rec_col.c b/src/third_party/wiredtiger/src/reconcile/rec_col.c index 515472bef47..f68c4ce172d 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_col.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_col.c @@ -576,6 +576,7 @@ __wt_rec_col_var( last = r->last; vpack = &_vpack; cbt = &r->update_modify_cbt; + cbt->iface.session = (WT_SESSION *)session; WT_RET(__wt_rec_split_init(session, r, page, pageref->ref_recno, btree->maxleafpage_precomp)); @@ -671,7 +672,7 @@ __wt_rec_col_var( WT_ERR(__wt_dsk_cell_data_ref(session, WT_PAGE_COL_VAR, vpack, orig)); } - record_loop: +record_loop: /* * Generate on-page entries: loop repeat records, looking for WT_INSERT entries matching the * record number. The WT_INSERT lists are in sorted order, so only need check the next one. @@ -691,8 +692,7 @@ __wt_rec_col_var( switch (upd->type) { case WT_UPDATE_MODIFY: cbt->slot = WT_COL_SLOT(page, cip); - WT_ERR( - __wt_value_return_upd(session, cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); + WT_ERR(__wt_value_return_upd(cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); data = cbt->iface.value.data; size = (uint32_t)cbt->iface.value.size; update_no_copy = false; @@ -906,8 +906,7 @@ compare: * Impossible slot, there's no backing on-page item. */ cbt->slot = UINT32_MAX; - WT_ERR( - __wt_value_return_upd(session, cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); + WT_ERR(__wt_value_return_upd(cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); data = cbt->iface.value.data; size = (uint32_t)cbt->iface.value.size; update_no_copy = false; diff --git a/src/third_party/wiredtiger/src/reconcile/rec_row.c b/src/third_party/wiredtiger/src/reconcile/rec_row.c index e2c0b06b07e..da8c10e61c6 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_row.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_row.c @@ -505,7 +505,9 @@ __rec_row_leaf_insert(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins) bool ovfl_key, upd_saved; btree = S2BT(session); + cbt = &r->update_modify_cbt; + cbt->iface.session = (WT_SESSION *)session; key = &r->k; val = &r->v; @@ -539,7 +541,7 @@ __rec_row_leaf_insert(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins) * Impossible slot, there's no backing on-page item. */ cbt->slot = UINT32_MAX; - WT_RET(__wt_value_return_upd(session, cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); + WT_RET(__wt_value_return_upd(cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); WT_RET(__wt_rec_cell_build_val( session, r, cbt->iface.value.data, cbt->iface.value.size, (uint64_t)0)); break; @@ -620,9 +622,11 @@ __wt_rec_row_leaf( const void *p; btree = S2BT(session); - cbt = &r->update_modify_cbt; slvg_skip = salvage == NULL ? 0 : salvage->skip; + cbt = &r->update_modify_cbt; + cbt->iface.session = (WT_SESSION *)session; + key = &r->k; val = &r->v; vpack = &_vpack; @@ -759,7 +763,7 @@ __wt_rec_row_leaf( switch (upd->type) { case WT_UPDATE_MODIFY: cbt->slot = WT_ROW_SLOT(page, rip); - WT_ERR(__wt_value_return_upd(session, cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); + WT_ERR(__wt_value_return_upd(cbt, upd, F_ISSET(r, WT_REC_VISIBLE_ALL))); WT_ERR(__wt_rec_cell_build_val( session, r, cbt->iface.value.data, cbt->iface.value.size, (uint64_t)0)); dictionary = true; @@ -911,7 +915,7 @@ build: /* Update compression state. */ __rec_key_state_update(r, ovfl_key); - leaf_insert: +leaf_insert: /* Write any K/V pairs inserted into the page after this key. */ if ((ins = WT_SKIP_FIRST(WT_ROW_INSERT(page, rip))) != NULL) WT_ERR(__rec_row_leaf_insert(session, r, ins)); diff --git a/src/third_party/wiredtiger/src/support/modify.c b/src/third_party/wiredtiger/src/support/modify.c index dbe98387c96..9b54e90f082 100644 --- a/src/third_party/wiredtiger/src/support/modify.c +++ b/src/third_party/wiredtiger/src/support/modify.c @@ -8,6 +8,55 @@ #include "wt_internal.h" +#define WT_MODIFY_FOREACH_BEGIN(mod, p, nentries, napplied) \ + do { \ + const size_t *__p = p; \ + const uint8_t *__data = (const uint8_t *)(__p + (size_t)(nentries)*3); \ + int __i; \ + for (__i = 0; __i < (nentries); ++__i) { \ + memcpy(&(mod).data.size, __p++, sizeof(size_t)); \ + memcpy(&(mod).offset, __p++, sizeof(size_t)); \ + memcpy(&(mod).size, __p++, sizeof(size_t)); \ + (mod).data.data = __data; \ + __data += (mod).data.size; \ + if (__i < (napplied)) \ + continue; + +#define WT_MODIFY_FOREACH_END \ + } \ + } \ + while (0) + +/* + * __wt_modify_idempotent -- + * Check if a modify operation is idempotent. + */ +bool +__wt_modify_idempotent(const void *modify) +{ + WT_MODIFY mod; + size_t tmp; + const size_t *p; + int nentries; + + /* Get the number of modify entries. */ + p = modify; + memcpy(&tmp, p++, sizeof(size_t)); + nentries = (int)tmp; + + WT_MODIFY_FOREACH_BEGIN (mod, p, nentries, 0) { + /* + * If the number of bytes being replaced doesn't match the number of bytes being written, + * we're resizing and the operation isn't idempotent. + */ + if (mod.size != mod.data.size) + return (false); + } + WT_MODIFY_FOREACH_END; + + return (true); +} + /* * __wt_modify_pack -- * Pack a modify structure into a buffer. diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c index 0b9042ca38f..2e947dabb08 100644 --- a/src/third_party/wiredtiger/src/support/stat.c +++ b/src/third_party/wiredtiger/src/support/stat.c @@ -643,7 +643,10 @@ static const char *const __stats_connection_desc[] = { "cache: eviction walk target pages histogram - 10-31", "cache: eviction walk target pages histogram - 128 and higher", "cache: eviction walk target pages histogram - 32-63", - "cache: eviction walk target pages histogram - 64-128", "cache: eviction walks abandoned", + "cache: eviction walk target pages histogram - 64-128", + "cache: eviction walk target strategy both clean and dirty pages", + "cache: eviction walk target strategy only clean pages", + "cache: eviction walk target strategy only dirty pages", "cache: eviction walks abandoned", "cache: eviction walks gave up because they restarted their walk twice", "cache: eviction walks gave up because they saw too many pages and found no candidates", "cache: eviction walks gave up because they saw too many pages and found too few candidates", @@ -665,10 +668,12 @@ static const char *const __stats_connection_desc[] = { "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", "cache: internal pages split during eviction", - "cache: leaf pages split during eviction", "cache: maximum bytes configured", - "cache: maximum page size at eviction", "cache: modified pages evicted", - "cache: modified pages evicted by application threads", + "cache: internal pages evicted", "cache: internal pages queued for eviction", + "cache: internal pages seen by eviction walk", + "cache: internal pages seen by eviction walk that are already queued", + "cache: internal pages split during eviction", "cache: leaf pages split during eviction", + "cache: maximum bytes configured", "cache: maximum page size at eviction", + "cache: modified pages evicted", "cache: modified pages evicted by application threads", "cache: operations timed out waiting for space in cache", "cache: overflow pages read into cache", "cache: page split during eviction deepened the tree", "cache: page written requiring cache overflow records", @@ -683,9 +688,17 @@ static const char *const __stats_connection_desc[] = { "cache: pages read into cache with skipped cache overflow entries needed later", "cache: pages read into cache with skipped cache overflow entries needed later by checkpoint", "cache: pages requested from the cache", "cache: pages seen by eviction walk", - "cache: pages selected for eviction unable to be evicted", "cache: pages walked for eviction", - "cache: pages written from cache", "cache: pages written requiring in-memory restoration", - "cache: percentage overhead", "cache: tracked bytes belonging to internal pages in the cache", + "cache: pages seen by eviction walk that are already queued", + "cache: pages selected for eviction unable to be evicted", + "cache: pages selected for eviction unable to be evicted as the parent page has overflow items", + "cache: pages selected for eviction unable to be evicted because of active children on an " + "internal page", + "cache: pages selected for eviction unable to be evicted because of failure in reconciliation", + "cache: pages selected for eviction unable to be evicted due to newer modifications on a clean " + "page", + "cache: pages walked for eviction", "cache: pages written from cache", + "cache: pages written requiring in-memory restoration", "cache: percentage overhead", + "cache: tracked bytes belonging to internal pages in the cache", "cache: tracked bytes belonging to leaf pages in the cache", "cache: tracked dirty bytes in the cache", "cache: tracked dirty pages in the cache", "cache: unmodified pages evicted", "capacity: background fsync file handles considered", @@ -970,6 +983,9 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_eviction_target_page_ge128 = 0; stats->cache_eviction_target_page_lt64 = 0; stats->cache_eviction_target_page_lt128 = 0; + stats->cache_eviction_target_strategy_both_clean_and_dirty = 0; + stats->cache_eviction_target_strategy_clean = 0; + stats->cache_eviction_target_strategy_dirty = 0; stats->cache_eviction_walks_abandoned = 0; stats->cache_eviction_walks_stopped = 0; stats->cache_eviction_walks_gave_up_no_targets = 0; @@ -1000,6 +1016,9 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_inmem_splittable = 0; stats->cache_inmem_split = 0; stats->cache_eviction_internal = 0; + stats->cache_eviction_internal_pages_queued = 0; + stats->cache_eviction_internal_pages_seen = 0; + stats->cache_eviction_internal_pages_already_queued = 0; stats->cache_eviction_split_internal = 0; stats->cache_eviction_split_leaf = 0; /* not clearing cache_bytes_max */ @@ -1026,7 +1045,12 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_read_lookaside_delay_checkpoint = 0; stats->cache_pages_requested = 0; stats->cache_eviction_pages_seen = 0; + stats->cache_eviction_pages_already_queued = 0; stats->cache_eviction_fail = 0; + stats->cache_eviction_fail_parent_has_overflow_items = 0; + stats->cache_eviction_fail_active_children_on_an_internal_page = 0; + stats->cache_eviction_fail_in_reconciliation = 0; + stats->cache_eviction_fail_with_newer_modifications_on_a_clean_page = 0; stats->cache_eviction_walk = 0; stats->cache_write = 0; stats->cache_write_restore = 0; @@ -1378,6 +1402,12 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->cache_eviction_target_page_ge128 += WT_STAT_READ(from, cache_eviction_target_page_ge128); to->cache_eviction_target_page_lt64 += WT_STAT_READ(from, cache_eviction_target_page_lt64); to->cache_eviction_target_page_lt128 += WT_STAT_READ(from, cache_eviction_target_page_lt128); + to->cache_eviction_target_strategy_both_clean_and_dirty += + WT_STAT_READ(from, cache_eviction_target_strategy_both_clean_and_dirty); + to->cache_eviction_target_strategy_clean += + WT_STAT_READ(from, cache_eviction_target_strategy_clean); + to->cache_eviction_target_strategy_dirty += + WT_STAT_READ(from, cache_eviction_target_strategy_dirty); to->cache_eviction_walks_abandoned += WT_STAT_READ(from, cache_eviction_walks_abandoned); to->cache_eviction_walks_stopped += WT_STAT_READ(from, cache_eviction_walks_stopped); to->cache_eviction_walks_gave_up_no_targets += @@ -1412,6 +1442,12 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->cache_inmem_splittable += WT_STAT_READ(from, cache_inmem_splittable); to->cache_inmem_split += WT_STAT_READ(from, cache_inmem_split); to->cache_eviction_internal += WT_STAT_READ(from, cache_eviction_internal); + to->cache_eviction_internal_pages_queued += + WT_STAT_READ(from, cache_eviction_internal_pages_queued); + to->cache_eviction_internal_pages_seen += + WT_STAT_READ(from, cache_eviction_internal_pages_seen); + to->cache_eviction_internal_pages_already_queued += + WT_STAT_READ(from, cache_eviction_internal_pages_already_queued); to->cache_eviction_split_internal += WT_STAT_READ(from, cache_eviction_split_internal); to->cache_eviction_split_leaf += WT_STAT_READ(from, cache_eviction_split_leaf); to->cache_bytes_max += WT_STAT_READ(from, cache_bytes_max); @@ -1442,7 +1478,17 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * WT_STAT_READ(from, cache_read_lookaside_delay_checkpoint); to->cache_pages_requested += WT_STAT_READ(from, cache_pages_requested); to->cache_eviction_pages_seen += WT_STAT_READ(from, cache_eviction_pages_seen); + to->cache_eviction_pages_already_queued += + WT_STAT_READ(from, cache_eviction_pages_already_queued); to->cache_eviction_fail += WT_STAT_READ(from, cache_eviction_fail); + to->cache_eviction_fail_parent_has_overflow_items += + WT_STAT_READ(from, cache_eviction_fail_parent_has_overflow_items); + to->cache_eviction_fail_active_children_on_an_internal_page += + WT_STAT_READ(from, cache_eviction_fail_active_children_on_an_internal_page); + to->cache_eviction_fail_in_reconciliation += + WT_STAT_READ(from, cache_eviction_fail_in_reconciliation); + to->cache_eviction_fail_with_newer_modifications_on_a_clean_page += + WT_STAT_READ(from, cache_eviction_fail_with_newer_modifications_on_a_clean_page); to->cache_eviction_walk += WT_STAT_READ(from, cache_eviction_walk); to->cache_write += WT_STAT_READ(from, cache_write); to->cache_write_restore += WT_STAT_READ(from, cache_write_restore); diff --git a/src/third_party/wiredtiger/src/txn/txn_log.c b/src/third_party/wiredtiger/src/txn/txn_log.c index dd585a6cda3..c06b8fcb1a4 100644 --- a/src/third_party/wiredtiger/src/txn/txn_log.c +++ b/src/third_party/wiredtiger/src/txn/txn_log.c @@ -81,7 +81,16 @@ __txn_op_log( #endif switch (upd->type) { case WT_UPDATE_MODIFY: - WT_RET(__wt_logop_row_modify_pack(session, logrec, fileid, &cursor->key, &value)); + /* + * Write full updates to the log for size-changing modify operations: they aren't + * idempotent and recovery cannot guarantee that they will be applied exactly once. We + * rely on the cursor value already having the modify applied. + */ + if (__wt_modify_idempotent(upd->data)) + WT_RET(__wt_logop_row_modify_pack(session, logrec, fileid, &cursor->key, &value)); + else + WT_RET( + __wt_logop_row_put_pack(session, logrec, fileid, &cursor->key, &cursor->value)); break; case WT_UPDATE_STANDARD: WT_RET(__wt_logop_row_put_pack(session, logrec, fileid, &cursor->key, &value)); @@ -98,7 +107,10 @@ __txn_op_log( switch (upd->type) { case WT_UPDATE_MODIFY: - WT_RET(__wt_logop_col_modify_pack(session, logrec, fileid, recno, &value)); + if (__wt_modify_idempotent(upd->data)) + WT_RET(__wt_logop_col_modify_pack(session, logrec, fileid, recno, &value)); + else + WT_RET(__wt_logop_col_put_pack(session, logrec, fileid, recno, &cursor->value)); break; case WT_UPDATE_STANDARD: WT_RET(__wt_logop_col_put_pack(session, logrec, fileid, recno, &value)); diff --git a/src/third_party/wiredtiger/test/csuite/schema_abort/main.c b/src/third_party/wiredtiger/test/csuite/schema_abort/main.c index 89cba3e8379..0dfe84403e6 100644 --- a/src/third_party/wiredtiger/test/csuite/schema_abort/main.c +++ b/src/third_party/wiredtiger/test/csuite/schema_abort/main.c @@ -487,7 +487,7 @@ thread_ts_run(void *arg) printf("SET STABLE: %" PRIx64 " %" PRIu64 "\n", oldest_ts, oldest_ts); } } else - ts_wait: +ts_wait: __wt_sleep(0, 1000); } /* NOTREACHED */ diff --git a/src/third_party/wiredtiger/test/format/ops.c b/src/third_party/wiredtiger/test/format/ops.c index 293614adea1..1727bdfc8ce 100644 --- a/src/third_party/wiredtiger/test/format/ops.c +++ b/src/third_party/wiredtiger/test/format/ops.c @@ -798,7 +798,7 @@ ops(void *arg) READ_OP_FAILED(true); break; case REMOVE: - remove_instead_of_truncate: +remove_instead_of_truncate: switch (g.type) { case ROW: ret = row_remove(tinfo, cursor, positioned); @@ -886,7 +886,7 @@ ops(void *arg) WRITE_OP_FAILED(false); break; case UPDATE: - update_instead_of_chosen_op: +update_instead_of_chosen_op: ++tinfo->update; switch (g.type) { case ROW: @@ -1204,7 +1204,7 @@ nextprev(TINFO *tinfo, WT_CURSOR *cursor, bool next) } else if (tinfo->keyno > keyno || (!record_gaps && keyno != tinfo->keyno + 1)) goto order_error_col; if (0) { - order_error_col: +order_error_col: testutil_die( 0, "%s returned %" PRIu64 " then %" PRIu64, which, tinfo->keyno, keyno); } @@ -1238,7 +1238,7 @@ nextprev(TINFO *tinfo, WT_CURSOR *cursor, bool next) goto order_error_row; } if (0) { - order_error_row: +order_error_row: testutil_die(0, "%s returned {%.*s} then {%.*s}", which, (int)tinfo->key->size, (char *)tinfo->key->data, (int)key.size, (char *)key.data); } diff --git a/src/third_party/wiredtiger/test/syscall/syscall.py b/src/third_party/wiredtiger/test/syscall/syscall.py index 6d5f4bc4c10..0fafc56fe45 100644 --- a/src/third_party/wiredtiger/test/syscall/syscall.py +++ b/src/third_party/wiredtiger/test/syscall/syscall.py @@ -156,7 +156,7 @@ defines_used = [ 'HAVE_FTRUNCATE', 'O_ACCMODE', 'O_APPEND', 'O_ASYNC', 'O_CLOEXEC', 'O_CREAT', 'O_EXCL', 'O_EXLOCK', 'O_NOATIME', 'O_NOFOLLOW', 'O_NONBLOCK', 'O_RDONLY', 'O_RDWR', 'O_SHLOCK', - 'O_TRUNC', 'O_WRONLY' ] + 'O_TRUNC', 'O_WRONLY', 'WT_USE_OPENAT' ] ################################################################ diff --git a/src/third_party/wiredtiger/test/syscall/wt2336_base/base.run b/src/third_party/wiredtiger/test/syscall/wt2336_base/base.run index 0dc46548c5b..539c8a83686 100644 --- a/src/third_party/wiredtiger/test/syscall/wt2336_base/base.run +++ b/src/third_party/wiredtiger/test/syscall/wt2336_base/base.run @@ -32,11 +32,11 @@ */ #ifdef __linux__ SYSTEM("Linux"); -#define OPEN_EXISTING(name, flags) open(name, flags) +#define OPEN_EXISTING(name, flags) OPEN(name, flags) #else /* __linux__ */ SYSTEM("Darwin"); #define O_NOATIME 0 -#define OPEN_EXISTING(name, flags) open(name, flags, 0) +#define OPEN_EXISTING(name, flags) OPEN(name, flags, 0) #endif /* __linux__ */ #ifdef HAVE_FTRUNCATE @@ -49,14 +49,20 @@ SYSTEM("Darwin"); #define FTRUNCATE(fd, len) /* do nothing */ #endif -TRACE("close,fdatasync,fsync,ftruncate,open,pwrite64,rename"); +#ifdef WT_USE_OPENAT +#define OPEN(...) openat(AT_FDCWD, __VA_ARGS__) +#else +#define OPEN(...) open(__VA_ARGS__) +#endif + +TRACE("close,fdatasync,fsync,ftruncate,open,openat,pwrite64,rename"); RUN(""); ... OUTPUT("--------------wiredtiger_open"); // lock == 3 -lock = open("./WiredTiger.lock", O_RDWR|O_CREAT|O_CLOEXEC, 0666); +lock = OPEN("./WiredTiger.lock", O_RDWR|O_CREAT|O_CLOEXEC, 0666); pwrite64(lock, "WiredTiger lock file\n", 0x15, 0x0); -fd = open("./WiredTiger", O_RDWR|O_CREAT|O_CLOEXEC, 0666); +fd = OPEN("./WiredTiger", O_RDWR|O_CREAT|O_CLOEXEC, 0666); pwrite64(fd, "WiredTiger\nWiredTiger"..., ...); #ifdef __linux__ fdatasync(fd); @@ -65,7 +71,7 @@ close(fd); ... // On Linux, there are calls to open and read "/proc/meminfo" here. -fd = open("./WiredTiger.basecfg.set", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666); +fd = OPEN("./WiredTiger.basecfg.set", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666); pwrite64(fd, "# Do not modify this file."..., ...); #ifdef __linux__ fdatasync(fd); @@ -74,15 +80,15 @@ close(fd); rename("./WiredTiger.basecfg.set", "./WiredTiger.basecfg"); #ifdef __linux__ -dir = open("./", O_RDONLY); +dir = OPEN("./", O_RDONLY); fdatasync(dir); close(dir); #endif -fd = open("./WiredTiger.wt", O_RDWR|O_CREAT|O_EXCL|O_NOATIME|O_CLOEXEC, 0666); +fd = OPEN("./WiredTiger.wt", O_RDWR|O_CREAT|O_EXCL|O_NOATIME|O_CLOEXEC, 0666); #ifdef __linux__ -dir = open("./", O_RDONLY); +dir = OPEN("./", O_RDONLY); fdatasync(dir); close(dir); #endif /* __linux__ */ @@ -96,7 +102,7 @@ close(fd); wt = OPEN_EXISTING("./WiredTiger.wt\0", O_RDWR|O_NOATIME|O_CLOEXEC); FTRUNCATE(wt, 0x1000); -fd = open("./WiredTiger.turtle.set\0", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666); +fd = OPEN("./WiredTiger.turtle.set\0", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666); pwrite64(fd, "WiredTiger version string\nWiredTiger"..., ...); #ifdef __linux__ fdatasync(fd); @@ -106,10 +112,10 @@ rename("./WiredTiger.turtle.set", "./WiredTiger.turtle"); ... // There is a second open of turtle here, is it important? -fd = open("./WiredTigerLAS.wt", O_RDWR|O_CREAT|O_EXCL|O_NOATIME|O_CLOEXEC, 0666); +fd = OPEN("./WiredTigerLAS.wt", O_RDWR|O_CREAT|O_EXCL|O_NOATIME|O_CLOEXEC, 0666); #ifdef __linux__ -dir = open("./", O_RDONLY); +dir = OPEN("./", O_RDONLY); fdatasync(dir); close(dir); #endif /* __linux__ */ @@ -131,10 +137,7 @@ pwrite64(wt, ""..., 0x1000, 0x3000); #ifdef __linux__ fdatasync(wt); #endif /* __linux__ */ -fd = OPEN_EXISTING("./WiredTiger.turtle", O_RDWR|O_CLOEXEC); - -close(fd); -fd = open("./WiredTiger.turtle.set", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666); +fd = OPEN("./WiredTiger.turtle.set", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666); pwrite64(fd, "WiredTiger version string\nWiredTiger"..., ...); #ifdef __linux__ fdatasync(fd); @@ -142,7 +145,7 @@ fdatasync(fd); close(fd); rename("./WiredTiger.turtle.set", "./WiredTiger.turtle"); #ifdef __linux__ -dir = open("./", O_RDONLY); +dir = OPEN("./", O_RDONLY); fdatasync(dir); close(dir); fdatasync(wt); @@ -151,9 +154,9 @@ fdatasync(wt); OUTPUT("--------------open_session"); OUTPUT("--------------create"); -hello = open("./hello.wt", O_RDWR|O_CREAT|O_EXCL|O_NOATIME|O_CLOEXEC, 0666); +hello = OPEN("./hello.wt", O_RDWR|O_CREAT|O_EXCL|O_NOATIME|O_CLOEXEC, 0666); #ifdef __linux__ -dir = open("./", O_RDONLY); +dir = OPEN("./", O_RDONLY); fdatasync(dir); close(dir); #endif /* __linux__ */ |