diff options
61 files changed, 2033 insertions, 980 deletions
diff --git a/src/third_party/wiredtiger/build_posix/configure.ac.in b/src/third_party/wiredtiger/build_posix/configure.ac.in index 30cdd4e5d06..0cbf422de08 100644 --- a/src/third_party/wiredtiger/build_posix/configure.ac.in +++ b/src/third_party/wiredtiger/build_posix/configure.ac.in @@ -15,8 +15,8 @@ AM_INIT_AUTOMAKE([1.11.6 foreign parallel-tests subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) # If CFLAGS/CXXFLAGS were not set on entry, default to "-O3 -g" -: ${CFLAGS=-O3 -g} -: ${CXXFLAGS=-O3 -g} +: ${CFLAGS=-O3 -g ${ADD_CFLAGS}} +: ${CXXFLAGS=-O3 -g ${ADD_CFLAGS}} AC_PROG_CC(cc gcc) AC_PROG_CXX(c++ g++) diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py index 1f1f59ad11a..2286b64857c 100644 --- a/src/third_party/wiredtiger/dist/api_data.py +++ b/src/third_party/wiredtiger/dist/api_data.py @@ -611,9 +611,9 @@ connection_runtime_config = [ trigger application threads to perform eviction when the cache contains at least this many bytes of updates. It is a percentage of the cache size if the value is within the range of 1 to 100 or an absolute size when - greater than 100. Calculated as half of \c eviction_dirty_trigger by default. + greater than 100\. Calculated as half of \c eviction_dirty_trigger by default. The value is not allowed to exceed the \c cache_size. This setting only - alters behavior if it is lower than eviction_trigger''', + alters behavior if it is lower than \c eviction_trigger''', min=0, max='10TB'), Config('file_manager', '', r''' control how file handles are managed''', diff --git a/src/third_party/wiredtiger/dist/s_stat b/src/third_party/wiredtiger/dist/s_stat index 17d3bd64f34..f1eae589959 100755 --- a/src/third_party/wiredtiger/dist/s_stat +++ b/src/third_party/wiredtiger/dist/s_stat @@ -22,6 +22,7 @@ search=`sed \ # There are some fields that are used, but we can't detect it. cat << UNUSED_STAT_FIELDS +btree_clean_checkpoint_timer lock_checkpoint_count lock_checkpoint_wait_application lock_checkpoint_wait_internal diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py index 3f5ec928e5d..8befa46c629 100644 --- a/src/third_party/wiredtiger/dist/stat_data.py +++ b/src/third_party/wiredtiger/dist/stat_data.py @@ -300,9 +300,12 @@ connection_stats = [ CacheStat('cache_hazard_walks', 'hazard pointer check entries walked'), CacheStat('cache_hs_insert', 'history store table insert calls'), CacheStat('cache_hs_insert_restart', 'history store table insert calls that returned restart'), - CacheStat('cache_hs_key_truncate_onpage_removal', 'history store key truncation due to the key being removed from the data page'), - CacheStat('cache_hs_key_truncate_mix_ts', 'history store key truncation due to mixed timestamps'), - CacheStat('cache_hs_key_truncate_mix_ts_restart', 'history store key truncation calls that returned restart'), + CacheStat('cache_hs_key_truncate', 'history store table truncation to remove an update'), + CacheStat('cache_hs_key_truncate_mix_ts', 'history store table truncation to remove range of updates due to mixed timestamps'), + CacheStat('cache_hs_key_truncate_mix_ts_restart', 'history store table truncation due to mixed timestamps that returned restart'), + CacheStat('cache_hs_key_truncate_onpage_removal', 'history store table truncation to remove range of updates due to key being removed from the data page during reconciliation'), + CacheStat('cache_hs_key_truncate_rts', 'history store table truncation by rollback to stable to remove an update'), + CacheStat('cache_hs_key_truncate_rts_unstable', 'history store table truncation by rollback to stable to remove an unstable update'), CacheStat('cache_hs_ondisk', 'history store table on-disk size', 'no_clear,no_scale,size'), CacheStat('cache_hs_ondisk_max', 'history store table max on-disk size', 'no_clear,no_scale,size'), CacheStat('cache_hs_order_fixup_insert', 'history store table out-of-order updates that were fixed up during insertion'), @@ -311,7 +314,6 @@ connection_stats = [ CacheStat('cache_hs_read', 'history store table reads'), CacheStat('cache_hs_read_miss', 'history store table reads missed'), CacheStat('cache_hs_read_squash', 'history store table reads requiring squashed modifies'), - CacheStat('cache_hs_remove_key_truncate', 'history store table remove calls due to key truncation'), CacheStat('cache_hs_score', 'history store score', 'no_clear,no_scale'), CacheStat('cache_hs_write_squash', 'history store table writes requiring squashed modifies'), CacheStat('cache_inmem_split', 'in-memory page splits'), @@ -654,6 +656,7 @@ connection_stats = [ TxnStat('txn_prepare_rollback', 'prepared transactions rolled back'), TxnStat('txn_prepared_updates_count', 'Number of prepared updates'), TxnStat('txn_query_ts', 'query timestamp calls'), + TxnStat('txn_read_race_prepare_update', 'race to read prepared update retry'), TxnStat('txn_read_queue_empty', 'read timestamp queue insert to empty'), TxnStat('txn_read_queue_head', 'read timestamp queue inserts to head'), TxnStat('txn_read_queue_inserts', 'read timestamp queue inserts total'), @@ -725,6 +728,7 @@ dsrc_stats = [ # Btree statistics ########################################## BtreeStat('btree_checkpoint_generation', 'btree checkpoint generation', 'no_clear,no_scale'), + BtreeStat('btree_clean_checkpoint_timer', 'btree clean tree checkpoint expiration time', 'no_clear,no_scale'), BtreeStat('btree_column_deleted', 'column-store variable-size deleted values', 'no_scale,tree_walk'), BtreeStat('btree_column_fix', 'column-store fixed-size leaf pages', 'no_scale,tree_walk'), BtreeStat('btree_column_internal', 'column-store internal pages', 'no_scale,tree_walk'), @@ -930,6 +934,7 @@ dsrc_stats = [ ########################################## # Transaction statistics ########################################## + TxnStat('txn_read_race_prepare_update', 'race to read prepared update retry'), TxnStat('txn_update_conflict', 'update conflicts'), ] diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 86428858f26..5b1b9bc03aa 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-4.4", - "commit": "8092bf0a392191e14fe39d8d8503a2f627d5d2a8" + "commit": "9c79fedf125e1d63250d767a8bddffcfa9fb7757" } diff --git a/src/third_party/wiredtiger/src/btree/bt_debug.c b/src/third_party/wiredtiger/src/btree/bt_debug.c index 99956204900..33f4bc3ab3b 100644 --- a/src/third_party/wiredtiger/src/btree/bt_debug.c +++ b/src/third_party/wiredtiger/src/btree/bt_debug.c @@ -21,7 +21,7 @@ struct __wt_dbg { WT_ITEM *hs_key; /* History store lookups */ WT_ITEM *hs_value; uint32_t session_flags; - bool hs_is_local, is_owner; + bool hs_is_local; /* * When using the standard event handlers, the debugging output has to do its own message @@ -288,7 +288,7 @@ __debug_wrapup(WT_DBG *ds) msg = ds->msg; if (ds->hs_is_local) - WT_TRET(__wt_hs_cursor_close(session, ds->session_flags, ds->is_owner)); + WT_TRET(__wt_hs_cursor_close(session, ds->session_flags)); __wt_scr_free(session, &ds->key); __wt_scr_free(session, &ds->hs_key); @@ -975,15 +975,14 @@ __wt_debug_cursor_tree_hs(void *cursor_arg, const char *ofile) WT_DECL_RET; WT_SESSION_IMPL *session; uint32_t session_flags; - bool is_owner; session = CUR2S(cursor_arg); session_flags = 0; /* [-Werror=maybe-uninitialized] */ - WT_RET(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_RET(__wt_hs_cursor_open(session, &session_flags)); cbt = (WT_CURSOR_BTREE *)session->hs_cursor; WT_WITH_BTREE(session, CUR2BT(cbt), ret = __wt_debug_tree_all(session, NULL, NULL, ofile)); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); return (ret); } @@ -1029,8 +1028,7 @@ __debug_page(WT_DBG *ds, WT_REF *ref, uint32_t flags) * doesn't work, we may be running in-memory. */ if (!WT_IS_HS(S2BT(session))) { - if (session->hs_cursor == NULL && - __wt_hs_cursor(session, &ds->session_flags, &ds->is_owner) == 0) + if (session->hs_cursor == NULL && __wt_hs_cursor_open(session, &ds->session_flags) == 0) ds->hs_is_local = true; if (session->hs_cursor != NULL) { WT_RET(__wt_scr_alloc(session, 0, &ds->hs_key)); diff --git a/src/third_party/wiredtiger/src/btree/bt_delete.c b/src/third_party/wiredtiger/src/btree/bt_delete.c index 7be09d8f514..5c0e658d80d 100644 --- a/src/third_party/wiredtiger/src/btree/bt_delete.c +++ b/src/third_party/wiredtiger/src/btree/bt_delete.c @@ -264,6 +264,7 @@ __tombstone_update_alloc( WT_UPDATE *upd; WT_RET(__wt_upd_alloc_tombstone(session, &upd, sizep)); + F_SET(upd, WT_UPDATE_RESTORED_FAST_TRUNCATE); /* * Cleared memory matches the lowest possible transaction ID and timestamp, do nothing. diff --git a/src/third_party/wiredtiger/src/btree/bt_vrfy.c b/src/third_party/wiredtiger/src/btree/bt_vrfy.c index b7ab4f87434..8a22ea1032f 100644 --- a/src/third_party/wiredtiger/src/btree/bt_vrfy.c +++ b/src/third_party/wiredtiger/src/btree/bt_vrfy.c @@ -173,7 +173,7 @@ __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]) #if 0 /* FIXME-WT-6263: Temporarily disable history store verification. */ uint32_t session_flags; - bool is_owner, skip_hs; + bool skip_hs; #endif btree = S2BT(session); @@ -185,7 +185,6 @@ __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]) #if 0 /* FIXME-WT-6263: Temporarily disable history store verification. */ session_flags = 0; /* -Wuninitialized */ - is_owner = false; /* -Wuninitialized */ /* * Skip the history store explicit call if we're performing a metadata verification. The @@ -283,9 +282,9 @@ __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]) */ if (ret == 0 && (ckpt + 1)->name == NULL && !skip_hs) { /* Open a history store cursor. */ - WT_ERR(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_ERR(__wt_hs_cursor_open(session, &session_flags); WT_TRET(__wt_history_store_verify_one(session)); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags); /* * We cannot error out here. If we got an error verifying the history store, we need * to follow through with reacquiring the exclusive call below. We'll error out diff --git a/src/third_party/wiredtiger/src/conn/conn_cache.c b/src/third_party/wiredtiger/src/conn/conn_cache.c index 5d0166242ce..3b212d94352 100644 --- a/src/third_party/wiredtiger/src/conn/conn_cache.c +++ b/src/third_party/wiredtiger/src/conn/conn_cache.c @@ -208,7 +208,7 @@ __wt_cache_config(WT_SESSION_IMPL *session, bool reconfigure, const char *cfg[]) */ if (reconfigure) WT_RET(__wt_thread_group_resize(session, &conn->evict_threads, conn->evict_threads_min, - conn->evict_threads_max, WT_THREAD_CAN_WAIT | WT_THREAD_HS | WT_THREAD_PANIC_FAIL)); + conn->evict_threads_max, WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL)); return (0); } diff --git a/src/third_party/wiredtiger/src/cursor/cur_backup_incr.c b/src/third_party/wiredtiger/src/cursor/cur_backup_incr.c index f30bd1c4d3b..8ddb771a403 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_backup_incr.c +++ b/src/third_party/wiredtiger/src/cursor/cur_backup_incr.c @@ -70,6 +70,11 @@ __curbackup_incr_blkmod(WT_SESSION_IMPL *session, WT_BTREE *btree, WT_CURSOR_BAC cb->nbits = (uint64_t)b.val; WT_ERR(__wt_config_subgets(session, &v, "offset", &b)); cb->offset = (uint64_t)b.val; + WT_ERR(__wt_config_subgets(session, &v, "rename", &b)); + if (b.val) + F_SET(cb, WT_CURBACKUP_RENAME); + else + F_CLR(cb, WT_CURBACKUP_RENAME); /* * We found a match. Load the block information into the cursor. @@ -112,7 +117,7 @@ __curbackup_incr_next(WT_CURSOR *cursor) F_CLR(cursor, WT_CURSTD_RAW); if (!F_ISSET(cb, WT_CURBACKUP_INCR_INIT) && - (btree == NULL || F_ISSET(cb, WT_CURBACKUP_FORCE_FULL))) { + (btree == NULL || F_ISSET(cb, WT_CURBACKUP_FORCE_FULL | WT_CURBACKUP_RENAME))) { /* * We don't have this object's incremental information or it's a forced file copy. If this * is a log file, use the full pathname that may include the log path. @@ -155,19 +160,21 @@ __curbackup_incr_next(WT_CURSOR *cursor) */ WT_ERR(__curbackup_incr_blkmod(session, btree, cb)); /* - * There are three cases where we do not have block modification information for + * There are several cases where we do not have block modification information for * the file. They are described and handled as follows: * - * 1. Newly created file without checkpoint information. Return the whole file - * information. - * 2. File created and checkpointed before incremental backups were configured. + * 1. Renamed file. Always return the whole file information. + * 2. Newly created file without checkpoint information. Return the whole + * file information. + * 3. File created and checkpointed before incremental backups were configured. * Return no file information as it was copied in the initial full backup. - * 3. File that has not been modified since the previous incremental backup. + * 4. File that has not been modified since the previous incremental backup. * Return no file information as there is no new information. */ - if (cb->bitstring.mem == NULL) { + if (cb->bitstring.mem == NULL || F_ISSET(cb, WT_CURBACKUP_RENAME)) { F_SET(cb, WT_CURBACKUP_INCR_INIT); - if (F_ISSET(cb, WT_CURBACKUP_CKPT_FAKE) && F_ISSET(cb, WT_CURBACKUP_HAS_CB_INFO)) { + if (F_ISSET(cb, WT_CURBACKUP_RENAME) || + (F_ISSET(cb, WT_CURBACKUP_CKPT_FAKE) && F_ISSET(cb, WT_CURBACKUP_HAS_CB_INFO))) { WT_ERR(__wt_fs_size(session, cb->incr_file, &size)); __wt_cursor_set_key(cursor, 0, size, WT_BACKUP_FILE); goto done; diff --git a/src/third_party/wiredtiger/src/cursor/cur_join.c b/src/third_party/wiredtiger/src/cursor/cur_join.c index 06159cb54bd..53923282fc0 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_join.c +++ b/src/third_party/wiredtiger/src/cursor/cur_join.c @@ -201,7 +201,8 @@ err: /* * __curjoin_iter_bump -- * Called to advance the iterator to the next endpoint, which may in turn advance to the next - * entry. + * entry. We cannot skip a call to this at the end of an iteration because we'll need to advance + * the position to the end. */ static int __curjoin_iter_bump(WT_CURSOR_JOIN_ITER *iter) @@ -482,8 +483,14 @@ __curjoin_entry_in_range( } if (!passed) { - if (iter != NULL && (iter->is_equal || F_ISSET(end, WT_CURJOIN_END_LT))) + if (iter != NULL && (iter->is_equal || F_ISSET(end, WT_CURJOIN_END_LT))) { + /* + * Even though this cursor is done, we still need to bump (advance it), to mark the + * iteration as complete. + */ + WT_RET(__curjoin_iter_bump(iter)); return (WT_NOTFOUND); + } if (!disjunction) return (WT_NOTFOUND); iter = NULL; diff --git a/src/third_party/wiredtiger/src/evict/evict_file.c b/src/third_party/wiredtiger/src/evict/evict_file.c index d84304622c1..edeb226471d 100644 --- a/src/third_party/wiredtiger/src/evict/evict_file.c +++ b/src/third_party/wiredtiger/src/evict/evict_file.c @@ -87,9 +87,13 @@ __wt_evict_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) case WT_SYNC_DISCARD: /* * Discard the page regardless of whether it is dirty. + * + * If the page has a page deleted structure, we are discarding the page that is cleaned + * by a checkpoint. */ WT_ASSERT(session, F_ISSET(dhandle, WT_DHANDLE_DEAD) || - F_ISSET(S2C(session), WT_CONN_CLOSING) || __wt_page_can_evict(session, ref, NULL)); + F_ISSET(S2C(session), WT_CONN_CLOSING) || __wt_page_can_evict(session, ref, NULL) || + (ref->page_del != NULL && page->modify->page_state == WT_PAGE_CLEAN)); __wt_ref_out(session, ref); break; case WT_SYNC_CHECKPOINT: diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c index c004e782c57..6cd75bd55e1 100644 --- a/src/third_party/wiredtiger/src/evict/evict_lru.c +++ b/src/third_party/wiredtiger/src/evict/evict_lru.c @@ -274,7 +274,6 @@ __wt_evict_thread_run(WT_SESSION_IMPL *session, WT_THREAD *thread) WT_DECL_RET; uint32_t session_flags; bool did_work, was_intr; - bool is_owner; conn = S2C(session); cache = conn->cache; @@ -284,10 +283,10 @@ __wt_evict_thread_run(WT_SESSION_IMPL *session, WT_THREAD *thread) * busy and then opens a different file (in this case, the HS file), it can deadlock with a * thread waiting for the first file to drain from the eviction queue. See WT-5946 for details. */ - if (!F_ISSET(conn, WT_CONN_IN_MEMORY)) { + if (session->hs_cursor == NULL && !F_ISSET(conn, WT_CONN_IN_MEMORY | WT_CONN_READONLY)) { session_flags = 0; /* [-Werror=maybe-uninitialized] */ - WT_RET(__wt_hs_cursor(session, &session_flags, &is_owner)); - WT_RET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_RET(__wt_hs_cursor_open(session, &session_flags)); + WT_RET(__wt_hs_cursor_close(session, session_flags)); } if (conn->evict_server_running && __wt_spin_trylock(session, &cache->evict_pass_lock) == 0) { @@ -493,7 +492,7 @@ __wt_evict_create(WT_SESSION_IMPL *session) /* * Create the eviction thread group. Set the group size to the maximum allowed sessions. */ - session_flags = WT_THREAD_CAN_WAIT | WT_THREAD_HS | WT_THREAD_PANIC_FAIL; + session_flags = WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL; WT_RET(__wt_thread_group_create(session, &conn->evict_threads, "eviction-server", conn->evict_threads_min, conn->evict_threads_max, session_flags, __wt_evict_thread_chk, __wt_evict_thread_run, __wt_evict_thread_stop)); @@ -1471,8 +1470,12 @@ retry: /* * Skip files that are configured to stick in cache until we become aggressive. + * + * If the file is contributing heavily to our cache usage then ignore the "stickiness" of + * its pages. */ - if (btree->evict_priority != 0 && !__wt_cache_aggressive(session)) + if (btree->evict_priority != 0 && !__wt_cache_aggressive(session) && + !__wt_btree_dominating_cache(session, btree)) continue; /* diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c index bb9e3604ec8..ff21df8b519 100644 --- a/src/third_party/wiredtiger/src/evict/evict_page.c +++ b/src/third_party/wiredtiger/src/evict/evict_page.c @@ -96,7 +96,7 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, uint8_t previous_state, uint32 WT_PAGE *page; uint64_t time_start, time_stop; uint32_t session_flags; - bool clean_page, closing, force_evict_hs, inmem_split, is_owner, local_gen, tree_dead; + bool clean_page, closing, force_evict_hs, inmem_split, local_gen, tree_dead; conn = S2C(session); page = ref->page; @@ -134,8 +134,8 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, uint8_t previous_state, uint32 session->hs_cursor == NULL && !F_ISSET(session, WT_SESSION_NO_RECONCILE) && session != conn->default_session) { session_flags = 0; /* [-Werror=maybe-uninitialized] */ - WT_RET(__wt_hs_cursor(session, &session_flags, &is_owner)); - WT_RET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_RET(__wt_hs_cursor_open(session, &session_flags)); + WT_RET(__wt_hs_cursor_close(session, session_flags)); } /* diff --git a/src/third_party/wiredtiger/src/history/hs.c b/src/third_party/wiredtiger/src/history/hs.c index cb93b42e56a..56526130622 100644 --- a/src/third_party/wiredtiger/src/history/hs.c +++ b/src/third_party/wiredtiger/src/history/hs.c @@ -63,17 +63,16 @@ __wt_hs_get_btree(WT_SESSION_IMPL *session, WT_BTREE **hs_btreep) { WT_DECL_RET; uint32_t session_flags; - bool is_owner; *hs_btreep = NULL; session_flags = 0; /* [-Werror=maybe-uninitialized] */ - WT_RET(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_RET(__wt_hs_cursor_open(session, &session_flags)); *hs_btreep = CUR2BT(session->hs_cursor); WT_ASSERT(session, *hs_btreep != NULL); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); return (ret); } @@ -212,12 +211,15 @@ __wt_hs_destroy(WT_SESSION_IMPL *session) * Open a new history store table cursor. */ int -__wt_hs_cursor_open(WT_SESSION_IMPL *session) +__wt_hs_cursor_open(WT_SESSION_IMPL *session, uint32_t *session_flags) { WT_CURSOR *cursor; WT_DECL_RET; const char *open_cursor_cfg[] = {WT_CONFIG_BASE(session, WT_SESSION_open_cursor), NULL}; + /* Not allowed to open a cursor if you already have one */ + WT_ASSERT(session, session->hs_cursor == NULL && !F_ISSET(session, WT_SESSION_HS_CURSOR)); + WT_WITHOUT_DHANDLE( session, ret = __wt_open_cursor(session, WT_HS_URI, NULL, open_cursor_cfg, &cursor)); WT_RET(ret); @@ -225,41 +227,16 @@ __wt_hs_cursor_open(WT_SESSION_IMPL *session) /* History store cursors should always ignore tombstones. */ F_SET(cursor, WT_CURSTD_IGNORE_TOMBSTONE); - session->hs_cursor = cursor; - F_SET(session, WT_SESSION_HS_CURSOR); - - return (0); -} - -/* - * __wt_hs_cursor -- - * Return a history store cursor, open one if not already open. - */ -int -__wt_hs_cursor(WT_SESSION_IMPL *session, uint32_t *session_flags, bool *is_owner) -{ /* - * We don't want to get tapped for eviction after we start using the history store cursor; save - * a copy of the current eviction state, we'll turn eviction off before we return. - * - * Don't cache history store table pages, we're here because of eviction problems and there's no - * reason to believe history store pages will be useful more than once. + * We don't want to get tapped for eviction after we start using the history store cursor. Save + * a copy of the current flag values. We'll restore them when the cursor is closed. */ *session_flags = F_MASK(session, WT_HS_SESSION_FLAGS); - *is_owner = false; - - /* Open a cursor if this session doesn't already have one. */ - if (!F_ISSET(session, WT_SESSION_HS_CURSOR)) { - /* The caller is responsible for closing this cursor. */ - *is_owner = true; - WT_RET(__wt_hs_cursor_open(session)); - } - - WT_ASSERT(session, session->hs_cursor != NULL); - - /* Configure session to access the history store table. */ F_SET(session, WT_HS_SESSION_FLAGS); + session->hs_cursor = cursor; + F_SET(session, WT_SESSION_HS_CURSOR); + return (0); } @@ -268,25 +245,13 @@ __wt_hs_cursor(WT_SESSION_IMPL *session, uint32_t *session_flags, bool *is_owner * Discard a history store cursor. */ int -__wt_hs_cursor_close(WT_SESSION_IMPL *session, uint32_t session_flags, bool is_owner) +__wt_hs_cursor_close(WT_SESSION_IMPL *session, uint32_t session_flags) { - /* Nothing to do if the session doesn't have a HS cursor opened. */ - if (!F_ISSET(session, WT_SESSION_HS_CURSOR)) { - WT_ASSERT(session, session->hs_cursor == NULL); - return (0); - } - WT_ASSERT(session, session->hs_cursor != NULL); - - /* - * If we're not the owner, we're not responsible for closing this cursor. Reset the cursor to - * avoid pinning the page in cache. - */ - if (!is_owner) - return (session->hs_cursor->reset(session->hs_cursor)); + /* Should only be called when session has an open history store cursor */ + WT_ASSERT(session, session->hs_cursor != NULL && F_ISSET(session, WT_SESSION_HS_CURSOR)); /* - * We turned off caching and eviction while the history store cursor was in use, restore the - * session's flags. + * Restore previous values of history store session flags. */ F_CLR(session, WT_HS_SESSION_FLAGS); F_SET(session, session_flags); @@ -694,7 +659,8 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) WT_MODIFY entries[MAX_REVERSE_MODIFY_NUM]; WT_MODIFY_VECTOR modifies; WT_SAVE_UPD *list; - WT_UPDATE *first_non_ts_upd, *non_aborted_upd, *oldest_upd, *prev_upd, *upd; + WT_UPDATE *first_globally_visible_upd, *first_non_ts_upd; + WT_UPDATE *non_aborted_upd, *oldest_upd, *prev_upd, *upd; WT_HS_TIME_POINT stop_time_point; wt_off_t hs_size; wt_timestamp_t min_insert_ts; @@ -727,6 +693,19 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) if (list->onpage_upd == NULL) continue; + /* Skip aborted updates. */ + for (upd = list->onpage_upd->next; upd != NULL && upd->txnid == WT_TXN_ABORTED; + upd = upd->next) + ; + + /* No update to insert to history store. */ + if (upd == NULL) + continue; + + /* Updates have already been inserted to the history store. */ + if (F_ISSET(upd, WT_UPDATE_HS)) + continue; + /* History store table key component: source key. */ switch (page->type) { case WT_PAGE_COL_FIX: @@ -749,17 +728,12 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) WT_ERR(__wt_illegal_value(session, page->type)); } - /* - * Trim any updates before writing to history store. This saves wasted work. - */ - WT_WITH_BTREE( - session, btree, upd = __wt_update_obsolete_check(session, page, list->onpage_upd, true)); - __wt_free_update_list(session, &upd); - upd = list->onpage_upd; - - first_non_ts_upd = NULL; + first_globally_visible_upd = first_non_ts_upd = NULL; ts_updates_in_hs = false; enable_reverse_modify = true; + min_insert_ts = WT_TS_MAX; + + __wt_modify_vector_clear(&modifies); /* * The algorithm assumes the oldest update on the update chain in memory is either a full @@ -788,8 +762,7 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) * tombstone. * 4) We have a single tombstone on the chain, it is simply ignored. */ - min_insert_ts = WT_TS_MAX; - for (non_aborted_upd = prev_upd = NULL; upd != NULL; + for (upd = list->onpage_upd, non_aborted_upd = prev_upd = NULL; upd != NULL; prev_upd = non_aborted_upd, upd = upd->next) { if (upd->txnid == WT_TXN_ABORTED) continue; @@ -814,10 +787,21 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) __wt_timestamp_to_string(min_insert_ts, ts_string[2])); upd->start_ts = upd->durable_ts = min_insert_ts; WT_STAT_CONN_INCR(session, cache_hs_order_fixup_insert); - } else + } else if (upd->start_ts != WT_TS_NONE) + /* + * Don't reset to WT_TS_NONE as we don't want to clear the timestamps for updates + * older than the update without timestamp. + */ min_insert_ts = upd->start_ts; + WT_ERR(__wt_modify_vector_push(&modifies, upd)); + /* Track the first update that is globally visible. */ + if (first_globally_visible_upd == NULL && __wt_txn_upd_visible_all(session, upd)) + first_globally_visible_upd = upd; + else if (first_globally_visible_upd != NULL) + F_SET(upd, WT_UPDATE_OBSOLETE); + /* * Always insert full update to the history store if we write a prepared update to the * data store. @@ -835,19 +819,26 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) enable_reverse_modify = false; /* Find the first update without timestamp. */ - if (first_non_ts_upd == NULL && upd->start_ts == WT_TS_NONE) { + if (first_non_ts_upd == NULL && upd->start_ts == WT_TS_NONE) first_non_ts_upd = upd; - } else if (first_non_ts_upd != NULL && upd->start_ts != WT_TS_NONE) { + else if (first_non_ts_upd != NULL && upd->start_ts != WT_TS_NONE) { /* * Don't insert updates with timestamps after updates without timestamps to the * history store. */ - F_SET(upd, WT_UPDATE_MASKED_BY_NON_TS_UPDATE); + F_SET(upd, WT_UPDATE_OBSOLETE); if (F_ISSET(upd, WT_UPDATE_HS)) ts_updates_in_hs = true; } /* + * No need to continue if we see the first self contained value after the first globally + * visible value. + */ + if (first_globally_visible_upd != NULL && WT_UPDATE_DATA_VALUE(upd)) + break; + + /* * If we've reached a full update and it's in the history store we don't need to * continue as anything beyond this point won't help with calculating deltas. */ @@ -857,21 +848,6 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) prev_upd = upd = NULL; - /* - * Trim from the end until there is a full update. We need this if we are dealing with - * updates without timestamps, and there are timestamped modify updates at the end of update - * chain that are not relevant due to newer full updates without timestamps. - */ - for (; modifies.size > 0;) { - __wt_modify_vector_peek(&modifies, &upd); - if (upd->type == WT_UPDATE_MODIFY) { - WT_ASSERT(session, F_ISSET(upd, WT_UPDATE_MASKED_BY_NON_TS_UPDATE)); - __wt_modify_vector_pop(&modifies, &upd); - } else - break; - } - upd = NULL; - /* Construct the oldest full update. */ WT_ASSERT(session, modifies.size > 0); @@ -886,11 +862,13 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) * the correct place to delete the history store records when inserting the first update and * it may be skipped if there is nothing to insert to the history store. */ - if (oldest_upd->type == WT_UPDATE_TOMBSTONE && oldest_upd == first_non_ts_upd) { + if (oldest_upd->type == WT_UPDATE_TOMBSTONE && oldest_upd == first_non_ts_upd && + !F_ISSET(first_non_ts_upd, WT_UPDATE_CLEARED_HS)) { /* We can only delete history store entries that have timestamps. */ WT_ERR(__wt_hs_delete_key_from_ts(session, btree->id, key, 1)); WT_STAT_CONN_INCR(session, cache_hs_key_truncate_mix_ts); clear_hs = false; + F_SET(first_non_ts_upd, WT_UPDATE_CLEARED_HS); } else /* * Clear the content with timestamps in the history store if we see updates without @@ -900,7 +878,8 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) * list and there are no updates moved to the history store by checkpoint or a failed * eviction. */ - clear_hs = first_non_ts_upd != NULL && !F_ISSET(first_non_ts_upd, WT_UPDATE_HS) && + clear_hs = first_non_ts_upd != NULL && + !F_ISSET(first_non_ts_upd, WT_UPDATE_CLEARED_HS) && (list->ins == NULL || ts_updates_in_hs); WT_ERR(__hs_next_upd_full_value(session, &modifies, NULL, full_value, &upd)); @@ -951,8 +930,8 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) continue; } - /* Skip updates already in the history store or masked by updates without timestamps. */ - if (F_ISSET(upd, WT_UPDATE_HS | WT_UPDATE_MASKED_BY_NON_TS_UPDATE)) + /* Skip updates that are already in the history store or are obsolete. */ + if (F_ISSET(upd, WT_UPDATE_HS | WT_UPDATE_OBSOLETE)) continue; /* @@ -972,6 +951,19 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) } /* + * Clear history store content if we skip inserting the updates without timestamp. e.g., + * if we have an update chain U@30 -> M@20 -> U@0 and M@20 is globally visible, we skip + * writing U@0 to the history store. + */ + if (clear_hs && upd->start_ts != WT_TS_NONE) { + /* We can only delete history store entries that have timestamps. */ + WT_ERR(__wt_hs_delete_key_from_ts(session, btree->id, key, 1)); + WT_STAT_CONN_INCR(session, cache_hs_key_truncate_mix_ts); + clear_hs = false; + F_SET(first_non_ts_upd, WT_UPDATE_CLEARED_HS); + } + + /* * Calculate reverse modify and clear the history store records with timestamps when * inserting the first update. */ @@ -987,6 +979,9 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) WT_ERR(__hs_insert_record(session, cursor, btree, key, upd, WT_UPDATE_STANDARD, full_value, &stop_time_point, clear_hs)); + if (clear_hs) + F_SET(first_non_ts_upd, WT_UPDATE_CLEARED_HS); + clear_hs = false; /* Flag the update as now in the history store. */ F_SET(upd, WT_UPDATE_HS); @@ -1020,6 +1015,7 @@ __wt_hs_insert_updates(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi) /* We can only delete history store entries that have timestamps. */ WT_ERR(__wt_hs_delete_key_from_ts(session, btree->id, key, 1)); WT_STAT_CONN_INCR(session, cache_hs_key_truncate_mix_ts); + F_SET(first_non_ts_upd, WT_UPDATE_CLEARED_HS); } } @@ -1194,7 +1190,7 @@ __wt_hs_find_upd(WT_SESSION_IMPL *session, WT_ITEM *key, const char *value_forma uint32_t hs_btree_id, session_flags; uint8_t *p, recno_key_buf[WT_INTPACK64_MAXSIZE], upd_type; int cmp; - bool is_owner, modify; + bool modify; hs_cursor = NULL; mod_upd = upd = NULL; @@ -1206,7 +1202,6 @@ __wt_hs_find_upd(WT_SESSION_IMPL *session, WT_ITEM *key, const char *value_forma hs_btree_id = S2BT(session)->id; session_flags = 0; /* [-Werror=maybe-uninitialized] */ WT_NOT_READ(modify, false); - is_owner = false; WT_STAT_CONN_INCR(session, cursor_search_hs); WT_STAT_DATA_INCR(session, cursor_search_hs); @@ -1227,7 +1222,7 @@ __wt_hs_find_upd(WT_SESSION_IMPL *session, WT_ITEM *key, const char *value_forma WT_ERR(__wt_scr_alloc(session, 0, &hs_value)); /* Open a history store table cursor. */ - WT_ERR(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_ERR(__wt_hs_cursor_open(session, &session_flags)); hs_cursor = session->hs_cursor; hs_cbt = (WT_CURSOR_BTREE *)hs_cursor; @@ -1392,7 +1387,7 @@ err: __wt_scr_free(session, &hs_value); WT_ASSERT(session, hs_key.mem == NULL && hs_key.memsize == 0); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); __wt_free_update_list(session, &mod_upd); while (modifies.size > 0) { @@ -1488,26 +1483,14 @@ __wt_hs_delete_key_from_ts( WT_SESSION_IMPL *session, uint32_t btree_id, const WT_ITEM *key, wt_timestamp_t ts) { WT_DECL_RET; - uint32_t session_flags; - bool is_owner; - - session_flags = session->flags; - - /* - * Some code paths such as schema removal involve deleting keys in metadata and assert that we - * shouldn't be opening new dhandles. We won't ever need to blow away history store content in - * these cases so let's just return early here. - */ - if (F_ISSET(session, WT_SESSION_NO_DATA_HANDLES)) - return (0); - WT_RET(__wt_hs_cursor(session, &session_flags, &is_owner)); + /* If the operation can't open new handles, it should have figured that out before here. */ + WT_ASSERT(session, !F_ISSET(session, WT_SESSION_NO_DATA_HANDLES)); /* The tree structure can change while we try to insert the mod list, retry if that happens. */ while ((ret = __hs_delete_key_from_ts_int(session, btree_id, key, ts)) == WT_RESTART) WT_STAT_CONN_INCR(session, cache_hs_insert_restart); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); return (ret); } @@ -1735,7 +1718,7 @@ __hs_delete_key_from_pos( upd->start_ts = upd->durable_ts = WT_TS_NONE; WT_ERR(__wt_hs_modify(hs_cbt, upd)); upd = NULL; - WT_STAT_CONN_INCR(session, cache_hs_remove_key_truncate); + WT_STAT_CONN_INCR(session, cache_hs_key_truncate); } if (ret == WT_NOTFOUND) return (0); @@ -1884,7 +1867,7 @@ __wt_history_store_verify(WT_SESSION_IMPL *session) uint64_t hs_counter; uint32_t btree_id, session_flags; char *uri_data; - bool is_owner, stop; + bool stop; /* We should never reach here if working in context of the default session. */ WT_ASSERT(session, S2C(session)->default_session != session); @@ -1894,10 +1877,9 @@ __wt_history_store_verify(WT_SESSION_IMPL *session) btree_id = WT_BTREE_ID_INVALID; session_flags = 0; /* [-Wconditional-uninitialized] */ uri_data = NULL; - is_owner = false; /* [-Wconditional-uninitialized] */ WT_ERR(__wt_scr_alloc(session, 0, &buf)); - WT_ERR(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_ERR(__wt_hs_cursor_open(session, &session_flags)); cursor = session->hs_cursor; WT_ERR_NOTFOUND_OK(__wt_hs_cursor_next(session, cursor), true); stop = ret == WT_NOTFOUND ? true : false; @@ -1929,7 +1911,7 @@ __wt_history_store_verify(WT_SESSION_IMPL *session) WT_ERR_NOTFOUND_OK(ret, false); } err: - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); __wt_scr_free(session, &buf); WT_ASSERT(session, hs_key.mem == NULL && hs_key.memsize == 0); diff --git a/src/third_party/wiredtiger/src/include/btmem.h b/src/third_party/wiredtiger/src/include/btmem.h index 8d193cf258e..ea214244c57 100644 --- a/src/third_party/wiredtiger/src/include/btmem.h +++ b/src/third_party/wiredtiger/src/include/btmem.h @@ -1074,11 +1074,13 @@ struct __wt_update { volatile uint8_t prepare_state; /* prepare state */ /* AUTOMATIC FLAG VALUE GENERATION START */ -#define WT_UPDATE_HS 0x01u /* Update has been written to history store. */ -#define WT_UPDATE_MASKED_BY_NON_TS_UPDATE 0x02u /* Update masked by updates without timestamp. */ -#define WT_UPDATE_PREPARE_RESTORED_FROM_DS 0x04u /* Prepared update restored from data store. */ -#define WT_UPDATE_RESTORED_FROM_DS 0x08u /* Update restored from data store. */ -#define WT_UPDATE_RESTORED_FROM_HS 0x10u /* Update restored from history store. */ +#define WT_UPDATE_CLEARED_HS 0x01u /* Update that cleared the history store. */ +#define WT_UPDATE_HS 0x02u /* Update has been written to history store. */ +#define WT_UPDATE_OBSOLETE 0x04u /* Update that is obsolete. */ +#define WT_UPDATE_PREPARE_RESTORED_FROM_DS 0x08u /* Prepared update restored from data store. */ +#define WT_UPDATE_RESTORED_FAST_TRUNCATE 0x10u /* Fast truncate instantiation */ +#define WT_UPDATE_RESTORED_FROM_DS 0x20u /* Update restored from data store. */ +#define WT_UPDATE_RESTORED_FROM_HS 0x40u /* Update restored from history store. */ /* AUTOMATIC FLAG VALUE GENERATION STOP */ uint8_t flags; diff --git a/src/third_party/wiredtiger/src/include/btree.h b/src/third_party/wiredtiger/src/include/btree.h index ca639abd6ca..8ec0953c378 100644 --- a/src/third_party/wiredtiger/src/include/btree.h +++ b/src/third_party/wiredtiger/src/include/btree.h @@ -203,6 +203,21 @@ struct __wt_btree { */ uint64_t file_max; +/* + * We maintain a timer for a clean file to avoid excessive checking of checkpoint information that + * incurs a large processing penalty. We avoid that but will periodically incur the cost to clean up + * checkpoints that can be deleted. + */ +#define WT_BTREE_CLEAN_CKPT(session, btree, val) \ + do { \ + (btree)->clean_ckpt_timer = (val); \ + WT_STAT_DATA_SET((session), btree_clean_checkpoint_timer, (val)); \ + } while (0) +/* Statistics don't like UINT64_MAX, use INT64_MAX. It's still forever. */ +#define WT_BTREE_CLEAN_CKPT_FOREVER INT64_MAX +#define WT_BTREE_CLEAN_MINUTES 10 + uint64_t clean_ckpt_timer; + /* * We flush pages from the tree (in order to make checkpoint faster), without a high-level lock. * To avoid multiple threads flushing at the same time, lock the tree. diff --git a/src/third_party/wiredtiger/src/include/cache.i b/src/third_party/wiredtiger/src/include/cache.i index 5a8d8bdfd4c..204da30753c 100644 --- a/src/third_party/wiredtiger/src/include/cache.i +++ b/src/third_party/wiredtiger/src/include/cache.i @@ -353,6 +353,32 @@ __wt_eviction_updates_needed(WT_SESSION_IMPL *session, double *pct_fullp) } /* + * __wt_btree_dominating_cache -- + * Return if a single btree is occupying at least half of any of our target's cache usage. + */ +static inline bool +__wt_btree_dominating_cache(WT_SESSION_IMPL *session, WT_BTREE *btree) +{ + WT_CACHE *cache; + uint64_t bytes_max; + + cache = S2C(session)->cache; + bytes_max = S2C(session)->cache_size + 1; + + if (__wt_cache_bytes_plus_overhead(cache, btree->bytes_inmem) > + (uint64_t)(0.5 * cache->eviction_target * bytes_max) / 100) + return (true); + if (__wt_cache_bytes_plus_overhead(cache, btree->bytes_dirty_intl + btree->bytes_dirty_leaf) > + (uint64_t)(0.5 * cache->eviction_dirty_target * bytes_max) / 100) + return (true); + if (__wt_cache_bytes_plus_overhead(cache, btree->bytes_updates) > + (uint64_t)(0.5 * cache->eviction_updates_target * bytes_max) / 100) + return (true); + + return (false); +} + +/* * __wt_eviction_needed -- * Return if an application thread should do eviction, and the cache full percentage as a * side-effect. diff --git a/src/third_party/wiredtiger/src/include/cursor.h b/src/third_party/wiredtiger/src/include/cursor.h index be3672f1ac5..3d04cfaa73e 100644 --- a/src/third_party/wiredtiger/src/include/cursor.h +++ b/src/third_party/wiredtiger/src/include/cursor.h @@ -61,15 +61,16 @@ struct __wt_cursor_backup { uint64_t granularity; /* Length, transfer size */ /* AUTOMATIC FLAG VALUE GENERATION START */ -#define WT_CURBACKUP_CKPT_FAKE 0x01u /* Object has fake checkpoint */ -#define WT_CURBACKUP_DUP 0x02u /* Duplicated backup cursor */ -#define WT_CURBACKUP_FORCE_FULL 0x04u /* Force full file copy for this cursor */ -#define WT_CURBACKUP_FORCE_STOP 0x08u /* Force stop incremental backup */ -#define WT_CURBACKUP_HAS_CB_INFO 0x10u /* Object has checkpoint backup info */ -#define WT_CURBACKUP_INCR 0x20u /* Incremental backup cursor */ -#define WT_CURBACKUP_INCR_INIT 0x40u /* Cursor traversal initialized */ -#define WT_CURBACKUP_LOCKER 0x80u /* Hot-backup started */ - /* AUTOMATIC FLAG VALUE GENERATION STOP */ +#define WT_CURBACKUP_CKPT_FAKE 0x001u /* Object has fake checkpoint */ +#define WT_CURBACKUP_DUP 0x002u /* Duplicated backup cursor */ +#define WT_CURBACKUP_FORCE_FULL 0x004u /* Force full file copy for this cursor */ +#define WT_CURBACKUP_FORCE_STOP 0x008u /* Force stop incremental backup */ +#define WT_CURBACKUP_HAS_CB_INFO 0x010u /* Object has checkpoint backup info */ +#define WT_CURBACKUP_INCR 0x020u /* Incremental backup cursor */ +#define WT_CURBACKUP_INCR_INIT 0x040u /* Cursor traversal initialized */ +#define WT_CURBACKUP_LOCKER 0x080u /* Hot-backup started */ +#define WT_CURBACKUP_RENAME 0x100u /* Object had a rename */ + /* AUTOMATIC FLAG VALUE GENERATION STOP */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index 513013eab3c..5ce0cc553eb 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -358,6 +358,8 @@ extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_checkpoint_sync(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt) + WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_close_connection_close(WT_SESSION_IMPL *session) @@ -753,13 +755,11 @@ extern int __wt_hs_config(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_hs_create(WT_SESSION_IMPL *session, const char **cfg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_hs_cursor(WT_SESSION_IMPL *session, uint32_t *session_flags, bool *is_owner) - WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_hs_cursor_close(WT_SESSION_IMPL *session, uint32_t session_flags, bool is_owner) +extern int __wt_hs_cursor_close(WT_SESSION_IMPL *session, uint32_t session_flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_hs_cursor_next(WT_SESSION_IMPL *session, WT_CURSOR *cursor) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_hs_cursor_open(WT_SESSION_IMPL *session) +extern int __wt_hs_cursor_open(WT_SESSION_IMPL *session, uint32_t *session_flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_hs_cursor_position(WT_SESSION_IMPL *session, WT_CURSOR *cursor, uint32_t btree_id, const WT_ITEM *key, wt_timestamp_t timestamp, WT_ITEM *user_srch_key) @@ -1034,6 +1034,8 @@ extern int __wt_meta_apply_all(WT_SESSION_IMPL *session, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern int __wt_meta_blk_mods_load(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt, + bool rename) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_meta_block_metadata(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_meta_checkpoint(WT_SESSION_IMPL *session, const char *fname, const char *checkpoint, @@ -1709,6 +1711,7 @@ extern void __wt_meta_track_discard(WT_SESSION_IMPL *session); extern void __wt_meta_track_sub_on(WT_SESSION_IMPL *session); extern void __wt_metadata_free_ckptlist(WT_SESSION *session, WT_CKPT *ckptbase) WT_GCC_FUNC_DECL_ATTRIBUTE((visibility("default"))); +extern void __wt_modify_vector_clear(WT_MODIFY_VECTOR *modifies); extern void __wt_modify_vector_free(WT_MODIFY_VECTOR *modifies); extern void __wt_modify_vector_init(WT_SESSION_IMPL *session, WT_MODIFY_VECTOR *modifies); extern void __wt_modify_vector_peek(WT_MODIFY_VECTOR *modifies, WT_UPDATE **updp); @@ -1793,6 +1796,8 @@ static inline WT_VISIBLE_TYPE __wt_txn_upd_visible_type(WT_SESSION_IMPL *session WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); static inline bool __wt_btree_can_evict_dirty(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +static inline bool __wt_btree_dominating_cache(WT_SESSION_IMPL *session, WT_BTREE *btree) + WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); static inline bool __wt_btree_lsm_over_size(WT_SESSION_IMPL *session, uint64_t maxsize) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); static inline bool __wt_cache_aggressive(WT_SESSION_IMPL *session) diff --git a/src/third_party/wiredtiger/src/include/meta.h b/src/third_party/wiredtiger/src/include/meta.h index 0b0d436f146..a0241a22ce7 100644 --- a/src/third_party/wiredtiger/src/include/meta.h +++ b/src/third_party/wiredtiger/src/include/meta.h @@ -33,8 +33,11 @@ #define WT_HS_FILE "WiredTigerHS.wt" /* History store table */ #define WT_HS_URI "file:WiredTigerHS.wt" /* History store table URI */ -#define WT_SYSTEM_PREFIX "system:" /* System URI prefix */ -#define WT_SYSTEM_CKPT_URI "system:checkpoint" /* Checkpoint URI */ +#define WT_SYSTEM_PREFIX "system:" /* System URI prefix */ +#define WT_SYSTEM_CKPT_TS "checkpoint_timestamp" /* Checkpoint timestamp name */ +#define WT_SYSTEM_CKPT_URI "system:checkpoint" /* Checkpoint timestamp URI */ +#define WT_SYSTEM_OLDEST_TS "oldest_timestamp" /* Oldest timestamp name */ +#define WT_SYSTEM_OLDEST_URI "system:oldest" /* Oldest timestamp URI */ /* * Optimize comparisons against the metafile URI, flag handles that reference the metadata file. @@ -95,8 +98,9 @@ struct __wt_block_mods { uint64_t offset; /* Zero bit offset for bitstring */ uint64_t granularity; /* AUTOMATIC FLAG VALUE GENERATION START */ -#define WT_BLOCK_MODS_VALID 0x1u /* Entry is valid */ - /* AUTOMATIC FLAG VALUE GENERATION STOP */ +#define WT_BLOCK_MODS_RENAME 0x1u /* Entry is from a rename */ +#define WT_BLOCK_MODS_VALID 0x2u /* Entry is valid */ + /* AUTOMATIC FLAG VALUE GENERATION STOP */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h index 4f51d8a075a..11b966a0e55 100644 --- a/src/third_party/wiredtiger/src/include/stat.h +++ b/src/third_party/wiredtiger/src/include/stat.h @@ -398,9 +398,6 @@ struct __wt_connection_stats { int64_t cache_hazard_checks; int64_t cache_hazard_walks; int64_t cache_hazard_max; - int64_t cache_hs_key_truncate_mix_ts_restart; - int64_t cache_hs_key_truncate_mix_ts; - int64_t cache_hs_key_truncate_onpage_removal; int64_t cache_hs_score; int64_t cache_hs_insert; int64_t cache_hs_insert_restart; @@ -412,7 +409,12 @@ struct __wt_connection_stats { int64_t cache_hs_read; int64_t cache_hs_read_miss; int64_t cache_hs_read_squash; - int64_t cache_hs_remove_key_truncate; + int64_t cache_hs_key_truncate_rts_unstable; + int64_t cache_hs_key_truncate_rts; + int64_t cache_hs_key_truncate_mix_ts_restart; + int64_t cache_hs_key_truncate; + int64_t cache_hs_key_truncate_onpage_removal; + int64_t cache_hs_key_truncate_mix_ts; int64_t cache_hs_write_squash; int64_t cache_inmem_splittable; int64_t cache_inmem_split; @@ -716,6 +718,7 @@ struct __wt_connection_stats { int64_t txn_prepare_active; int64_t txn_prepare_rollback; int64_t txn_query_ts; + int64_t txn_read_race_prepare_update; int64_t txn_read_queue_walked; int64_t txn_read_queue_empty; int64_t txn_read_queue_head; @@ -799,6 +802,7 @@ struct __wt_dsrc_stats { int64_t block_size; int64_t block_minor; int64_t btree_checkpoint_generation; + int64_t btree_clean_checkpoint_timer; int64_t btree_column_fix; int64_t btree_column_internal; int64_t btree_column_rle; @@ -956,6 +960,7 @@ struct __wt_dsrc_stats { int64_t rec_time_window_stop_ts; int64_t rec_time_window_stop_txn; int64_t session_compact; + int64_t txn_read_race_prepare_update; int64_t txn_update_conflict; }; diff --git a/src/third_party/wiredtiger/src/include/thread_group.h b/src/third_party/wiredtiger/src/include/thread_group.h index 6a3908ba591..fd991715723 100644 --- a/src/third_party/wiredtiger/src/include/thread_group.h +++ b/src/third_party/wiredtiger/src/include/thread_group.h @@ -22,12 +22,11 @@ struct __wt_thread { * groups. */ /* AUTOMATIC FLAG VALUE GENERATION START */ -#define WT_THREAD_ACTIVE 0x01u /* thread is active or paused */ -#define WT_THREAD_CAN_WAIT 0x02u /* WT_SESSION_CAN_WAIT */ -#define WT_THREAD_HS 0x04u /* open history store cursor */ -#define WT_THREAD_PANIC_FAIL 0x08u /* panic if the thread fails */ -#define WT_THREAD_RUN 0x10u /* thread is running */ - /* AUTOMATIC FLAG VALUE GENERATION STOP */ +#define WT_THREAD_ACTIVE 0x1u /* Thread is active or paused */ +#define WT_THREAD_CAN_WAIT 0x2u /* WT_SESSION_CAN_WAIT */ +#define WT_THREAD_PANIC_FAIL 0x4u /* Panic if the thread fails */ +#define WT_THREAD_RUN 0x8u /* Thread is running */ + /* AUTOMATIC FLAG VALUE GENERATION STOP */ uint32_t flags; /* diff --git a/src/third_party/wiredtiger/src/include/time.i b/src/third_party/wiredtiger/src/include/time.i index cff5e0850ea..a218e3cb97b 100644 --- a/src/third_party/wiredtiger/src/include/time.i +++ b/src/third_party/wiredtiger/src/include/time.i @@ -162,6 +162,9 @@ __wt_op_timer_start(WT_SESSION_IMPL *session) { uint64_t timeout_us; + if (F_ISSET(session, WT_SESSION_HS_CURSOR)) + return; + /* Timer can be configured per-transaction, and defaults to per-connection. */ if (session->txn == NULL || (timeout_us = session->txn->operation_timeout_us) == 0) timeout_us = S2C(session)->operation_timeout_us; @@ -180,6 +183,9 @@ __wt_op_timer_start(WT_SESSION_IMPL *session) static inline void __wt_op_timer_stop(WT_SESSION_IMPL *session) { + if (F_ISSET(session, WT_SESSION_HS_CURSOR)) + return; + session->operation_start_us = session->operation_timeout_us = 0; } @@ -192,6 +198,8 @@ __wt_op_timer_fired(WT_SESSION_IMPL *session) { uint64_t diff, now; + if (F_ISSET(session, WT_SESSION_HS_CURSOR)) + return (false); if (session->operation_start_us == 0 || session->operation_timeout_us == 0) return (false); diff --git a/src/third_party/wiredtiger/src/include/txn.h b/src/third_party/wiredtiger/src/include/txn.h index 5e6d10fd546..ae3f8f94350 100644 --- a/src/third_party/wiredtiger/src/include/txn.h +++ b/src/third_party/wiredtiger/src/include/txn.h @@ -166,10 +166,11 @@ struct __wt_txn_global { * We rely on the fact that (a) the only table a checkpoint updates is the metadata; and (b) * once checkpoint has finished reading a table, it won't revisit it. */ - volatile bool checkpoint_running; /* Checkpoint running */ - volatile uint32_t checkpoint_id; /* Checkpoint's session ID */ - WT_TXN_SHARED checkpoint_txn_shared; /* Checkpoint's txn shared state */ - wt_timestamp_t checkpoint_timestamp; /* Checkpoint's timestamp */ + volatile bool checkpoint_running; /* Checkpoint running */ + volatile uint32_t checkpoint_id; /* Checkpoint's session ID */ + WT_TXN_SHARED checkpoint_txn_shared; /* Checkpoint's txn shared state */ + wt_timestamp_t checkpoint_timestamp; /* Checkpoint's timestamp */ + wt_timestamp_t checkpoint_oldest_timestamp; /* The oldest timestamp at the time of checkpoint */ volatile uint64_t debug_ops; /* Debug mode op counter */ uint64_t debug_rollback; /* Debug mode rollback */ diff --git a/src/third_party/wiredtiger/src/include/txn.i b/src/third_party/wiredtiger/src/include/txn.i index 688875072cb..3cb29f342fe 100644 --- a/src/third_party/wiredtiger/src/include/txn.i +++ b/src/third_party/wiredtiger/src/include/txn.i @@ -917,9 +917,12 @@ __wt_txn_read(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *key, uint { WT_TIME_WINDOW tw; WT_UPDATE *prepare_upd; - bool have_stop_tw; + bool have_stop_tw, retry; + prepare_upd = NULL; + retry = true; +retry: WT_RET(__wt_txn_read_upd_list(session, cbt, upd, &prepare_upd)); if (WT_UPDATE_DATA_VALUE(cbt->upd_value) || (cbt->upd_value->type == WT_UPDATE_MODIFY && cbt->upd_value->skip_buf)) @@ -1003,9 +1006,23 @@ __wt_txn_read(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *key, uint */ if (prepare_upd != NULL) { WT_ASSERT(session, F_ISSET(prepare_upd, WT_UPDATE_PREPARE_RESTORED_FROM_DS)); - if (prepare_upd->txnid == WT_TXN_ABORTED || - prepare_upd->prepare_state == WT_PREPARE_RESOLVED) - return (WT_RESTART); + if (retry && (prepare_upd->txnid == WT_TXN_ABORTED || + prepare_upd->prepare_state == WT_PREPARE_RESOLVED)) { + retry = false; + /* Clean out any stale value before performing the retry. */ + __wt_upd_value_clear(cbt->upd_value); + WT_STAT_CONN_INCR(session, txn_read_race_prepare_update); + WT_STAT_DATA_INCR(session, txn_read_race_prepare_update); + + /* + * When a prepared update/insert is rollback or committed, retrying it again should fix + * concurrent modification of a prepared update. Other than prepared insert rollback, + * rest of the cases, the history store update is either added to the end of the update + * chain or modified to set proper stop timestamp. In all the scenarios, retrying again + * will work to return a proper update. + */ + goto retry; + } } /* Return invalid not tombstone if nothing is found in history store. */ @@ -1251,10 +1268,10 @@ __wt_txn_update_check(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE if (!rollback && upd == NULL && cbt != NULL && CUR2BT(cbt)->type != BTREE_COL_FIX && cbt->ins == NULL) { __wt_read_cell_time_window(cbt, cbt->ref, &tw); - if (tw.stop_txn != WT_TXN_MAX && tw.stop_ts != WT_TS_MAX) - rollback = !__wt_txn_visible(session, tw.stop_txn, tw.stop_ts); + if (WT_TIME_WINDOW_HAS_STOP(&tw)) + rollback = !__wt_txn_tw_stop_visible(session, &tw); else - rollback = !__wt_txn_visible(session, tw.start_txn, tw.start_ts); + rollback = !__wt_txn_tw_start_visible(session, &tw); } if (rollback) { diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index b67ad675fd6..977ad90cdc9 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -2259,9 +2259,9 @@ struct __wt_connection { * @config{eviction_updates_trigger, trigger application threads to perform eviction when * the cache contains at least this many bytes of updates. It is a percentage of the cache * size if the value is within the range of 1 to 100 or an absolute size when greater than - * 100. Calculated as half of \c eviction_dirty_trigger by default. The value is not + * 100\. Calculated as half of \c eviction_dirty_trigger by default. The value is not * allowed to exceed the \c cache_size. This setting only alters behavior if it is lower - * than eviction_trigger., an integer between 0 and 10TB; default \c 0.} + * than \c eviction_trigger., an integer between 0 and 10TB; default \c 0.} * @config{file_manager = (, control how file handles are managed., a set of related * configuration options defined below.} * @config{ @@ -2919,10 +2919,10 @@ struct __wt_connection { * integer between 0 and 10TB; default \c 0.} * @config{eviction_updates_trigger, trigger application threads to perform eviction when the cache * contains at least this many bytes of updates. It is a percentage of the cache size if the value - * is within the range of 1 to 100 or an absolute size when greater than 100. Calculated as half of + * is within the range of 1 to 100 or an absolute size when greater than 100\. Calculated as half of * \c eviction_dirty_trigger by default. The value is not allowed to exceed the \c cache_size. - * This setting only alters behavior if it is lower than eviction_trigger., an integer between 0 and - * 10TB; default \c 0.} + * This setting only alters behavior if it is lower than \c eviction_trigger., an integer between 0 + * and 10TB; default \c 0.} * @config{exclusive, fail if the database already exists\, generally used with the \c create * option., a boolean flag; default \c false.} * @config{extensions, list of shared library extensions to load (using dlopen). Any values @@ -5195,874 +5195,892 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_HAZARD_WALKS 1101 /*! cache: hazard pointer maximum array length */ #define WT_STAT_CONN_CACHE_HAZARD_MAX 1102 -/*! cache: history store key truncation calls that returned restart */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_MIX_TS_RESTART 1103 -/*! cache: history store key truncation due to mixed timestamps */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_MIX_TS 1104 -/*! - * cache: history store key truncation due to the key being removed from - * the data page - */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_ONPAGE_REMOVAL 1105 /*! cache: history store score */ -#define WT_STAT_CONN_CACHE_HS_SCORE 1106 +#define WT_STAT_CONN_CACHE_HS_SCORE 1103 /*! cache: history store table insert calls */ -#define WT_STAT_CONN_CACHE_HS_INSERT 1107 +#define WT_STAT_CONN_CACHE_HS_INSERT 1104 /*! cache: history store table insert calls that returned restart */ -#define WT_STAT_CONN_CACHE_HS_INSERT_RESTART 1108 +#define WT_STAT_CONN_CACHE_HS_INSERT_RESTART 1105 /*! cache: history store table max on-disk size */ -#define WT_STAT_CONN_CACHE_HS_ONDISK_MAX 1109 +#define WT_STAT_CONN_CACHE_HS_ONDISK_MAX 1106 /*! cache: history store table on-disk size */ -#define WT_STAT_CONN_CACHE_HS_ONDISK 1110 +#define WT_STAT_CONN_CACHE_HS_ONDISK 1107 /*! * cache: history store table out-of-order resolved updates that lose * their durable timestamp */ -#define WT_STAT_CONN_CACHE_HS_ORDER_LOSE_DURABLE_TIMESTAMP 1111 +#define WT_STAT_CONN_CACHE_HS_ORDER_LOSE_DURABLE_TIMESTAMP 1108 /*! * cache: history store table out-of-order updates that were fixed up by * moving existing records */ -#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_MOVE 1112 +#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_MOVE 1109 /*! * cache: history store table out-of-order updates that were fixed up * during insertion */ -#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_INSERT 1113 +#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_INSERT 1110 /*! cache: history store table reads */ -#define WT_STAT_CONN_CACHE_HS_READ 1114 +#define WT_STAT_CONN_CACHE_HS_READ 1111 /*! cache: history store table reads missed */ -#define WT_STAT_CONN_CACHE_HS_READ_MISS 1115 +#define WT_STAT_CONN_CACHE_HS_READ_MISS 1112 /*! cache: history store table reads requiring squashed modifies */ -#define WT_STAT_CONN_CACHE_HS_READ_SQUASH 1116 -/*! cache: history store table remove calls due to key truncation */ -#define WT_STAT_CONN_CACHE_HS_REMOVE_KEY_TRUNCATE 1117 +#define WT_STAT_CONN_CACHE_HS_READ_SQUASH 1113 +/*! + * cache: history store table truncation by rollback to stable to remove + * an unstable update + */ +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_RTS_UNSTABLE 1114 +/*! + * cache: history store table truncation by rollback to stable to remove + * an update + */ +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_RTS 1115 +/*! + * cache: history store table truncation due to mixed timestamps that + * returned restart + */ +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_MIX_TS_RESTART 1116 +/*! cache: history store table truncation to remove an update */ +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE 1117 +/*! + * cache: history store table truncation to remove range of updates due + * to key being removed from the data page during reconciliation + */ +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_ONPAGE_REMOVAL 1118 +/*! + * cache: history store table truncation to remove range of updates due + * to mixed timestamps + */ +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_MIX_TS 1119 /*! cache: history store table writes requiring squashed modifies */ -#define WT_STAT_CONN_CACHE_HS_WRITE_SQUASH 1118 +#define WT_STAT_CONN_CACHE_HS_WRITE_SQUASH 1120 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1119 +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1121 /*! cache: in-memory page splits */ -#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1120 +#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1122 /*! cache: internal pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1121 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1123 /*! cache: internal pages queued for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_QUEUED 1122 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_QUEUED 1124 /*! cache: internal pages seen by eviction walk */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_SEEN 1123 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_SEEN 1125 /*! cache: internal pages seen by eviction walk that are already queued */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_ALREADY_QUEUED 1124 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL_PAGES_ALREADY_QUEUED 1126 /*! cache: internal pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1125 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1127 /*! cache: leaf pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1126 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1128 /*! cache: maximum bytes configured */ -#define WT_STAT_CONN_CACHE_BYTES_MAX 1127 +#define WT_STAT_CONN_CACHE_BYTES_MAX 1129 /*! cache: maximum page size at eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1128 +#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1130 /*! cache: modified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1129 +#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1131 /*! cache: modified pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1130 +#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1132 /*! cache: operations timed out waiting for space in cache */ -#define WT_STAT_CONN_CACHE_TIMED_OUT_OPS 1131 +#define WT_STAT_CONN_CACHE_TIMED_OUT_OPS 1133 /*! cache: overflow pages read into cache */ -#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1132 +#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1134 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1133 +#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1135 /*! cache: page written requiring history store records */ -#define WT_STAT_CONN_CACHE_WRITE_HS 1134 +#define WT_STAT_CONN_CACHE_WRITE_HS 1136 /*! cache: pages currently held in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_INUSE 1135 +#define WT_STAT_CONN_CACHE_PAGES_INUSE 1137 /*! cache: pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP 1136 +#define WT_STAT_CONN_CACHE_EVICTION_APP 1138 /*! cache: pages queued for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1137 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1139 /*! cache: pages queued for eviction post lru sorting */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_POST_LRU 1138 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_POST_LRU 1140 /*! cache: pages queued for urgent eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1139 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1141 /*! cache: pages queued for urgent eviction during walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1140 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1142 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1141 +#define WT_STAT_CONN_CACHE_READ 1143 /*! cache: pages read into cache after truncate */ -#define WT_STAT_CONN_CACHE_READ_DELETED 1142 +#define WT_STAT_CONN_CACHE_READ_DELETED 1144 /*! cache: pages read into cache after truncate in prepare state */ -#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1143 +#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1145 /*! cache: pages requested from the cache */ -#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1144 +#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1146 /*! cache: pages seen by eviction walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1145 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1147 /*! cache: pages seen by eviction walk that are already queued */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_ALREADY_QUEUED 1146 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_ALREADY_QUEUED 1148 /*! cache: pages selected for eviction unable to be evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1147 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1149 /*! * 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 1148 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_PARENT_HAS_OVERFLOW_ITEMS 1150 /*! * 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 1149 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_ACTIVE_CHILDREN_ON_AN_INTERNAL_PAGE 1151 /*! * cache: pages selected for eviction unable to be evicted because of * failure in reconciliation */ -#define WT_STAT_CONN_CACHE_EVICTION_FAIL_IN_RECONCILIATION 1150 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL_IN_RECONCILIATION 1152 /*! cache: pages walked for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK 1151 +#define WT_STAT_CONN_CACHE_EVICTION_WALK 1153 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1152 +#define WT_STAT_CONN_CACHE_WRITE 1154 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1153 +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1155 /*! cache: percentage overhead */ -#define WT_STAT_CONN_CACHE_OVERHEAD 1154 +#define WT_STAT_CONN_CACHE_OVERHEAD 1156 /*! cache: tracked bytes belonging to internal pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1155 +#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1157 /*! cache: tracked bytes belonging to leaf pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_LEAF 1156 +#define WT_STAT_CONN_CACHE_BYTES_LEAF 1158 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1157 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1159 /*! cache: tracked dirty pages in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1158 +#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1160 /*! cache: unmodified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1159 +#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1161 /*! capacity: background fsync file handles considered */ -#define WT_STAT_CONN_FSYNC_ALL_FH_TOTAL 1160 +#define WT_STAT_CONN_FSYNC_ALL_FH_TOTAL 1162 /*! capacity: background fsync file handles synced */ -#define WT_STAT_CONN_FSYNC_ALL_FH 1161 +#define WT_STAT_CONN_FSYNC_ALL_FH 1163 /*! capacity: background fsync time (msecs) */ -#define WT_STAT_CONN_FSYNC_ALL_TIME 1162 +#define WT_STAT_CONN_FSYNC_ALL_TIME 1164 /*! capacity: bytes read */ -#define WT_STAT_CONN_CAPACITY_BYTES_READ 1163 +#define WT_STAT_CONN_CAPACITY_BYTES_READ 1165 /*! capacity: bytes written for checkpoint */ -#define WT_STAT_CONN_CAPACITY_BYTES_CKPT 1164 +#define WT_STAT_CONN_CAPACITY_BYTES_CKPT 1166 /*! capacity: bytes written for eviction */ -#define WT_STAT_CONN_CAPACITY_BYTES_EVICT 1165 +#define WT_STAT_CONN_CAPACITY_BYTES_EVICT 1167 /*! capacity: bytes written for log */ -#define WT_STAT_CONN_CAPACITY_BYTES_LOG 1166 +#define WT_STAT_CONN_CAPACITY_BYTES_LOG 1168 /*! capacity: bytes written total */ -#define WT_STAT_CONN_CAPACITY_BYTES_WRITTEN 1167 +#define WT_STAT_CONN_CAPACITY_BYTES_WRITTEN 1169 /*! capacity: threshold to call fsync */ -#define WT_STAT_CONN_CAPACITY_THRESHOLD 1168 +#define WT_STAT_CONN_CAPACITY_THRESHOLD 1170 /*! capacity: time waiting due to total capacity (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_TOTAL 1169 +#define WT_STAT_CONN_CAPACITY_TIME_TOTAL 1171 /*! capacity: time waiting during checkpoint (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_CKPT 1170 +#define WT_STAT_CONN_CAPACITY_TIME_CKPT 1172 /*! capacity: time waiting during eviction (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_EVICT 1171 +#define WT_STAT_CONN_CAPACITY_TIME_EVICT 1173 /*! capacity: time waiting during logging (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_LOG 1172 +#define WT_STAT_CONN_CAPACITY_TIME_LOG 1174 /*! capacity: time waiting during read (usecs) */ -#define WT_STAT_CONN_CAPACITY_TIME_READ 1173 +#define WT_STAT_CONN_CAPACITY_TIME_READ 1175 /*! checkpoint-cleanup: pages added for eviction */ -#define WT_STAT_CONN_CC_PAGES_EVICT 1174 +#define WT_STAT_CONN_CC_PAGES_EVICT 1176 /*! checkpoint-cleanup: pages removed */ -#define WT_STAT_CONN_CC_PAGES_REMOVED 1175 +#define WT_STAT_CONN_CC_PAGES_REMOVED 1177 /*! checkpoint-cleanup: pages skipped during tree walk */ -#define WT_STAT_CONN_CC_PAGES_WALK_SKIPPED 1176 +#define WT_STAT_CONN_CC_PAGES_WALK_SKIPPED 1178 /*! checkpoint-cleanup: pages visited */ -#define WT_STAT_CONN_CC_PAGES_VISITED 1177 +#define WT_STAT_CONN_CC_PAGES_VISITED 1179 /*! connection: auto adjusting condition resets */ -#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1178 +#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1180 /*! connection: auto adjusting condition wait calls */ -#define WT_STAT_CONN_COND_AUTO_WAIT 1179 +#define WT_STAT_CONN_COND_AUTO_WAIT 1181 /*! * connection: auto adjusting condition wait raced to update timeout and * skipped updating */ -#define WT_STAT_CONN_COND_AUTO_WAIT_SKIPPED 1180 +#define WT_STAT_CONN_COND_AUTO_WAIT_SKIPPED 1182 /*! connection: detected system time went backwards */ -#define WT_STAT_CONN_TIME_TRAVEL 1181 +#define WT_STAT_CONN_TIME_TRAVEL 1183 /*! connection: files currently open */ -#define WT_STAT_CONN_FILE_OPEN 1182 +#define WT_STAT_CONN_FILE_OPEN 1184 /*! connection: memory allocations */ -#define WT_STAT_CONN_MEMORY_ALLOCATION 1183 +#define WT_STAT_CONN_MEMORY_ALLOCATION 1185 /*! connection: memory frees */ -#define WT_STAT_CONN_MEMORY_FREE 1184 +#define WT_STAT_CONN_MEMORY_FREE 1186 /*! connection: memory re-allocations */ -#define WT_STAT_CONN_MEMORY_GROW 1185 +#define WT_STAT_CONN_MEMORY_GROW 1187 /*! connection: pthread mutex condition wait calls */ -#define WT_STAT_CONN_COND_WAIT 1186 +#define WT_STAT_CONN_COND_WAIT 1188 /*! connection: pthread mutex shared lock read-lock calls */ -#define WT_STAT_CONN_RWLOCK_READ 1187 +#define WT_STAT_CONN_RWLOCK_READ 1189 /*! connection: pthread mutex shared lock write-lock calls */ -#define WT_STAT_CONN_RWLOCK_WRITE 1188 +#define WT_STAT_CONN_RWLOCK_WRITE 1190 /*! connection: total fsync I/Os */ -#define WT_STAT_CONN_FSYNC_IO 1189 +#define WT_STAT_CONN_FSYNC_IO 1191 /*! connection: total read I/Os */ -#define WT_STAT_CONN_READ_IO 1190 +#define WT_STAT_CONN_READ_IO 1192 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1191 +#define WT_STAT_CONN_WRITE_IO 1193 /*! cursor: Total number of entries skipped by cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT_SKIP_TOTAL 1192 +#define WT_STAT_CONN_CURSOR_NEXT_SKIP_TOTAL 1194 /*! cursor: Total number of entries skipped by cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV_SKIP_TOTAL 1193 +#define WT_STAT_CONN_CURSOR_PREV_SKIP_TOTAL 1195 /*! * cursor: Total number of entries skipped to position the history store * cursor */ -#define WT_STAT_CONN_CURSOR_SKIP_HS_CUR_POSITION 1194 +#define WT_STAT_CONN_CURSOR_SKIP_HS_CUR_POSITION 1196 /*! cursor: cached cursor count */ -#define WT_STAT_CONN_CURSOR_CACHED_COUNT 1195 +#define WT_STAT_CONN_CURSOR_CACHED_COUNT 1197 /*! cursor: cursor bulk loaded cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT_BULK 1196 +#define WT_STAT_CONN_CURSOR_INSERT_BULK 1198 /*! cursor: cursor close calls that result in cache */ -#define WT_STAT_CONN_CURSOR_CACHE 1197 +#define WT_STAT_CONN_CURSOR_CACHE 1199 /*! cursor: cursor create calls */ -#define WT_STAT_CONN_CURSOR_CREATE 1198 +#define WT_STAT_CONN_CURSOR_CREATE 1200 /*! cursor: cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT 1199 +#define WT_STAT_CONN_CURSOR_INSERT 1201 /*! cursor: cursor insert key and value bytes */ -#define WT_STAT_CONN_CURSOR_INSERT_BYTES 1200 +#define WT_STAT_CONN_CURSOR_INSERT_BYTES 1202 /*! cursor: cursor modify calls */ -#define WT_STAT_CONN_CURSOR_MODIFY 1201 +#define WT_STAT_CONN_CURSOR_MODIFY 1203 /*! cursor: cursor modify key and value bytes affected */ -#define WT_STAT_CONN_CURSOR_MODIFY_BYTES 1202 +#define WT_STAT_CONN_CURSOR_MODIFY_BYTES 1204 /*! cursor: cursor modify value bytes modified */ -#define WT_STAT_CONN_CURSOR_MODIFY_BYTES_TOUCH 1203 +#define WT_STAT_CONN_CURSOR_MODIFY_BYTES_TOUCH 1205 /*! cursor: cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT 1204 +#define WT_STAT_CONN_CURSOR_NEXT 1206 /*! * cursor: cursor next calls that skip greater than or equal to 100 * entries */ -#define WT_STAT_CONN_CURSOR_NEXT_SKIP_GE_100 1205 +#define WT_STAT_CONN_CURSOR_NEXT_SKIP_GE_100 1207 /*! cursor: cursor next calls that skip less than 100 entries */ -#define WT_STAT_CONN_CURSOR_NEXT_SKIP_LT_100 1206 +#define WT_STAT_CONN_CURSOR_NEXT_SKIP_LT_100 1208 /*! cursor: cursor operation restarted */ -#define WT_STAT_CONN_CURSOR_RESTART 1207 +#define WT_STAT_CONN_CURSOR_RESTART 1209 /*! cursor: cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV 1208 +#define WT_STAT_CONN_CURSOR_PREV 1210 /*! * cursor: cursor prev calls that skip due to a globally visible history * store tombstone */ -#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE 1209 +#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE 1211 /*! * cursor: cursor prev calls that skip due to a globally visible history * store tombstone in rollback to stable */ -#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE_RTS 1210 +#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE_RTS 1212 /*! * cursor: cursor prev calls that skip greater than or equal to 100 * entries */ -#define WT_STAT_CONN_CURSOR_PREV_SKIP_GE_100 1211 +#define WT_STAT_CONN_CURSOR_PREV_SKIP_GE_100 1213 /*! cursor: cursor prev calls that skip less than 100 entries */ -#define WT_STAT_CONN_CURSOR_PREV_SKIP_LT_100 1212 +#define WT_STAT_CONN_CURSOR_PREV_SKIP_LT_100 1214 /*! cursor: cursor remove calls */ -#define WT_STAT_CONN_CURSOR_REMOVE 1213 +#define WT_STAT_CONN_CURSOR_REMOVE 1215 /*! cursor: cursor remove key bytes removed */ -#define WT_STAT_CONN_CURSOR_REMOVE_BYTES 1214 +#define WT_STAT_CONN_CURSOR_REMOVE_BYTES 1216 /*! cursor: cursor reserve calls */ -#define WT_STAT_CONN_CURSOR_RESERVE 1215 +#define WT_STAT_CONN_CURSOR_RESERVE 1217 /*! cursor: cursor reset calls */ -#define WT_STAT_CONN_CURSOR_RESET 1216 +#define WT_STAT_CONN_CURSOR_RESET 1218 /*! cursor: cursor search calls */ -#define WT_STAT_CONN_CURSOR_SEARCH 1217 +#define WT_STAT_CONN_CURSOR_SEARCH 1219 /*! cursor: cursor search history store calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_HS 1218 +#define WT_STAT_CONN_CURSOR_SEARCH_HS 1220 /*! cursor: cursor search near calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1219 +#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1221 /*! cursor: cursor sweep buckets */ -#define WT_STAT_CONN_CURSOR_SWEEP_BUCKETS 1220 +#define WT_STAT_CONN_CURSOR_SWEEP_BUCKETS 1222 /*! cursor: cursor sweep cursors closed */ -#define WT_STAT_CONN_CURSOR_SWEEP_CLOSED 1221 +#define WT_STAT_CONN_CURSOR_SWEEP_CLOSED 1223 /*! cursor: cursor sweep cursors examined */ -#define WT_STAT_CONN_CURSOR_SWEEP_EXAMINED 1222 +#define WT_STAT_CONN_CURSOR_SWEEP_EXAMINED 1224 /*! cursor: cursor sweeps */ -#define WT_STAT_CONN_CURSOR_SWEEP 1223 +#define WT_STAT_CONN_CURSOR_SWEEP 1225 /*! cursor: cursor truncate calls */ -#define WT_STAT_CONN_CURSOR_TRUNCATE 1224 +#define WT_STAT_CONN_CURSOR_TRUNCATE 1226 /*! cursor: cursor update calls */ -#define WT_STAT_CONN_CURSOR_UPDATE 1225 +#define WT_STAT_CONN_CURSOR_UPDATE 1227 /*! cursor: cursor update key and value bytes */ -#define WT_STAT_CONN_CURSOR_UPDATE_BYTES 1226 +#define WT_STAT_CONN_CURSOR_UPDATE_BYTES 1228 /*! cursor: cursor update value size change */ -#define WT_STAT_CONN_CURSOR_UPDATE_BYTES_CHANGED 1227 +#define WT_STAT_CONN_CURSOR_UPDATE_BYTES_CHANGED 1229 /*! cursor: cursors reused from cache */ -#define WT_STAT_CONN_CURSOR_REOPEN 1228 +#define WT_STAT_CONN_CURSOR_REOPEN 1230 /*! cursor: open cursor count */ -#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1229 +#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1231 /*! data-handle: connection data handle size */ -#define WT_STAT_CONN_DH_CONN_HANDLE_SIZE 1230 +#define WT_STAT_CONN_DH_CONN_HANDLE_SIZE 1232 /*! data-handle: connection data handles currently active */ -#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1231 +#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1233 /*! data-handle: connection sweep candidate became referenced */ -#define WT_STAT_CONN_DH_SWEEP_REF 1232 +#define WT_STAT_CONN_DH_SWEEP_REF 1234 /*! data-handle: connection sweep dhandles closed */ -#define WT_STAT_CONN_DH_SWEEP_CLOSE 1233 +#define WT_STAT_CONN_DH_SWEEP_CLOSE 1235 /*! data-handle: connection sweep dhandles removed from hash list */ -#define WT_STAT_CONN_DH_SWEEP_REMOVE 1234 +#define WT_STAT_CONN_DH_SWEEP_REMOVE 1236 /*! data-handle: connection sweep time-of-death sets */ -#define WT_STAT_CONN_DH_SWEEP_TOD 1235 +#define WT_STAT_CONN_DH_SWEEP_TOD 1237 /*! data-handle: connection sweeps */ -#define WT_STAT_CONN_DH_SWEEPS 1236 +#define WT_STAT_CONN_DH_SWEEPS 1238 /*! data-handle: session dhandles swept */ -#define WT_STAT_CONN_DH_SESSION_HANDLES 1237 +#define WT_STAT_CONN_DH_SESSION_HANDLES 1239 /*! data-handle: session sweep attempts */ -#define WT_STAT_CONN_DH_SESSION_SWEEPS 1238 +#define WT_STAT_CONN_DH_SESSION_SWEEPS 1240 /*! lock: checkpoint lock acquisitions */ -#define WT_STAT_CONN_LOCK_CHECKPOINT_COUNT 1239 +#define WT_STAT_CONN_LOCK_CHECKPOINT_COUNT 1241 /*! lock: checkpoint lock application thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_APPLICATION 1240 +#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_APPLICATION 1242 /*! lock: checkpoint lock internal thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_INTERNAL 1241 +#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_INTERNAL 1243 /*! lock: dhandle lock application thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_APPLICATION 1242 +#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_APPLICATION 1244 /*! lock: dhandle lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_INTERNAL 1243 +#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_INTERNAL 1245 /*! lock: dhandle read lock acquisitions */ -#define WT_STAT_CONN_LOCK_DHANDLE_READ_COUNT 1244 +#define WT_STAT_CONN_LOCK_DHANDLE_READ_COUNT 1246 /*! lock: dhandle write lock acquisitions */ -#define WT_STAT_CONN_LOCK_DHANDLE_WRITE_COUNT 1245 +#define WT_STAT_CONN_LOCK_DHANDLE_WRITE_COUNT 1247 /*! * lock: durable timestamp queue lock application thread time waiting * (usecs) */ -#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_APPLICATION 1246 +#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_APPLICATION 1248 /*! * lock: durable timestamp queue lock internal thread time waiting * (usecs) */ -#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_INTERNAL 1247 +#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_INTERNAL 1249 /*! lock: durable timestamp queue read lock acquisitions */ -#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_READ_COUNT 1248 +#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_READ_COUNT 1250 /*! lock: durable timestamp queue write lock acquisitions */ -#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WRITE_COUNT 1249 +#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WRITE_COUNT 1251 /*! lock: metadata lock acquisitions */ -#define WT_STAT_CONN_LOCK_METADATA_COUNT 1250 +#define WT_STAT_CONN_LOCK_METADATA_COUNT 1252 /*! lock: metadata lock application thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_METADATA_WAIT_APPLICATION 1251 +#define WT_STAT_CONN_LOCK_METADATA_WAIT_APPLICATION 1253 /*! lock: metadata lock internal thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_METADATA_WAIT_INTERNAL 1252 +#define WT_STAT_CONN_LOCK_METADATA_WAIT_INTERNAL 1254 /*! * lock: read timestamp queue lock application thread time waiting * (usecs) */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_APPLICATION 1253 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_APPLICATION 1255 /*! lock: read timestamp queue lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_INTERNAL 1254 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_INTERNAL 1256 /*! lock: read timestamp queue read lock acquisitions */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_READ_COUNT 1255 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_READ_COUNT 1257 /*! lock: read timestamp queue write lock acquisitions */ -#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WRITE_COUNT 1256 +#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WRITE_COUNT 1258 /*! lock: schema lock acquisitions */ -#define WT_STAT_CONN_LOCK_SCHEMA_COUNT 1257 +#define WT_STAT_CONN_LOCK_SCHEMA_COUNT 1259 /*! lock: schema lock application thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_APPLICATION 1258 +#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_APPLICATION 1260 /*! lock: schema lock internal thread wait time (usecs) */ -#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_INTERNAL 1259 +#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_INTERNAL 1261 /*! * lock: table lock application thread time waiting for the table lock * (usecs) */ -#define WT_STAT_CONN_LOCK_TABLE_WAIT_APPLICATION 1260 +#define WT_STAT_CONN_LOCK_TABLE_WAIT_APPLICATION 1262 /*! * lock: table lock internal thread time waiting for the table lock * (usecs) */ -#define WT_STAT_CONN_LOCK_TABLE_WAIT_INTERNAL 1261 +#define WT_STAT_CONN_LOCK_TABLE_WAIT_INTERNAL 1263 /*! lock: table read lock acquisitions */ -#define WT_STAT_CONN_LOCK_TABLE_READ_COUNT 1262 +#define WT_STAT_CONN_LOCK_TABLE_READ_COUNT 1264 /*! lock: table write lock acquisitions */ -#define WT_STAT_CONN_LOCK_TABLE_WRITE_COUNT 1263 +#define WT_STAT_CONN_LOCK_TABLE_WRITE_COUNT 1265 /*! lock: txn global lock application thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_APPLICATION 1264 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_APPLICATION 1266 /*! lock: txn global lock internal thread time waiting (usecs) */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_INTERNAL 1265 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_INTERNAL 1267 /*! lock: txn global read lock acquisitions */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_READ_COUNT 1266 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_READ_COUNT 1268 /*! lock: txn global write lock acquisitions */ -#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WRITE_COUNT 1267 +#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WRITE_COUNT 1269 /*! log: busy returns attempting to switch slots */ -#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1268 +#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1270 /*! log: force archive time sleeping (usecs) */ -#define WT_STAT_CONN_LOG_FORCE_ARCHIVE_SLEEP 1269 +#define WT_STAT_CONN_LOG_FORCE_ARCHIVE_SLEEP 1271 /*! log: log bytes of payload data */ -#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1270 +#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1272 /*! log: log bytes written */ -#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1271 +#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1273 /*! log: log files manually zero-filled */ -#define WT_STAT_CONN_LOG_ZERO_FILLS 1272 +#define WT_STAT_CONN_LOG_ZERO_FILLS 1274 /*! log: log flush operations */ -#define WT_STAT_CONN_LOG_FLUSH 1273 +#define WT_STAT_CONN_LOG_FLUSH 1275 /*! log: log force write operations */ -#define WT_STAT_CONN_LOG_FORCE_WRITE 1274 +#define WT_STAT_CONN_LOG_FORCE_WRITE 1276 /*! log: log force write operations skipped */ -#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1275 +#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1277 /*! log: log records compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1276 +#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1278 /*! log: log records not compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1277 +#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1279 /*! log: log records too small to compress */ -#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1278 +#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1280 /*! log: log release advances write LSN */ -#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1279 +#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1281 /*! log: log scan operations */ -#define WT_STAT_CONN_LOG_SCANS 1280 +#define WT_STAT_CONN_LOG_SCANS 1282 /*! log: log scan records requiring two reads */ -#define WT_STAT_CONN_LOG_SCAN_REREADS 1281 +#define WT_STAT_CONN_LOG_SCAN_REREADS 1283 /*! log: log server thread advances write LSN */ -#define WT_STAT_CONN_LOG_WRITE_LSN 1282 +#define WT_STAT_CONN_LOG_WRITE_LSN 1284 /*! log: log server thread write LSN walk skipped */ -#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1283 +#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1285 /*! log: log sync operations */ -#define WT_STAT_CONN_LOG_SYNC 1284 +#define WT_STAT_CONN_LOG_SYNC 1286 /*! log: log sync time duration (usecs) */ -#define WT_STAT_CONN_LOG_SYNC_DURATION 1285 +#define WT_STAT_CONN_LOG_SYNC_DURATION 1287 /*! log: log sync_dir operations */ -#define WT_STAT_CONN_LOG_SYNC_DIR 1286 +#define WT_STAT_CONN_LOG_SYNC_DIR 1288 /*! log: log sync_dir time duration (usecs) */ -#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1287 +#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1289 /*! log: log write operations */ -#define WT_STAT_CONN_LOG_WRITES 1288 +#define WT_STAT_CONN_LOG_WRITES 1290 /*! log: logging bytes consolidated */ -#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1289 +#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1291 /*! log: maximum log file size */ -#define WT_STAT_CONN_LOG_MAX_FILESIZE 1290 +#define WT_STAT_CONN_LOG_MAX_FILESIZE 1292 /*! log: number of pre-allocated log files to create */ -#define WT_STAT_CONN_LOG_PREALLOC_MAX 1291 +#define WT_STAT_CONN_LOG_PREALLOC_MAX 1293 /*! log: pre-allocated log files not ready and missed */ -#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1292 +#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1294 /*! log: pre-allocated log files prepared */ -#define WT_STAT_CONN_LOG_PREALLOC_FILES 1293 +#define WT_STAT_CONN_LOG_PREALLOC_FILES 1295 /*! log: pre-allocated log files used */ -#define WT_STAT_CONN_LOG_PREALLOC_USED 1294 +#define WT_STAT_CONN_LOG_PREALLOC_USED 1296 /*! log: records processed by log scan */ -#define WT_STAT_CONN_LOG_SCAN_RECORDS 1295 +#define WT_STAT_CONN_LOG_SCAN_RECORDS 1297 /*! log: slot close lost race */ -#define WT_STAT_CONN_LOG_SLOT_CLOSE_RACE 1296 +#define WT_STAT_CONN_LOG_SLOT_CLOSE_RACE 1298 /*! log: slot close unbuffered waits */ -#define WT_STAT_CONN_LOG_SLOT_CLOSE_UNBUF 1297 +#define WT_STAT_CONN_LOG_SLOT_CLOSE_UNBUF 1299 /*! log: slot closures */ -#define WT_STAT_CONN_LOG_SLOT_CLOSES 1298 +#define WT_STAT_CONN_LOG_SLOT_CLOSES 1300 /*! log: slot join atomic update races */ -#define WT_STAT_CONN_LOG_SLOT_RACES 1299 +#define WT_STAT_CONN_LOG_SLOT_RACES 1301 /*! log: slot join calls atomic updates raced */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_RACE 1300 +#define WT_STAT_CONN_LOG_SLOT_YIELD_RACE 1302 /*! log: slot join calls did not yield */ -#define WT_STAT_CONN_LOG_SLOT_IMMEDIATE 1301 +#define WT_STAT_CONN_LOG_SLOT_IMMEDIATE 1303 /*! log: slot join calls found active slot closed */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_CLOSE 1302 +#define WT_STAT_CONN_LOG_SLOT_YIELD_CLOSE 1304 /*! log: slot join calls slept */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_SLEEP 1303 +#define WT_STAT_CONN_LOG_SLOT_YIELD_SLEEP 1305 /*! log: slot join calls yielded */ -#define WT_STAT_CONN_LOG_SLOT_YIELD 1304 +#define WT_STAT_CONN_LOG_SLOT_YIELD 1306 /*! log: slot join found active slot closed */ -#define WT_STAT_CONN_LOG_SLOT_ACTIVE_CLOSED 1305 +#define WT_STAT_CONN_LOG_SLOT_ACTIVE_CLOSED 1307 /*! log: slot joins yield time (usecs) */ -#define WT_STAT_CONN_LOG_SLOT_YIELD_DURATION 1306 +#define WT_STAT_CONN_LOG_SLOT_YIELD_DURATION 1308 /*! log: slot transitions unable to find free slot */ -#define WT_STAT_CONN_LOG_SLOT_NO_FREE_SLOTS 1307 +#define WT_STAT_CONN_LOG_SLOT_NO_FREE_SLOTS 1309 /*! log: slot unbuffered writes */ -#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1308 +#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1310 /*! log: total in-memory size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_MEM 1309 +#define WT_STAT_CONN_LOG_COMPRESS_MEM 1311 /*! log: total log buffer size */ -#define WT_STAT_CONN_LOG_BUFFER_SIZE 1310 +#define WT_STAT_CONN_LOG_BUFFER_SIZE 1312 /*! log: total size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_LEN 1311 +#define WT_STAT_CONN_LOG_COMPRESS_LEN 1313 /*! log: written slots coalesced */ -#define WT_STAT_CONN_LOG_SLOT_COALESCED 1312 +#define WT_STAT_CONN_LOG_SLOT_COALESCED 1314 /*! log: yields waiting for previous log file close */ -#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1313 +#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1315 /*! perf: file system read latency histogram (bucket 1) - 10-49ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT50 1314 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT50 1316 /*! perf: file system read latency histogram (bucket 2) - 50-99ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT100 1315 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT100 1317 /*! perf: file system read latency histogram (bucket 3) - 100-249ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT250 1316 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT250 1318 /*! perf: file system read latency histogram (bucket 4) - 250-499ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT500 1317 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT500 1319 /*! perf: file system read latency histogram (bucket 5) - 500-999ms */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT1000 1318 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT1000 1320 /*! perf: file system read latency histogram (bucket 6) - 1000ms+ */ -#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_GT1000 1319 +#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_GT1000 1321 /*! perf: file system write latency histogram (bucket 1) - 10-49ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT50 1320 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT50 1322 /*! perf: file system write latency histogram (bucket 2) - 50-99ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT100 1321 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT100 1323 /*! perf: file system write latency histogram (bucket 3) - 100-249ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT250 1322 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT250 1324 /*! perf: file system write latency histogram (bucket 4) - 250-499ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT500 1323 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT500 1325 /*! perf: file system write latency histogram (bucket 5) - 500-999ms */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT1000 1324 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT1000 1326 /*! perf: file system write latency histogram (bucket 6) - 1000ms+ */ -#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_GT1000 1325 +#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_GT1000 1327 /*! perf: operation read latency histogram (bucket 1) - 100-249us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT250 1326 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT250 1328 /*! perf: operation read latency histogram (bucket 2) - 250-499us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT500 1327 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT500 1329 /*! perf: operation read latency histogram (bucket 3) - 500-999us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT1000 1328 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT1000 1330 /*! perf: operation read latency histogram (bucket 4) - 1000-9999us */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT10000 1329 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT10000 1331 /*! perf: operation read latency histogram (bucket 5) - 10000us+ */ -#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_GT10000 1330 +#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_GT10000 1332 /*! perf: operation write latency histogram (bucket 1) - 100-249us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT250 1331 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT250 1333 /*! perf: operation write latency histogram (bucket 2) - 250-499us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT500 1332 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT500 1334 /*! perf: operation write latency histogram (bucket 3) - 500-999us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT1000 1333 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT1000 1335 /*! perf: operation write latency histogram (bucket 4) - 1000-9999us */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT10000 1334 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT10000 1336 /*! perf: operation write latency histogram (bucket 5) - 10000us+ */ -#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_GT10000 1335 +#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_GT10000 1337 /*! reconciliation: approximate byte size of timestamps in pages written */ -#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TS 1336 +#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TS 1338 /*! * reconciliation: approximate byte size of transaction IDs in pages * written */ -#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TXN 1337 +#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TXN 1339 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1338 +#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1340 /*! reconciliation: maximum seconds spent in a reconciliation call */ -#define WT_STAT_CONN_REC_MAXIMUM_SECONDS 1339 +#define WT_STAT_CONN_REC_MAXIMUM_SECONDS 1341 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1340 +#define WT_STAT_CONN_REC_PAGES 1342 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1341 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1343 /*! * reconciliation: page reconciliation calls that resulted in values with * prepared transaction metadata */ -#define WT_STAT_CONN_REC_PAGES_WITH_PREPARE 1342 +#define WT_STAT_CONN_REC_PAGES_WITH_PREPARE 1344 /*! * reconciliation: page reconciliation calls that resulted in values with * timestamps */ -#define WT_STAT_CONN_REC_PAGES_WITH_TS 1343 +#define WT_STAT_CONN_REC_PAGES_WITH_TS 1345 /*! * reconciliation: page reconciliation calls that resulted in values with * transaction ids */ -#define WT_STAT_CONN_REC_PAGES_WITH_TXN 1344 +#define WT_STAT_CONN_REC_PAGES_WITH_TXN 1346 /*! reconciliation: pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE 1345 +#define WT_STAT_CONN_REC_PAGE_DELETE 1347 /*! * reconciliation: pages written including an aggregated newest start * durable timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 1346 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 1348 /*! * reconciliation: pages written including an aggregated newest stop * durable timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 1347 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 1349 /*! * reconciliation: pages written including an aggregated newest stop * timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TS 1348 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TS 1350 /*! * reconciliation: pages written including an aggregated newest stop * transaction ID */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TXN 1349 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TXN 1351 /*! * reconciliation: pages written including an aggregated oldest start * timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TS 1350 +#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TS 1352 /*! * reconciliation: pages written including an aggregated oldest start * transaction ID */ -#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TXN 1351 +#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TXN 1353 /*! reconciliation: pages written including an aggregated prepare */ -#define WT_STAT_CONN_REC_TIME_AGGR_PREPARED 1352 +#define WT_STAT_CONN_REC_TIME_AGGR_PREPARED 1354 /*! reconciliation: pages written including at least one prepare state */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_PREPARED 1353 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_PREPARED 1355 /*! * reconciliation: pages written including at least one start durable * timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 1354 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 1356 /*! reconciliation: pages written including at least one start timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TS 1355 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TS 1357 /*! * reconciliation: pages written including at least one start transaction * ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TXN 1356 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TXN 1358 /*! * reconciliation: pages written including at least one stop durable * timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 1357 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 1359 /*! reconciliation: pages written including at least one stop timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TS 1358 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TS 1360 /*! * reconciliation: pages written including at least one stop transaction * ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TXN 1359 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TXN 1361 /*! reconciliation: records written including a prepare state */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PREPARED 1360 +#define WT_STAT_CONN_REC_TIME_WINDOW_PREPARED 1362 /*! reconciliation: records written including a start durable timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_START_TS 1361 +#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_START_TS 1363 /*! reconciliation: records written including a start timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_START_TS 1362 +#define WT_STAT_CONN_REC_TIME_WINDOW_START_TS 1364 /*! reconciliation: records written including a start transaction ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_START_TXN 1363 +#define WT_STAT_CONN_REC_TIME_WINDOW_START_TXN 1365 /*! reconciliation: records written including a stop durable timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_STOP_TS 1364 +#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_STOP_TS 1366 /*! reconciliation: records written including a stop timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TS 1365 +#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TS 1367 /*! reconciliation: records written including a stop transaction ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TXN 1366 +#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TXN 1368 /*! reconciliation: split bytes currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1367 +#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1369 /*! reconciliation: split objects currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1368 +#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1370 /*! session: open session count */ -#define WT_STAT_CONN_SESSION_OPEN 1369 +#define WT_STAT_CONN_SESSION_OPEN 1371 /*! session: session query timestamp calls */ -#define WT_STAT_CONN_SESSION_QUERY_TS 1370 +#define WT_STAT_CONN_SESSION_QUERY_TS 1372 /*! session: table alter failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_ALTER_FAIL 1371 +#define WT_STAT_CONN_SESSION_TABLE_ALTER_FAIL 1373 /*! session: table alter successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_ALTER_SUCCESS 1372 +#define WT_STAT_CONN_SESSION_TABLE_ALTER_SUCCESS 1374 /*! session: table alter unchanged and skipped */ -#define WT_STAT_CONN_SESSION_TABLE_ALTER_SKIP 1373 +#define WT_STAT_CONN_SESSION_TABLE_ALTER_SKIP 1375 /*! session: table compact failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1374 +#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1376 /*! session: table compact successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1375 +#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1377 /*! session: table create failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1376 +#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1378 /*! session: table create successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1377 +#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1379 /*! session: table drop failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1378 +#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1380 /*! session: table drop successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1379 +#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1381 /*! session: table import failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_IMPORT_FAIL 1380 +#define WT_STAT_CONN_SESSION_TABLE_IMPORT_FAIL 1382 /*! session: table import successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_IMPORT_SUCCESS 1381 +#define WT_STAT_CONN_SESSION_TABLE_IMPORT_SUCCESS 1383 /*! session: table rebalance failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_FAIL 1382 +#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_FAIL 1384 /*! session: table rebalance successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_SUCCESS 1383 +#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_SUCCESS 1385 /*! session: table rename failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1384 +#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1386 /*! session: table rename successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1385 +#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1387 /*! session: table salvage failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1386 +#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1388 /*! session: table salvage successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1387 +#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1389 /*! session: table truncate failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1388 +#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1390 /*! session: table truncate successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1389 +#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1391 /*! session: table verify failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1390 +#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1392 /*! session: table verify successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1391 +#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1393 /*! thread-state: active filesystem fsync calls */ -#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1392 +#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1394 /*! thread-state: active filesystem read calls */ -#define WT_STAT_CONN_THREAD_READ_ACTIVE 1393 +#define WT_STAT_CONN_THREAD_READ_ACTIVE 1395 /*! thread-state: active filesystem write calls */ -#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1394 +#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1396 /*! thread-yield: application thread time evicting (usecs) */ -#define WT_STAT_CONN_APPLICATION_EVICT_TIME 1395 +#define WT_STAT_CONN_APPLICATION_EVICT_TIME 1397 /*! thread-yield: application thread time waiting for cache (usecs) */ -#define WT_STAT_CONN_APPLICATION_CACHE_TIME 1396 +#define WT_STAT_CONN_APPLICATION_CACHE_TIME 1398 /*! * thread-yield: connection close blocked waiting for transaction state * stabilization */ -#define WT_STAT_CONN_TXN_RELEASE_BLOCKED 1397 +#define WT_STAT_CONN_TXN_RELEASE_BLOCKED 1399 /*! thread-yield: connection close yielded for lsm manager shutdown */ -#define WT_STAT_CONN_CONN_CLOSE_BLOCKED_LSM 1398 +#define WT_STAT_CONN_CONN_CLOSE_BLOCKED_LSM 1400 /*! thread-yield: data handle lock yielded */ -#define WT_STAT_CONN_DHANDLE_LOCK_BLOCKED 1399 +#define WT_STAT_CONN_DHANDLE_LOCK_BLOCKED 1401 /*! * thread-yield: get reference for page index and slot time sleeping * (usecs) */ -#define WT_STAT_CONN_PAGE_INDEX_SLOT_REF_BLOCKED 1400 +#define WT_STAT_CONN_PAGE_INDEX_SLOT_REF_BLOCKED 1402 /*! thread-yield: log server sync yielded for log write */ -#define WT_STAT_CONN_LOG_SERVER_SYNC_BLOCKED 1401 +#define WT_STAT_CONN_LOG_SERVER_SYNC_BLOCKED 1403 /*! thread-yield: page access yielded due to prepare state change */ -#define WT_STAT_CONN_PREPARED_TRANSITION_BLOCKED_PAGE 1402 +#define WT_STAT_CONN_PREPARED_TRANSITION_BLOCKED_PAGE 1404 /*! thread-yield: page acquire busy blocked */ -#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1403 +#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1405 /*! thread-yield: page acquire eviction blocked */ -#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1404 +#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1406 /*! thread-yield: page acquire locked blocked */ -#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1405 +#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1407 /*! thread-yield: page acquire read blocked */ -#define WT_STAT_CONN_PAGE_READ_BLOCKED 1406 +#define WT_STAT_CONN_PAGE_READ_BLOCKED 1408 /*! thread-yield: page acquire time sleeping (usecs) */ -#define WT_STAT_CONN_PAGE_SLEEP 1407 +#define WT_STAT_CONN_PAGE_SLEEP 1409 /*! * thread-yield: page delete rollback time sleeping for state change * (usecs) */ -#define WT_STAT_CONN_PAGE_DEL_ROLLBACK_BLOCKED 1408 +#define WT_STAT_CONN_PAGE_DEL_ROLLBACK_BLOCKED 1410 /*! thread-yield: page reconciliation yielded due to child modification */ -#define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1409 +#define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1411 /*! transaction: Number of prepared updates */ -#define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1410 +#define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1412 /*! transaction: durable timestamp queue entries walked */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_WALKED 1411 +#define WT_STAT_CONN_TXN_DURABLE_QUEUE_WALKED 1413 /*! transaction: durable timestamp queue insert to empty */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_EMPTY 1412 +#define WT_STAT_CONN_TXN_DURABLE_QUEUE_EMPTY 1414 /*! transaction: durable timestamp queue inserts to head */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_HEAD 1413 +#define WT_STAT_CONN_TXN_DURABLE_QUEUE_HEAD 1415 /*! transaction: durable timestamp queue inserts total */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_INSERTS 1414 +#define WT_STAT_CONN_TXN_DURABLE_QUEUE_INSERTS 1416 /*! transaction: durable timestamp queue length */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_LEN 1415 +#define WT_STAT_CONN_TXN_DURABLE_QUEUE_LEN 1417 /*! transaction: prepared transactions */ -#define WT_STAT_CONN_TXN_PREPARE 1416 +#define WT_STAT_CONN_TXN_PREPARE 1418 /*! transaction: prepared transactions committed */ -#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1417 +#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1419 /*! transaction: prepared transactions currently active */ -#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1418 +#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1420 /*! transaction: prepared transactions rolled back */ -#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1419 +#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1421 /*! transaction: query timestamp calls */ -#define WT_STAT_CONN_TXN_QUERY_TS 1420 +#define WT_STAT_CONN_TXN_QUERY_TS 1422 +/*! transaction: race to read prepared update retry */ +#define WT_STAT_CONN_TXN_READ_RACE_PREPARE_UPDATE 1423 /*! transaction: read timestamp queue entries walked */ -#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1421 +#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1424 /*! transaction: read timestamp queue insert to empty */ -#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1422 +#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1425 /*! transaction: read timestamp queue inserts to head */ -#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1423 +#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1426 /*! transaction: read timestamp queue inserts total */ -#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1424 +#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1427 /*! transaction: read timestamp queue length */ -#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1425 +#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1428 /*! transaction: rollback to stable calls */ -#define WT_STAT_CONN_TXN_RTS 1426 +#define WT_STAT_CONN_TXN_RTS 1429 /*! * transaction: rollback to stable hs records with stop timestamps older * than newer records */ -#define WT_STAT_CONN_TXN_RTS_HS_STOP_OLDER_THAN_NEWER_START 1427 +#define WT_STAT_CONN_TXN_RTS_HS_STOP_OLDER_THAN_NEWER_START 1430 /*! transaction: rollback to stable keys removed */ -#define WT_STAT_CONN_TXN_RTS_KEYS_REMOVED 1428 +#define WT_STAT_CONN_TXN_RTS_KEYS_REMOVED 1431 /*! transaction: rollback to stable keys restored */ -#define WT_STAT_CONN_TXN_RTS_KEYS_RESTORED 1429 +#define WT_STAT_CONN_TXN_RTS_KEYS_RESTORED 1432 /*! transaction: rollback to stable pages visited */ -#define WT_STAT_CONN_TXN_RTS_PAGES_VISITED 1430 +#define WT_STAT_CONN_TXN_RTS_PAGES_VISITED 1433 /*! transaction: rollback to stable restored tombstones from history store */ -#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_TOMBSTONES 1431 +#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_TOMBSTONES 1434 /*! transaction: rollback to stable sweeping history store keys */ -#define WT_STAT_CONN_TXN_RTS_SWEEP_HS_KEYS 1432 +#define WT_STAT_CONN_TXN_RTS_SWEEP_HS_KEYS 1435 /*! transaction: rollback to stable tree walk skipping pages */ -#define WT_STAT_CONN_TXN_RTS_TREE_WALK_SKIP_PAGES 1433 +#define WT_STAT_CONN_TXN_RTS_TREE_WALK_SKIP_PAGES 1436 /*! transaction: rollback to stable updates aborted */ -#define WT_STAT_CONN_TXN_RTS_UPD_ABORTED 1434 +#define WT_STAT_CONN_TXN_RTS_UPD_ABORTED 1437 /*! transaction: rollback to stable updates removed from history store */ -#define WT_STAT_CONN_TXN_RTS_HS_REMOVED 1435 +#define WT_STAT_CONN_TXN_RTS_HS_REMOVED 1438 /*! transaction: set timestamp calls */ -#define WT_STAT_CONN_TXN_SET_TS 1436 +#define WT_STAT_CONN_TXN_SET_TS 1439 /*! transaction: set timestamp durable calls */ -#define WT_STAT_CONN_TXN_SET_TS_DURABLE 1437 +#define WT_STAT_CONN_TXN_SET_TS_DURABLE 1440 /*! transaction: set timestamp durable updates */ -#define WT_STAT_CONN_TXN_SET_TS_DURABLE_UPD 1438 +#define WT_STAT_CONN_TXN_SET_TS_DURABLE_UPD 1441 /*! transaction: set timestamp oldest calls */ -#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1439 +#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1442 /*! transaction: set timestamp oldest updates */ -#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1440 +#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1443 /*! transaction: set timestamp stable calls */ -#define WT_STAT_CONN_TXN_SET_TS_STABLE 1441 +#define WT_STAT_CONN_TXN_SET_TS_STABLE 1444 /*! transaction: set timestamp stable updates */ -#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1442 +#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1445 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1443 +#define WT_STAT_CONN_TXN_BEGIN 1446 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1444 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1447 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1445 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1448 /*! * transaction: transaction checkpoint history store file duration * (usecs) */ -#define WT_STAT_CONN_TXN_HS_CKPT_DURATION 1446 +#define WT_STAT_CONN_TXN_HS_CKPT_DURATION 1449 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1447 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1450 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1448 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1451 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1449 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1452 /*! transaction: transaction checkpoint prepare currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RUNNING 1450 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RUNNING 1453 /*! transaction: transaction checkpoint prepare max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MAX 1451 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MAX 1454 /*! transaction: transaction checkpoint prepare min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MIN 1452 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MIN 1455 /*! transaction: transaction checkpoint prepare most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RECENT 1453 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RECENT 1456 /*! transaction: transaction checkpoint prepare total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_TOTAL 1454 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_TOTAL 1457 /*! transaction: transaction checkpoint scrub dirty target */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1455 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1458 /*! transaction: transaction checkpoint scrub time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1456 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1459 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1457 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1460 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1458 +#define WT_STAT_CONN_TXN_CHECKPOINT 1461 /*! * transaction: transaction checkpoints skipped because database was * clean */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1459 +#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1462 /*! transaction: transaction failures due to history store */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1460 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1463 /*! * transaction: transaction fsync calls for checkpoint after allocating * the transaction ID */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1461 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1464 /*! * transaction: transaction fsync duration for checkpoint after * allocating the transaction ID (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1462 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1465 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1463 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1466 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1464 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1467 /*! transaction: transaction range of timestamps currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1465 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1468 /*! transaction: transaction range of timestamps pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1466 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1469 /*! * transaction: transaction range of timestamps pinned by the oldest * active read timestamp */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_READER 1467 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_READER 1470 /*! * transaction: transaction range of timestamps pinned by the oldest * timestamp */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1468 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1471 /*! transaction: transaction read timestamp of the oldest active reader */ -#define WT_STAT_CONN_TXN_TIMESTAMP_OLDEST_ACTIVE_READ 1469 +#define WT_STAT_CONN_TXN_TIMESTAMP_OLDEST_ACTIVE_READ 1472 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1470 +#define WT_STAT_CONN_TXN_SYNC 1473 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1471 +#define WT_STAT_CONN_TXN_COMMIT 1474 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1472 +#define WT_STAT_CONN_TXN_ROLLBACK 1475 /*! transaction: update conflicts */ -#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1473 +#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1476 /*! * @} @@ -6119,476 +6137,480 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_DSRC_BLOCK_MINOR 2021 /*! btree: btree checkpoint generation */ #define WT_STAT_DSRC_BTREE_CHECKPOINT_GENERATION 2022 +/*! btree: btree clean tree checkpoint expiration time */ +#define WT_STAT_DSRC_BTREE_CLEAN_CHECKPOINT_TIMER 2023 /*! * btree: column-store fixed-size leaf pages, only reported if tree_walk * or all statistics are enabled */ -#define WT_STAT_DSRC_BTREE_COLUMN_FIX 2023 +#define WT_STAT_DSRC_BTREE_COLUMN_FIX 2024 /*! * btree: column-store internal pages, only reported if tree_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_BTREE_COLUMN_INTERNAL 2024 +#define WT_STAT_DSRC_BTREE_COLUMN_INTERNAL 2025 /*! * btree: column-store variable-size RLE encoded values, only reported if * tree_walk or all statistics are enabled */ -#define WT_STAT_DSRC_BTREE_COLUMN_RLE 2025 +#define WT_STAT_DSRC_BTREE_COLUMN_RLE 2026 /*! * btree: column-store variable-size deleted values, only reported if * tree_walk or all statistics are enabled */ -#define WT_STAT_DSRC_BTREE_COLUMN_DELETED 2026 +#define WT_STAT_DSRC_BTREE_COLUMN_DELETED 2027 /*! * btree: column-store variable-size leaf pages, only reported if * tree_walk or all statistics are enabled */ -#define WT_STAT_DSRC_BTREE_COLUMN_VARIABLE 2027 +#define WT_STAT_DSRC_BTREE_COLUMN_VARIABLE 2028 /*! btree: fixed-record size */ -#define WT_STAT_DSRC_BTREE_FIXED_LEN 2028 +#define WT_STAT_DSRC_BTREE_FIXED_LEN 2029 /*! btree: maximum internal page key size */ -#define WT_STAT_DSRC_BTREE_MAXINTLKEY 2029 +#define WT_STAT_DSRC_BTREE_MAXINTLKEY 2030 /*! btree: maximum internal page size */ -#define WT_STAT_DSRC_BTREE_MAXINTLPAGE 2030 +#define WT_STAT_DSRC_BTREE_MAXINTLPAGE 2031 /*! btree: maximum leaf page key size */ -#define WT_STAT_DSRC_BTREE_MAXLEAFKEY 2031 +#define WT_STAT_DSRC_BTREE_MAXLEAFKEY 2032 /*! btree: maximum leaf page size */ -#define WT_STAT_DSRC_BTREE_MAXLEAFPAGE 2032 +#define WT_STAT_DSRC_BTREE_MAXLEAFPAGE 2033 /*! btree: maximum leaf page value size */ -#define WT_STAT_DSRC_BTREE_MAXLEAFVALUE 2033 +#define WT_STAT_DSRC_BTREE_MAXLEAFVALUE 2034 /*! btree: maximum tree depth */ -#define WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH 2034 +#define WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH 2035 /*! * btree: number of key/value pairs, only reported if tree_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_BTREE_ENTRIES 2035 +#define WT_STAT_DSRC_BTREE_ENTRIES 2036 /*! * btree: overflow pages, only reported if tree_walk or all statistics * are enabled */ -#define WT_STAT_DSRC_BTREE_OVERFLOW 2036 +#define WT_STAT_DSRC_BTREE_OVERFLOW 2037 /*! btree: pages rewritten by compaction */ -#define WT_STAT_DSRC_BTREE_COMPACT_REWRITE 2037 +#define WT_STAT_DSRC_BTREE_COMPACT_REWRITE 2038 /*! * btree: row-store empty values, only reported if tree_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_BTREE_ROW_EMPTY_VALUES 2038 +#define WT_STAT_DSRC_BTREE_ROW_EMPTY_VALUES 2039 /*! * btree: row-store internal pages, only reported if tree_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_BTREE_ROW_INTERNAL 2039 +#define WT_STAT_DSRC_BTREE_ROW_INTERNAL 2040 /*! * btree: row-store leaf pages, only reported if tree_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_BTREE_ROW_LEAF 2040 +#define WT_STAT_DSRC_BTREE_ROW_LEAF 2041 /*! cache: bytes currently in the cache */ -#define WT_STAT_DSRC_CACHE_BYTES_INUSE 2041 +#define WT_STAT_DSRC_CACHE_BYTES_INUSE 2042 /*! cache: bytes dirty in the cache cumulative */ -#define WT_STAT_DSRC_CACHE_BYTES_DIRTY_TOTAL 2042 +#define WT_STAT_DSRC_CACHE_BYTES_DIRTY_TOTAL 2043 /*! cache: bytes read into cache */ -#define WT_STAT_DSRC_CACHE_BYTES_READ 2043 +#define WT_STAT_DSRC_CACHE_BYTES_READ 2044 /*! cache: bytes written from cache */ -#define WT_STAT_DSRC_CACHE_BYTES_WRITE 2044 +#define WT_STAT_DSRC_CACHE_BYTES_WRITE 2045 /*! cache: checkpoint blocked page eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT 2045 +#define WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT 2046 /*! cache: data source pages selected for eviction unable to be evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_FAIL 2046 +#define WT_STAT_DSRC_CACHE_EVICTION_FAIL 2047 /*! cache: eviction walk passes of a file */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALK_PASSES 2047 +#define WT_STAT_DSRC_CACHE_EVICTION_WALK_PASSES 2048 /*! cache: eviction walk target pages histogram - 0-9 */ -#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT10 2048 +#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT10 2049 /*! cache: eviction walk target pages histogram - 10-31 */ -#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT32 2049 +#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT32 2050 /*! cache: eviction walk target pages histogram - 128 and higher */ -#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_GE128 2050 +#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_GE128 2051 /*! cache: eviction walk target pages histogram - 32-63 */ -#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT64 2051 +#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT64 2052 /*! cache: eviction walk target pages histogram - 64-128 */ -#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT128 2052 +#define WT_STAT_DSRC_CACHE_EVICTION_TARGET_PAGE_LT128 2053 /*! cache: eviction walks abandoned */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_ABANDONED 2053 +#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_ABANDONED 2054 /*! cache: eviction walks gave up because they restarted their walk twice */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_STOPPED 2054 +#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_STOPPED 2055 /*! * cache: eviction walks gave up because they saw too many pages and * found no candidates */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_GAVE_UP_NO_TARGETS 2055 +#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_GAVE_UP_NO_TARGETS 2056 /*! * cache: eviction walks gave up because they saw too many pages and * found too few candidates */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_GAVE_UP_RATIO 2056 +#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_GAVE_UP_RATIO 2057 /*! cache: eviction walks reached end of tree */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_ENDED 2057 +#define WT_STAT_DSRC_CACHE_EVICTION_WALKS_ENDED 2058 /*! cache: eviction walks started from root of tree */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALK_FROM_ROOT 2058 +#define WT_STAT_DSRC_CACHE_EVICTION_WALK_FROM_ROOT 2059 /*! cache: eviction walks started from saved location in tree */ -#define WT_STAT_DSRC_CACHE_EVICTION_WALK_SAVED_POS 2059 +#define WT_STAT_DSRC_CACHE_EVICTION_WALK_SAVED_POS 2060 /*! cache: hazard pointer blocked page eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_HAZARD 2060 +#define WT_STAT_DSRC_CACHE_EVICTION_HAZARD 2061 /*! cache: history store table reads */ -#define WT_STAT_DSRC_CACHE_HS_READ 2061 +#define WT_STAT_DSRC_CACHE_HS_READ 2062 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_DSRC_CACHE_INMEM_SPLITTABLE 2062 +#define WT_STAT_DSRC_CACHE_INMEM_SPLITTABLE 2063 /*! cache: in-memory page splits */ -#define WT_STAT_DSRC_CACHE_INMEM_SPLIT 2063 +#define WT_STAT_DSRC_CACHE_INMEM_SPLIT 2064 /*! cache: internal pages evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_INTERNAL 2064 +#define WT_STAT_DSRC_CACHE_EVICTION_INTERNAL 2065 /*! cache: internal pages split during eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_SPLIT_INTERNAL 2065 +#define WT_STAT_DSRC_CACHE_EVICTION_SPLIT_INTERNAL 2066 /*! cache: leaf pages split during eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_SPLIT_LEAF 2066 +#define WT_STAT_DSRC_CACHE_EVICTION_SPLIT_LEAF 2067 /*! cache: modified pages evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_DIRTY 2067 +#define WT_STAT_DSRC_CACHE_EVICTION_DIRTY 2068 /*! cache: overflow pages read into cache */ -#define WT_STAT_DSRC_CACHE_READ_OVERFLOW 2068 +#define WT_STAT_DSRC_CACHE_READ_OVERFLOW 2069 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_DSRC_CACHE_EVICTION_DEEPEN 2069 +#define WT_STAT_DSRC_CACHE_EVICTION_DEEPEN 2070 /*! cache: page written requiring history store records */ -#define WT_STAT_DSRC_CACHE_WRITE_HS 2070 +#define WT_STAT_DSRC_CACHE_WRITE_HS 2071 /*! cache: pages read into cache */ -#define WT_STAT_DSRC_CACHE_READ 2071 +#define WT_STAT_DSRC_CACHE_READ 2072 /*! cache: pages read into cache after truncate */ -#define WT_STAT_DSRC_CACHE_READ_DELETED 2072 +#define WT_STAT_DSRC_CACHE_READ_DELETED 2073 /*! cache: pages read into cache after truncate in prepare state */ -#define WT_STAT_DSRC_CACHE_READ_DELETED_PREPARED 2073 +#define WT_STAT_DSRC_CACHE_READ_DELETED_PREPARED 2074 /*! cache: pages requested from the cache */ -#define WT_STAT_DSRC_CACHE_PAGES_REQUESTED 2074 +#define WT_STAT_DSRC_CACHE_PAGES_REQUESTED 2075 /*! cache: pages seen by eviction walk */ -#define WT_STAT_DSRC_CACHE_EVICTION_PAGES_SEEN 2075 +#define WT_STAT_DSRC_CACHE_EVICTION_PAGES_SEEN 2076 /*! cache: pages written from cache */ -#define WT_STAT_DSRC_CACHE_WRITE 2076 +#define WT_STAT_DSRC_CACHE_WRITE 2077 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_DSRC_CACHE_WRITE_RESTORE 2077 +#define WT_STAT_DSRC_CACHE_WRITE_RESTORE 2078 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_DSRC_CACHE_BYTES_DIRTY 2078 +#define WT_STAT_DSRC_CACHE_BYTES_DIRTY 2079 /*! cache: unmodified pages evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2079 +#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2080 /*! * cache_walk: Average difference between current eviction generation * when the page was last considered, only reported if cache_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_GEN_AVG_GAP 2080 +#define WT_STAT_DSRC_CACHE_STATE_GEN_AVG_GAP 2081 /*! * cache_walk: Average on-disk page image size seen, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_AVG_WRITTEN_SIZE 2081 +#define WT_STAT_DSRC_CACHE_STATE_AVG_WRITTEN_SIZE 2082 /*! * cache_walk: Average time in cache for pages that have been visited by * the eviction server, only reported if cache_walk or all statistics are * enabled */ -#define WT_STAT_DSRC_CACHE_STATE_AVG_VISITED_AGE 2082 +#define WT_STAT_DSRC_CACHE_STATE_AVG_VISITED_AGE 2083 /*! * cache_walk: Average time in cache for pages that have not been visited * by the eviction server, only reported if cache_walk or all statistics * are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_AVG_UNVISITED_AGE 2083 +#define WT_STAT_DSRC_CACHE_STATE_AVG_UNVISITED_AGE 2084 /*! * cache_walk: Clean pages currently in cache, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_PAGES_CLEAN 2084 +#define WT_STAT_DSRC_CACHE_STATE_PAGES_CLEAN 2085 /*! * cache_walk: Current eviction generation, only reported if cache_walk * or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_GEN_CURRENT 2085 +#define WT_STAT_DSRC_CACHE_STATE_GEN_CURRENT 2086 /*! * cache_walk: Dirty pages currently in cache, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_PAGES_DIRTY 2086 +#define WT_STAT_DSRC_CACHE_STATE_PAGES_DIRTY 2087 /*! * cache_walk: Entries in the root page, only reported if cache_walk or * all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_ROOT_ENTRIES 2087 +#define WT_STAT_DSRC_CACHE_STATE_ROOT_ENTRIES 2088 /*! * cache_walk: Internal pages currently in cache, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_PAGES_INTERNAL 2088 +#define WT_STAT_DSRC_CACHE_STATE_PAGES_INTERNAL 2089 /*! * cache_walk: Leaf pages currently in cache, only reported if cache_walk * or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_PAGES_LEAF 2089 +#define WT_STAT_DSRC_CACHE_STATE_PAGES_LEAF 2090 /*! * cache_walk: Maximum difference between current eviction generation * when the page was last considered, only reported if cache_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_GEN_MAX_GAP 2090 +#define WT_STAT_DSRC_CACHE_STATE_GEN_MAX_GAP 2091 /*! * cache_walk: Maximum page size seen, only reported if cache_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_MAX_PAGESIZE 2091 +#define WT_STAT_DSRC_CACHE_STATE_MAX_PAGESIZE 2092 /*! * cache_walk: Minimum on-disk page image size seen, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_MIN_WRITTEN_SIZE 2092 +#define WT_STAT_DSRC_CACHE_STATE_MIN_WRITTEN_SIZE 2093 /*! * cache_walk: Number of pages never visited by eviction server, only * reported if cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_UNVISITED_COUNT 2093 +#define WT_STAT_DSRC_CACHE_STATE_UNVISITED_COUNT 2094 /*! * cache_walk: On-disk page image sizes smaller than a single allocation * unit, only reported if cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_SMALLER_ALLOC_SIZE 2094 +#define WT_STAT_DSRC_CACHE_STATE_SMALLER_ALLOC_SIZE 2095 /*! * cache_walk: Pages created in memory and never written, only reported * if cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_MEMORY 2095 +#define WT_STAT_DSRC_CACHE_STATE_MEMORY 2096 /*! * cache_walk: Pages currently queued for eviction, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_QUEUED 2096 +#define WT_STAT_DSRC_CACHE_STATE_QUEUED 2097 /*! * cache_walk: Pages that could not be queued for eviction, only reported * if cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_NOT_QUEUEABLE 2097 +#define WT_STAT_DSRC_CACHE_STATE_NOT_QUEUEABLE 2098 /*! * cache_walk: Refs skipped during cache traversal, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_REFS_SKIPPED 2098 +#define WT_STAT_DSRC_CACHE_STATE_REFS_SKIPPED 2099 /*! * cache_walk: Size of the root page, only reported if cache_walk or all * statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_ROOT_SIZE 2099 +#define WT_STAT_DSRC_CACHE_STATE_ROOT_SIZE 2100 /*! * cache_walk: Total number of pages currently in cache, only reported if * cache_walk or all statistics are enabled */ -#define WT_STAT_DSRC_CACHE_STATE_PAGES 2100 +#define WT_STAT_DSRC_CACHE_STATE_PAGES 2101 /*! checkpoint-cleanup: pages added for eviction */ -#define WT_STAT_DSRC_CC_PAGES_EVICT 2101 +#define WT_STAT_DSRC_CC_PAGES_EVICT 2102 /*! checkpoint-cleanup: pages removed */ -#define WT_STAT_DSRC_CC_PAGES_REMOVED 2102 +#define WT_STAT_DSRC_CC_PAGES_REMOVED 2103 /*! checkpoint-cleanup: pages skipped during tree walk */ -#define WT_STAT_DSRC_CC_PAGES_WALK_SKIPPED 2103 +#define WT_STAT_DSRC_CC_PAGES_WALK_SKIPPED 2104 /*! checkpoint-cleanup: pages visited */ -#define WT_STAT_DSRC_CC_PAGES_VISITED 2104 +#define WT_STAT_DSRC_CC_PAGES_VISITED 2105 /*! * compression: compressed page maximum internal page size prior to * compression */ -#define WT_STAT_DSRC_COMPRESS_PRECOMP_INTL_MAX_PAGE_SIZE 2105 +#define WT_STAT_DSRC_COMPRESS_PRECOMP_INTL_MAX_PAGE_SIZE 2106 /*! * compression: compressed page maximum leaf page size prior to * compression */ -#define WT_STAT_DSRC_COMPRESS_PRECOMP_LEAF_MAX_PAGE_SIZE 2106 +#define WT_STAT_DSRC_COMPRESS_PRECOMP_LEAF_MAX_PAGE_SIZE 2107 /*! compression: compressed pages read */ -#define WT_STAT_DSRC_COMPRESS_READ 2107 +#define WT_STAT_DSRC_COMPRESS_READ 2108 /*! compression: compressed pages written */ -#define WT_STAT_DSRC_COMPRESS_WRITE 2108 +#define WT_STAT_DSRC_COMPRESS_WRITE 2109 /*! compression: page written failed to compress */ -#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2109 +#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2110 /*! compression: page written was too small to compress */ -#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2110 +#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2111 /*! cursor: Total number of entries skipped by cursor next calls */ -#define WT_STAT_DSRC_CURSOR_NEXT_SKIP_TOTAL 2111 +#define WT_STAT_DSRC_CURSOR_NEXT_SKIP_TOTAL 2112 /*! cursor: Total number of entries skipped by cursor prev calls */ -#define WT_STAT_DSRC_CURSOR_PREV_SKIP_TOTAL 2112 +#define WT_STAT_DSRC_CURSOR_PREV_SKIP_TOTAL 2113 /*! * cursor: Total number of entries skipped to position the history store * cursor */ -#define WT_STAT_DSRC_CURSOR_SKIP_HS_CUR_POSITION 2113 +#define WT_STAT_DSRC_CURSOR_SKIP_HS_CUR_POSITION 2114 /*! cursor: bulk loaded cursor insert calls */ -#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2114 +#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2115 /*! cursor: cache cursors reuse count */ -#define WT_STAT_DSRC_CURSOR_REOPEN 2115 +#define WT_STAT_DSRC_CURSOR_REOPEN 2116 /*! cursor: close calls that result in cache */ -#define WT_STAT_DSRC_CURSOR_CACHE 2116 +#define WT_STAT_DSRC_CURSOR_CACHE 2117 /*! cursor: create calls */ -#define WT_STAT_DSRC_CURSOR_CREATE 2117 +#define WT_STAT_DSRC_CURSOR_CREATE 2118 /*! * cursor: cursor next calls that skip greater than or equal to 100 * entries */ -#define WT_STAT_DSRC_CURSOR_NEXT_SKIP_GE_100 2118 +#define WT_STAT_DSRC_CURSOR_NEXT_SKIP_GE_100 2119 /*! cursor: cursor next calls that skip less than 100 entries */ -#define WT_STAT_DSRC_CURSOR_NEXT_SKIP_LT_100 2119 +#define WT_STAT_DSRC_CURSOR_NEXT_SKIP_LT_100 2120 /*! * cursor: cursor prev calls that skip greater than or equal to 100 * entries */ -#define WT_STAT_DSRC_CURSOR_PREV_SKIP_GE_100 2120 +#define WT_STAT_DSRC_CURSOR_PREV_SKIP_GE_100 2121 /*! cursor: cursor prev calls that skip less than 100 entries */ -#define WT_STAT_DSRC_CURSOR_PREV_SKIP_LT_100 2121 +#define WT_STAT_DSRC_CURSOR_PREV_SKIP_LT_100 2122 /*! cursor: insert calls */ -#define WT_STAT_DSRC_CURSOR_INSERT 2122 +#define WT_STAT_DSRC_CURSOR_INSERT 2123 /*! cursor: insert key and value bytes */ -#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2123 +#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2124 /*! cursor: modify */ -#define WT_STAT_DSRC_CURSOR_MODIFY 2124 +#define WT_STAT_DSRC_CURSOR_MODIFY 2125 /*! cursor: modify key and value bytes affected */ -#define WT_STAT_DSRC_CURSOR_MODIFY_BYTES 2125 +#define WT_STAT_DSRC_CURSOR_MODIFY_BYTES 2126 /*! cursor: modify value bytes modified */ -#define WT_STAT_DSRC_CURSOR_MODIFY_BYTES_TOUCH 2126 +#define WT_STAT_DSRC_CURSOR_MODIFY_BYTES_TOUCH 2127 /*! cursor: next calls */ -#define WT_STAT_DSRC_CURSOR_NEXT 2127 +#define WT_STAT_DSRC_CURSOR_NEXT 2128 /*! cursor: open cursor count */ -#define WT_STAT_DSRC_CURSOR_OPEN_COUNT 2128 +#define WT_STAT_DSRC_CURSOR_OPEN_COUNT 2129 /*! cursor: operation restarted */ -#define WT_STAT_DSRC_CURSOR_RESTART 2129 +#define WT_STAT_DSRC_CURSOR_RESTART 2130 /*! cursor: prev calls */ -#define WT_STAT_DSRC_CURSOR_PREV 2130 +#define WT_STAT_DSRC_CURSOR_PREV 2131 /*! cursor: remove calls */ -#define WT_STAT_DSRC_CURSOR_REMOVE 2131 +#define WT_STAT_DSRC_CURSOR_REMOVE 2132 /*! cursor: remove key bytes removed */ -#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2132 +#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2133 /*! cursor: reserve calls */ -#define WT_STAT_DSRC_CURSOR_RESERVE 2133 +#define WT_STAT_DSRC_CURSOR_RESERVE 2134 /*! cursor: reset calls */ -#define WT_STAT_DSRC_CURSOR_RESET 2134 +#define WT_STAT_DSRC_CURSOR_RESET 2135 /*! cursor: search calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH 2135 +#define WT_STAT_DSRC_CURSOR_SEARCH 2136 /*! cursor: search history store calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH_HS 2136 +#define WT_STAT_DSRC_CURSOR_SEARCH_HS 2137 /*! cursor: search near calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2137 +#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2138 /*! cursor: truncate calls */ -#define WT_STAT_DSRC_CURSOR_TRUNCATE 2138 +#define WT_STAT_DSRC_CURSOR_TRUNCATE 2139 /*! cursor: update calls */ -#define WT_STAT_DSRC_CURSOR_UPDATE 2139 +#define WT_STAT_DSRC_CURSOR_UPDATE 2140 /*! cursor: update key and value bytes */ -#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2140 +#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2141 /*! cursor: update value size change */ -#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES_CHANGED 2141 +#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES_CHANGED 2142 /*! reconciliation: approximate byte size of timestamps in pages written */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_BYTES_TS 2142 +#define WT_STAT_DSRC_REC_TIME_WINDOW_BYTES_TS 2143 /*! * reconciliation: approximate byte size of transaction IDs in pages * written */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_BYTES_TXN 2143 +#define WT_STAT_DSRC_REC_TIME_WINDOW_BYTES_TXN 2144 /*! reconciliation: dictionary matches */ -#define WT_STAT_DSRC_REC_DICTIONARY 2144 +#define WT_STAT_DSRC_REC_DICTIONARY 2145 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_DSRC_REC_PAGE_DELETE_FAST 2145 +#define WT_STAT_DSRC_REC_PAGE_DELETE_FAST 2146 /*! * reconciliation: internal page key bytes discarded using suffix * compression */ -#define WT_STAT_DSRC_REC_SUFFIX_COMPRESSION 2146 +#define WT_STAT_DSRC_REC_SUFFIX_COMPRESSION 2147 /*! reconciliation: internal page multi-block writes */ -#define WT_STAT_DSRC_REC_MULTIBLOCK_INTERNAL 2147 +#define WT_STAT_DSRC_REC_MULTIBLOCK_INTERNAL 2148 /*! reconciliation: internal-page overflow keys */ -#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2148 +#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2149 /*! reconciliation: leaf page key bytes discarded using prefix compression */ -#define WT_STAT_DSRC_REC_PREFIX_COMPRESSION 2149 +#define WT_STAT_DSRC_REC_PREFIX_COMPRESSION 2150 /*! reconciliation: leaf page multi-block writes */ -#define WT_STAT_DSRC_REC_MULTIBLOCK_LEAF 2150 +#define WT_STAT_DSRC_REC_MULTIBLOCK_LEAF 2151 /*! reconciliation: leaf-page overflow keys */ -#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2151 +#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2152 /*! reconciliation: maximum blocks required for a page */ -#define WT_STAT_DSRC_REC_MULTIBLOCK_MAX 2152 +#define WT_STAT_DSRC_REC_MULTIBLOCK_MAX 2153 /*! reconciliation: overflow values written */ -#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2153 +#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2154 /*! reconciliation: page checksum matches */ -#define WT_STAT_DSRC_REC_PAGE_MATCH 2154 +#define WT_STAT_DSRC_REC_PAGE_MATCH 2155 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_DSRC_REC_PAGES 2155 +#define WT_STAT_DSRC_REC_PAGES 2156 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_DSRC_REC_PAGES_EVICTION 2156 +#define WT_STAT_DSRC_REC_PAGES_EVICTION 2157 /*! reconciliation: pages deleted */ -#define WT_STAT_DSRC_REC_PAGE_DELETE 2157 +#define WT_STAT_DSRC_REC_PAGE_DELETE 2158 /*! * reconciliation: pages written including an aggregated newest start * durable timestamp */ -#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 2158 +#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 2159 /*! * reconciliation: pages written including an aggregated newest stop * durable timestamp */ -#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 2159 +#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 2160 /*! * reconciliation: pages written including an aggregated newest stop * timestamp */ -#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_STOP_TS 2160 +#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_STOP_TS 2161 /*! * reconciliation: pages written including an aggregated newest stop * transaction ID */ -#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_STOP_TXN 2161 +#define WT_STAT_DSRC_REC_TIME_AGGR_NEWEST_STOP_TXN 2162 /*! * reconciliation: pages written including an aggregated oldest start * timestamp */ -#define WT_STAT_DSRC_REC_TIME_AGGR_OLDEST_START_TS 2162 +#define WT_STAT_DSRC_REC_TIME_AGGR_OLDEST_START_TS 2163 /*! * reconciliation: pages written including an aggregated oldest start * transaction ID */ -#define WT_STAT_DSRC_REC_TIME_AGGR_OLDEST_START_TXN 2163 +#define WT_STAT_DSRC_REC_TIME_AGGR_OLDEST_START_TXN 2164 /*! reconciliation: pages written including an aggregated prepare */ -#define WT_STAT_DSRC_REC_TIME_AGGR_PREPARED 2164 +#define WT_STAT_DSRC_REC_TIME_AGGR_PREPARED 2165 /*! reconciliation: pages written including at least one prepare */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_PREPARED 2165 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_PREPARED 2166 /*! * reconciliation: pages written including at least one start durable * timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 2166 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 2167 /*! reconciliation: pages written including at least one start timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_START_TS 2167 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_START_TS 2168 /*! * reconciliation: pages written including at least one start transaction * ID */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_START_TXN 2168 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_START_TXN 2169 /*! * reconciliation: pages written including at least one stop durable * timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 2169 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 2170 /*! reconciliation: pages written including at least one stop timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_STOP_TS 2170 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_STOP_TS 2171 /*! * reconciliation: pages written including at least one stop transaction * ID */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_STOP_TXN 2171 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PAGES_STOP_TXN 2172 /*! reconciliation: records written including a prepare */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_PREPARED 2172 +#define WT_STAT_DSRC_REC_TIME_WINDOW_PREPARED 2173 /*! reconciliation: records written including a start durable timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_DURABLE_START_TS 2173 +#define WT_STAT_DSRC_REC_TIME_WINDOW_DURABLE_START_TS 2174 /*! reconciliation: records written including a start timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_START_TS 2174 +#define WT_STAT_DSRC_REC_TIME_WINDOW_START_TS 2175 /*! reconciliation: records written including a start transaction ID */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_START_TXN 2175 +#define WT_STAT_DSRC_REC_TIME_WINDOW_START_TXN 2176 /*! reconciliation: records written including a stop durable timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_DURABLE_STOP_TS 2176 +#define WT_STAT_DSRC_REC_TIME_WINDOW_DURABLE_STOP_TS 2177 /*! reconciliation: records written including a stop timestamp */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_STOP_TS 2177 +#define WT_STAT_DSRC_REC_TIME_WINDOW_STOP_TS 2178 /*! reconciliation: records written including a stop transaction ID */ -#define WT_STAT_DSRC_REC_TIME_WINDOW_STOP_TXN 2178 +#define WT_STAT_DSRC_REC_TIME_WINDOW_STOP_TXN 2179 /*! session: object compaction */ -#define WT_STAT_DSRC_SESSION_COMPACT 2179 +#define WT_STAT_DSRC_SESSION_COMPACT 2180 +/*! transaction: race to read prepared update retry */ +#define WT_STAT_DSRC_TXN_READ_RACE_PREPARE_UPDATE 2181 /*! transaction: update conflicts */ -#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2180 +#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2182 /*! * @} diff --git a/src/third_party/wiredtiger/src/meta/meta_ckpt.c b/src/third_party/wiredtiger/src/meta/meta_ckpt.c index a5373dabccc..65dae99e577 100644 --- a/src/third_party/wiredtiger/src/meta/meta_ckpt.c +++ b/src/third_party/wiredtiger/src/meta/meta_ckpt.c @@ -11,7 +11,6 @@ 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_load_blk_mods(WT_SESSION_IMPL *, const char *, 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 *, bool); static int __ckpt_version_chk(WT_SESSION_IMPL *, const char *, const char *); @@ -73,6 +72,11 @@ __ckpt_load_blk_mods(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt blk_mod->nbits = (uint64_t)b.val; WT_RET(__wt_config_subgets(session, &v, "offset", &b)); blk_mod->offset = (uint64_t)b.val; + WT_RET(__wt_config_subgets(session, &v, "rename", &b)); + if (b.val) + F_SET(blk_mod, WT_BLOCK_MODS_RENAME); + else + F_CLR(blk_mod, WT_BLOCK_MODS_RENAME); ret = __wt_config_subgets(session, &v, "blocks", &b); WT_RET_NOTFOUND_OK(ret); if (ret != WT_NOTFOUND) { @@ -388,7 +392,7 @@ __ckpt_compare_order(const void *a, const void *b) * information. */ static int -__ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt) +__ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt, bool rename) { WT_BLKINCR *blk; WT_BLOCK_MODS *blk_mod; @@ -426,6 +430,10 @@ __ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt) setup = true; } + /* If we are keeping or setting up an entry on a rename, set the flag. */ + if (rename && (!free || setup)) + F_SET(blk_mod, WT_BLOCK_MODS_RENAME); + /* Free any old information if we need to do so. */ if (free && F_ISSET(blk_mod, WT_BLOCK_MODS_VALID)) { __wt_free(session, blk_mod->id_str); @@ -450,6 +458,32 @@ __ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt) } /* + * __wt_meta_blk_mods_load -- + * Load the block mods for a given checkpoint and set up all the information to store. + */ +int +__wt_meta_blk_mods_load(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt, bool rename) +{ + /* + * Load most recent checkpoint backup blocks to this checkpoint. + */ + WT_RET(__ckpt_load_blk_mods(session, config, ckpt)); + + WT_RET(__wt_meta_block_metadata(session, config, ckpt)); + + /* + * Set the add-a-checkpoint flag, and if we're doing incremental backups, request a list of the + * checkpoint's modified blocks from the block manager. + */ + F_SET(ckpt, WT_CKPT_ADD); + if (F_ISSET(S2C(session), WT_CONN_INCR_BACKUP)) { + F_SET(ckpt, WT_CKPT_BLOCK_MODS); + WT_RET(__ckpt_valid_blk_mods(session, ckpt, rename)); + } + return (0); +} + +/* * __wt_meta_ckptlist_get -- * Load all available checkpoint information for a file. */ @@ -523,22 +557,7 @@ __wt_meta_ckptlist_get( __wt_atomic_cas64(&conn->ckpt_most_recent, most_recent, ckpt->sec)) break; } - /* - * Load most recent checkpoint backup blocks to this checkpoint. - */ - WT_ERR(__ckpt_load_blk_mods(session, config, ckpt)); - - WT_ERR(__wt_meta_block_metadata(session, config, ckpt)); - - /* - * Set the add-a-checkpoint flag, and if we're doing incremental backups, request a list of - * the checkpoint's modified blocks from the block manager. - */ - F_SET(ckpt, WT_CKPT_ADD); - if (F_ISSET(conn, WT_CONN_INCR_BACKUP)) { - F_SET(ckpt, WT_CKPT_BLOCK_MODS); - WT_ERR(__ckpt_valid_blk_mods(session, ckpt)); - } + WT_ERR(__wt_meta_blk_mods_load(session, config, ckpt, false)); } /* Return the array to our caller. */ @@ -764,11 +783,11 @@ __wt_meta_ckptlist_to_meta(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, WT_ITEM } /* - * __ckpt_blkmod_to_meta -- + * __wt_ckpt_blkmod_to_meta -- * Add in any modification block string needed, including an empty one. */ -static int -__ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt) +int +__wt_ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt) { WT_BLOCK_MODS *blk; WT_ITEM bitstring; @@ -797,10 +816,11 @@ __ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt) if (!F_ISSET(blk, WT_BLOCK_MODS_VALID)) continue; WT_RET(__wt_raw_to_hex(session, blk->bitstring.data, blk->bitstring.size, &bitstring)); - WT_RET(__wt_buf_catfmt(session, buf, "%s\"%s\"=(id=%" PRIu32 ",granularity=%" PRIu64 - ",nbits=%" PRIu64 ",offset=%" PRIu64 ",blocks=%.*s)", + WT_RET(__wt_buf_catfmt(session, buf, + "%s\"%s\"=(id=%" PRIu32 ",granularity=%" PRIu64 ",nbits=%" PRIu64 ",offset=%" PRIu64 + ",rename=%d,blocks=%.*s)", i == 0 ? "" : ",", blk->id_str, i, blk->granularity, blk->nbits, blk->offset, - (int)bitstring.size, (char *)bitstring.data)); + F_ISSET(blk, WT_BLOCK_MODS_RENAME) ? 1 : 0, (int)bitstring.size, (char *)bitstring.data)); /* The hex string length should match the appropriate number of bits. */ WT_ASSERT(session, (blk->nbits >> 2) <= bitstring.size); __wt_buf_free(session, &bitstring); @@ -828,7 +848,7 @@ __wt_meta_ckptlist_set( /* Add backup block modifications for any added checkpoint. */ WT_CKPT_FOREACH (ckptbase, ckpt) if (F_ISSET(ckpt, WT_CKPT_ADD)) - WT_ERR(__ckpt_blkmod_to_meta(session, buf, ckpt)); + WT_ERR(__wt_ckpt_blkmod_to_meta(session, buf, ckpt)); has_lsn = ckptlsn != NULL; if (ckptlsn != NULL) @@ -897,12 +917,9 @@ __wt_meta_sysinfo_set(WT_SESSION_IMPL *session) { WT_DECL_ITEM(buf); WT_DECL_RET; - char hex_timestamp[2 * sizeof(wt_timestamp_t) + 2]; + char hex_timestamp[WT_TS_HEX_STRING_SIZE]; WT_ERR(__wt_scr_alloc(session, 0, &buf)); - hex_timestamp[0] = '0'; - hex_timestamp[1] = '\0'; - /* * We need to record the timestamp of the checkpoint in the metadata. The timestamp value is set * at a higher level, either in checkpoint or in recovery. @@ -917,10 +934,20 @@ __wt_meta_sysinfo_set(WT_SESSION_IMPL *session) if (strcmp(hex_timestamp, "0") == 0) WT_ERR_NOTFOUND_OK(__wt_metadata_remove(session, WT_SYSTEM_CKPT_URI), false); else { - WT_ERR(__wt_buf_catfmt(session, buf, "checkpoint_timestamp=\"%s\"", hex_timestamp)); + WT_ERR(__wt_buf_fmt(session, buf, WT_SYSTEM_CKPT_TS "=\"%s\"", hex_timestamp)); WT_ERR(__wt_metadata_update(session, WT_SYSTEM_CKPT_URI, buf->data)); } + /* We also need to record the oldest timestamp in the metadata so we can set it on startup. */ + __wt_timestamp_to_hex_string( + S2C(session)->txn_global.checkpoint_oldest_timestamp, hex_timestamp); + if (strcmp(hex_timestamp, "0") == 0) + WT_ERR_NOTFOUND_OK(__wt_metadata_remove(session, WT_SYSTEM_OLDEST_URI), false); + else { + WT_ERR(__wt_buf_fmt(session, buf, WT_SYSTEM_OLDEST_TS "=\"%s\"", hex_timestamp)); + WT_ERR(__wt_metadata_update(session, WT_SYSTEM_OLDEST_URI, buf->data)); + } + err: __wt_scr_free(session, &buf); return (ret); diff --git a/src/third_party/wiredtiger/src/reconcile/rec_row.c b/src/third_party/wiredtiger/src/reconcile/rec_row.c index c07b7de4546..5c7ae157bde 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_row.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_row.c @@ -709,7 +709,7 @@ __wt_rec_row_leaf( WT_UPDATE *upd; WT_UPDATE_SELECT upd_select; uint64_t slvg_skip; - uint32_t i; + uint32_t i, session_flags; bool dictionary, key_onpage_ovfl, ovfl_key; void *copy; @@ -887,9 +887,19 @@ __wt_rec_row_leaf( if (tw.durable_stop_ts == WT_TS_NONE && F_ISSET(S2C(session), WT_CONN_HS_OPEN) && !WT_IS_HS(btree)) { WT_ERR(__wt_row_leaf_key(session, page, rip, tmpkey, true)); - /* Start from WT_TS_NONE to delete all the history store content of the key. */ - WT_ERR(__wt_hs_delete_key_from_ts(session, btree->id, tmpkey, WT_TS_NONE)); - WT_STAT_CONN_INCR(session, cache_hs_key_truncate_onpage_removal); + /* + * Start from WT_TS_NONE to delete all the history store content of the key. + * + * Some code paths, such as schema removal, involve deleting keys in metadata + * and assert that they shouldn't open new dhandles. In those cases we won't + * ever need to blow away history store content, so we can skip this. + */ + if (!F_ISSET(session, WT_SESSION_NO_DATA_HANDLES)) { + WT_ERR(__wt_hs_cursor_open(session, &session_flags)); + WT_ERR(__wt_hs_delete_key_from_ts(session, btree->id, tmpkey, WT_TS_NONE)); + WT_ERR(__wt_hs_cursor_close(session, session_flags)); + WT_STAT_CONN_INCR(session, cache_hs_key_truncate_onpage_removal); + } } /* diff --git a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c index 6b7f5fff165..523ed514415 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c @@ -49,7 +49,9 @@ __rec_update_save(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, voi /* * __rec_append_orig_value -- - * Append the key's original value to its update list. + * Append the key's original value to its update list. It assumes that we have an onpage value, + * the onpage value is not a prepared update, and we don't overwrite transaction id to + * WT_TXN_NONE and timestamps to WT_TS_NONE in time window for in-memory databases. */ static int __rec_append_orig_value( @@ -61,7 +63,8 @@ __rec_append_orig_value( size_t size, total_size; bool tombstone_globally_visible; - WT_ASSERT(session, upd != NULL && unpack != NULL && unpack->type != WT_CELL_DEL); + WT_ASSERT( + session, upd != NULL && unpack != NULL && unpack->type != WT_CELL_DEL && !unpack->tw.prepare); append = oldest_upd = tombstone = NULL; total_size = 0; @@ -69,24 +72,20 @@ __rec_append_orig_value( /* Review the current update list, checking conditions that mean no work is needed. */ for (;; upd = upd->next) { - /* Done if the update was restored from the history store. */ - if (F_ISSET(upd, WT_UPDATE_RESTORED_FROM_HS)) - return (0); - - /* - * Prepared updates should already be in the update list, add the original update to the - * list only when the prepared update is a tombstone. - */ - if (unpack->tw.prepare && upd->type != WT_UPDATE_TOMBSTONE) + /* Done if the update was restored from the data store or the history store. */ + if (F_ISSET(upd, WT_UPDATE_RESTORED_FROM_DS | WT_UPDATE_RESTORED_FROM_HS)) return (0); /* * Done if the on page value already appears on the update list. We can't do the same check * for stop time point because we may still need to append the onpage value if only the - * tombstone is on the update chain. + * tombstone is on the update chain. We only need to check it in the in memory case as in + * other cases, the update must have been restored from the data store and we may overwrite + * its transaction id to WT_TXN_NONE and its timestamps to WT_TS_NONE when we write the + * update to the time window. */ - if (unpack->tw.start_ts == upd->start_ts && unpack->tw.start_txn == upd->txnid && - upd->type != WT_UPDATE_TOMBSTONE) + if (F_ISSET(S2C(session), WT_CONN_IN_MEMORY) && unpack->tw.start_ts == upd->start_ts && + unpack->tw.start_txn == upd->txnid && upd->type != WT_UPDATE_TOMBSTONE) return (0); /* @@ -127,13 +126,8 @@ __rec_append_orig_value( if (WT_TIME_WINDOW_HAS_STOP(&unpack->tw)) { tombstone_globally_visible = __wt_txn_tw_stop_visible_all(session, &unpack->tw); - /* - * No need to append the tombstone if it is already in the update chain. - * - * Don't append the onpage tombstone if it is a prepared update as it is either on the - * update chain or has been aborted. If it is aborted, discard it silently. - */ - if (oldest_upd->type != WT_UPDATE_TOMBSTONE && !unpack->tw.prepare) { + /* No need to append the tombstone if it is already in the update chain. */ + if (oldest_upd->type != WT_UPDATE_TOMBSTONE) { /* * We still need to append the globally visible tombstone if its timestamp is WT_TS_NONE * as we may need it to clear the history store content of the key. We don't append a @@ -152,21 +146,17 @@ __rec_append_orig_value( F_SET(tombstone, WT_UPDATE_RESTORED_FROM_DS); } else { /* - * Once the prepared update is resolved, the in-memory update and on-disk written copy - * doesn't have same timestamp due to replacing of prepare timestamp with commit and - * durable timestamps. Don't compare them when the on-disk version is a prepare. + * We may have overwritten its transaction id to WT_TXN_NONE and its timestamps to + * WT_TS_NONE in the time window. */ - WT_ASSERT(session, unpack->tw.prepare || (unpack->tw.stop_ts == oldest_upd->start_ts && - unpack->tw.stop_txn == oldest_upd->txnid)); + WT_ASSERT(session, + (unpack->tw.stop_ts == oldest_upd->start_ts || unpack->tw.stop_ts == WT_TS_NONE) && + (unpack->tw.stop_txn == oldest_upd->txnid || unpack->tw.stop_txn == WT_TXN_NONE)); + if (tombstone_globally_visible) return (0); } - } else if (unpack->tw.prepare) - /* - * Don't append the onpage value if it is a prepared update as it is either on the update - * chain or has been aborted. If it is aborted, discard it silently. - */ - return (0); + } /* We need the original on-page value for some reader: get a copy. */ if (!tombstone_globally_visible) { @@ -549,9 +539,13 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, v * part of the page, and they are physically removed by checkpoint writing this page, that is, * the checkpoint doesn't include the overflow blocks so they're removed and future readers of * this page won't be able to find them. + * + * We never append prepared updates back to the onpage value. If it is a prepared full update, + * it is already on the update chain. If it is a prepared tombstone, the onpage value is already + * appended to the update chain when the page is read into memory. */ if (upd_select->upd != NULL && vpack != NULL && vpack->type != WT_CELL_DEL && - (upd_saved || F_ISSET(vpack, WT_CELL_UNPACK_OVERFLOW))) + !vpack->tw.prepare && (upd_saved || F_ISSET(vpack, WT_CELL_UNPACK_OVERFLOW))) WT_ERR(__rec_append_orig_value(session, page, upd_select->upd, vpack)); __wt_time_window_clear_obsolete( diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c index 1b16ddd15fd..d2242a9b2a0 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_write.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c @@ -2264,7 +2264,6 @@ __rec_hs_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r) WT_DECL_RET; WT_MULTI *multi; uint32_t i, session_flags; - bool is_owner; /* Check if there's work to do. */ for (multi = r->multi, i = 0; i < r->multi_next; ++multi, ++i) @@ -2273,7 +2272,7 @@ __rec_hs_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r) if (i == r->multi_next) return (0); - WT_RET(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_RET(__wt_hs_cursor_open(session, &session_flags)); for (multi = r->multi, i = 0; i < r->multi_next; ++multi, ++i) if (multi->supd != NULL) { @@ -2286,7 +2285,7 @@ __rec_hs_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r) } err: - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); return (ret); } diff --git a/src/third_party/wiredtiger/src/schema/schema_rename.c b/src/third_party/wiredtiger/src/schema/schema_rename.c index 3dfc99493c4..53c006ed226 100644 --- a/src/third_party/wiredtiger/src/schema/schema_rename.c +++ b/src/third_party/wiredtiger/src/schema/schema_rename.c @@ -9,14 +9,40 @@ #include "wt_internal.h" /* + * __rename_blkmod -- + * Reset the incremental backup information for a rename. + */ +static int +__rename_blkmod(WT_SESSION_IMPL *session, const char *oldvalue, WT_ITEM *buf) +{ + WT_CKPT ckpt; + WT_DECL_RET; + + WT_CLEAR(ckpt); + /* + * Replace the old file entries with new file entries. We need to recreate the incremental + * backup information to indicate copying the entire file in its bitmap. + */ + /* First load any existing backup information into a temp checkpoint structure. */ + WT_RET(__wt_meta_blk_mods_load(session, oldvalue, &ckpt, true)); + + /* Take the checkpoint structure and generate the metadata string. */ + ret = __wt_ckpt_blkmod_to_meta(session, buf, &ckpt); + __wt_meta_checkpoint_free(session, &ckpt); + return (ret); +} + +/* * __rename_file -- * WT_SESSION::rename for a file. */ static int __rename_file(WT_SESSION_IMPL *session, const char *uri, const char *newuri) { + WT_DECL_ITEM(buf); WT_DECL_RET; char *newvalue, *oldvalue; + const char *filecfg[3] = {NULL, NULL, NULL}; const char *filename, *newfile; bool exist; @@ -33,6 +59,7 @@ __rename_file(WT_SESSION_IMPL *session, const char *uri, const char *newuri) WT_WITH_HANDLE_LIST_WRITE_LOCK( session, ret = __wt_conn_dhandle_close_all(session, uri, true, false)); WT_ERR(ret); + WT_ERR(__wt_scr_alloc(session, 1024, &buf)); /* * First, check if the file being renamed exists in the system. Doing this check first matches @@ -54,13 +81,20 @@ __rename_file(WT_SESSION_IMPL *session, const char *uri, const char *newuri) default: WT_ERR(ret); } + __wt_free(session, newvalue); WT_ERR(__wt_fs_exist(session, newfile, &exist)); if (exist) WT_ERR_MSG(session, EEXIST, "%s", newfile); - /* Replace the old file entries with new file entries. */ WT_ERR(__wt_metadata_remove(session, uri)); - WT_ERR(__wt_metadata_insert(session, newuri, oldvalue)); + filecfg[0] = oldvalue; + if (F_ISSET(S2C(session), WT_CONN_INCR_BACKUP)) { + WT_ERR(__rename_blkmod(session, oldvalue, buf)); + filecfg[1] = buf->mem; + } else + filecfg[1] = NULL; + WT_ERR(__wt_config_collapse(session, filecfg, &newvalue)); + WT_ERR(__wt_metadata_insert(session, newuri, newvalue)); /* Rename the underlying file. */ WT_ERR(__wt_fs_rename(session, filename, newfile, false)); @@ -68,6 +102,7 @@ __rename_file(WT_SESSION_IMPL *session, const char *uri, const char *newuri) WT_ERR(__wt_meta_track_fileop(session, uri, newuri)); err: + __wt_scr_free(session, &buf); __wt_free(session, newvalue); __wt_free(session, oldvalue); return (ret); diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c index cceccec0ee8..895c555fc44 100644 --- a/src/third_party/wiredtiger/src/session/session_api.c +++ b/src/third_party/wiredtiger/src/session/session_api.c @@ -281,7 +281,10 @@ __session_close(WT_SESSION *wt_session, const char *config) if (conn->txn_global.txn_shared_list != NULL) __wt_txn_release_snapshot(session); - /* Close all open cursors. */ + /* + * Close all open cursors. We don't need to explicitly close the session's pointer to the + * history store cursor since it will also be included in session's cursor table. + */ WT_TRET(__session_close_cursors(session, &session->cursors)); WT_TRET(__session_close_cached_cursors(session)); diff --git a/src/third_party/wiredtiger/src/support/modify.c b/src/third_party/wiredtiger/src/support/modify.c index 7c9f2a373c3..0d22afd615d 100644 --- a/src/third_party/wiredtiger/src/support/modify.c +++ b/src/third_party/wiredtiger/src/support/modify.c @@ -517,6 +517,16 @@ __wt_modify_vector_peek(WT_MODIFY_VECTOR *modifies, WT_UPDATE **updp) } /* + * __wt_modify_vector_clear -- + * Clear a modify vector. + */ +void +__wt_modify_vector_clear(WT_MODIFY_VECTOR *modifies) +{ + modifies->size = 0; +} + +/* * __wt_modify_vector_free -- * Free any resources associated with a modify vector. If we exceeded the allowed stack space on * the vector and had to fallback to dynamic allocations, we'll be doing a free here. diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c index e0999fbf6ba..fce599e6633 100644 --- a/src/third_party/wiredtiger/src/support/stat.c +++ b/src/third_party/wiredtiger/src/support/stat.c @@ -15,8 +15,8 @@ static const char *const __stats_dsrc_desc[] = { "block-manager: file bytes available for reuse", "block-manager: file magic number", "block-manager: file major version number", "block-manager: file size in bytes", "block-manager: minor version number", "btree: btree checkpoint generation", - "btree: column-store fixed-size leaf pages", "btree: column-store internal pages", - "btree: column-store variable-size RLE encoded values", + "btree: btree clean tree checkpoint expiration time", "btree: column-store fixed-size leaf pages", + "btree: column-store internal pages", "btree: column-store variable-size RLE encoded values", "btree: column-store variable-size deleted values", "btree: column-store variable-size leaf pages", "btree: fixed-record size", "btree: maximum internal page key size", "btree: maximum internal page size", @@ -122,7 +122,7 @@ static const char *const __stats_dsrc_desc[] = { "reconciliation: records written including a stop durable timestamp", "reconciliation: records written including a stop timestamp", "reconciliation: records written including a stop transaction ID", "session: object compaction", - "transaction: update conflicts", + "transaction: race to read prepared update retry", "transaction: update conflicts", }; int @@ -186,6 +186,7 @@ __wt_stat_dsrc_clear_single(WT_DSRC_STATS *stats) stats->block_size = 0; stats->block_minor = 0; /* not clearing btree_checkpoint_generation */ + /* not clearing btree_clean_checkpoint_timer */ stats->btree_column_fix = 0; stats->btree_column_internal = 0; stats->btree_column_rle = 0; @@ -343,6 +344,7 @@ __wt_stat_dsrc_clear_single(WT_DSRC_STATS *stats) stats->rec_time_window_stop_ts = 0; stats->rec_time_window_stop_txn = 0; stats->session_compact = 0; + stats->txn_read_race_prepare_update = 0; stats->txn_update_conflict = 0; } @@ -386,6 +388,7 @@ __wt_stat_dsrc_aggregate_single(WT_DSRC_STATS *from, WT_DSRC_STATS *to) if (from->block_minor > to->block_minor) to->block_minor = from->block_minor; to->btree_checkpoint_generation += from->btree_checkpoint_generation; + to->btree_clean_checkpoint_timer += from->btree_clean_checkpoint_timer; to->btree_column_fix += from->btree_column_fix; to->btree_column_internal += from->btree_column_internal; to->btree_column_rle += from->btree_column_rle; @@ -551,6 +554,7 @@ __wt_stat_dsrc_aggregate_single(WT_DSRC_STATS *from, WT_DSRC_STATS *to) to->rec_time_window_stop_ts += from->rec_time_window_stop_ts; to->rec_time_window_stop_txn += from->rec_time_window_stop_txn; to->session_compact += from->session_compact; + to->txn_read_race_prepare_update += from->txn_read_race_prepare_update; to->txn_update_conflict += from->txn_update_conflict; } @@ -587,6 +591,7 @@ __wt_stat_dsrc_aggregate(WT_DSRC_STATS **from, WT_DSRC_STATS *to) if ((v = WT_STAT_READ(from, block_minor)) > to->block_minor) to->block_minor = v; to->btree_checkpoint_generation += WT_STAT_READ(from, btree_checkpoint_generation); + to->btree_clean_checkpoint_timer += WT_STAT_READ(from, btree_clean_checkpoint_timer); to->btree_column_fix += WT_STAT_READ(from, btree_column_fix); to->btree_column_internal += WT_STAT_READ(from, btree_column_internal); to->btree_column_rle += WT_STAT_READ(from, btree_column_rle); @@ -760,6 +765,7 @@ __wt_stat_dsrc_aggregate(WT_DSRC_STATS **from, WT_DSRC_STATS *to) to->rec_time_window_stop_ts += WT_STAT_READ(from, rec_time_window_stop_ts); to->rec_time_window_stop_txn += WT_STAT_READ(from, rec_time_window_stop_txn); to->session_compact += WT_STAT_READ(from, session_compact); + to->txn_read_race_prepare_update += WT_STAT_READ(from, txn_read_race_prepare_update); to->txn_update_conflict += WT_STAT_READ(from, txn_update_conflict); } @@ -841,9 +847,6 @@ static const char *const __stats_connection_desc[] = { "oldest", "cache: hazard pointer blocked page eviction", "cache: hazard pointer check calls", "cache: hazard pointer check entries walked", "cache: hazard pointer maximum array length", - "cache: history store key truncation calls that returned restart", - "cache: history store key truncation due to mixed timestamps", - "cache: history store key truncation due to the key being removed from the data page", "cache: history store score", "cache: history store table insert calls", "cache: history store table insert calls that returned restart", "cache: history store table max on-disk size", "cache: history store table on-disk size", @@ -852,7 +855,13 @@ static const char *const __stats_connection_desc[] = { "cache: history store table out-of-order updates that were fixed up during insertion", "cache: history store table reads", "cache: history store table reads missed", "cache: history store table reads requiring squashed modifies", - "cache: history store table remove calls due to key truncation", + "cache: history store table truncation by rollback to stable to remove an unstable update", + "cache: history store table truncation by rollback to stable to remove an update", + "cache: history store table truncation due to mixed timestamps that returned restart", + "cache: history store table truncation to remove an update", + "cache: history store table truncation to remove range of updates due to key being removed from " + "the data page during reconciliation", + "cache: history store table truncation to remove range of updates due to mixed timestamps", "cache: history store table writes requiring squashed modifies", "cache: in-memory page passed criteria to be split", "cache: in-memory page splits", "cache: internal pages evicted", "cache: internal pages queued for eviction", @@ -1067,6 +1076,7 @@ static const char *const __stats_connection_desc[] = { "transaction: prepared transactions committed", "transaction: prepared transactions currently active", "transaction: prepared transactions rolled back", "transaction: query timestamp calls", + "transaction: race to read prepared update retry", "transaction: read timestamp queue entries walked", "transaction: read timestamp queue insert to empty", "transaction: read timestamp queue inserts to head", @@ -1255,9 +1265,6 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_hazard_checks = 0; stats->cache_hazard_walks = 0; stats->cache_hazard_max = 0; - stats->cache_hs_key_truncate_mix_ts_restart = 0; - stats->cache_hs_key_truncate_mix_ts = 0; - stats->cache_hs_key_truncate_onpage_removal = 0; /* not clearing cache_hs_score */ stats->cache_hs_insert = 0; stats->cache_hs_insert_restart = 0; @@ -1269,7 +1276,12 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_hs_read = 0; stats->cache_hs_read_miss = 0; stats->cache_hs_read_squash = 0; - stats->cache_hs_remove_key_truncate = 0; + stats->cache_hs_key_truncate_rts_unstable = 0; + stats->cache_hs_key_truncate_rts = 0; + stats->cache_hs_key_truncate_mix_ts_restart = 0; + stats->cache_hs_key_truncate = 0; + stats->cache_hs_key_truncate_onpage_removal = 0; + stats->cache_hs_key_truncate_mix_ts = 0; stats->cache_hs_write_squash = 0; stats->cache_inmem_splittable = 0; stats->cache_inmem_split = 0; @@ -1573,6 +1585,7 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->txn_prepare_active = 0; stats->txn_prepare_rollback = 0; stats->txn_query_ts = 0; + stats->txn_read_race_prepare_update = 0; stats->txn_read_queue_walked = 0; stats->txn_read_queue_empty = 0; stats->txn_read_queue_head = 0; @@ -1752,11 +1765,6 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->cache_hazard_walks += WT_STAT_READ(from, cache_hazard_walks); if ((v = WT_STAT_READ(from, cache_hazard_max)) > to->cache_hazard_max) to->cache_hazard_max = v; - to->cache_hs_key_truncate_mix_ts_restart += - WT_STAT_READ(from, cache_hs_key_truncate_mix_ts_restart); - to->cache_hs_key_truncate_mix_ts += WT_STAT_READ(from, cache_hs_key_truncate_mix_ts); - to->cache_hs_key_truncate_onpage_removal += - WT_STAT_READ(from, cache_hs_key_truncate_onpage_removal); to->cache_hs_score += WT_STAT_READ(from, cache_hs_score); to->cache_hs_insert += WT_STAT_READ(from, cache_hs_insert); to->cache_hs_insert_restart += WT_STAT_READ(from, cache_hs_insert_restart); @@ -1769,7 +1777,15 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->cache_hs_read += WT_STAT_READ(from, cache_hs_read); to->cache_hs_read_miss += WT_STAT_READ(from, cache_hs_read_miss); to->cache_hs_read_squash += WT_STAT_READ(from, cache_hs_read_squash); - to->cache_hs_remove_key_truncate += WT_STAT_READ(from, cache_hs_remove_key_truncate); + to->cache_hs_key_truncate_rts_unstable += + WT_STAT_READ(from, cache_hs_key_truncate_rts_unstable); + to->cache_hs_key_truncate_rts += WT_STAT_READ(from, cache_hs_key_truncate_rts); + to->cache_hs_key_truncate_mix_ts_restart += + WT_STAT_READ(from, cache_hs_key_truncate_mix_ts_restart); + to->cache_hs_key_truncate += WT_STAT_READ(from, cache_hs_key_truncate); + to->cache_hs_key_truncate_onpage_removal += + WT_STAT_READ(from, cache_hs_key_truncate_onpage_removal); + to->cache_hs_key_truncate_mix_ts += WT_STAT_READ(from, cache_hs_key_truncate_mix_ts); to->cache_hs_write_squash += WT_STAT_READ(from, cache_hs_write_squash); to->cache_inmem_splittable += WT_STAT_READ(from, cache_inmem_splittable); to->cache_inmem_split += WT_STAT_READ(from, cache_inmem_split); @@ -2091,6 +2107,7 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->txn_prepare_active += WT_STAT_READ(from, txn_prepare_active); to->txn_prepare_rollback += WT_STAT_READ(from, txn_prepare_rollback); to->txn_query_ts += WT_STAT_READ(from, txn_query_ts); + to->txn_read_race_prepare_update += WT_STAT_READ(from, txn_read_race_prepare_update); to->txn_read_queue_walked += WT_STAT_READ(from, txn_read_queue_walked); to->txn_read_queue_empty += WT_STAT_READ(from, txn_read_queue_empty); to->txn_read_queue_head += WT_STAT_READ(from, txn_read_queue_head); diff --git a/src/third_party/wiredtiger/src/support/thread_group.c b/src/third_party/wiredtiger/src/support/thread_group.c index d968ee8c3b8..2ba628f7d1f 100644 --- a/src/third_party/wiredtiger/src/support/thread_group.c +++ b/src/third_party/wiredtiger/src/support/thread_group.c @@ -150,7 +150,7 @@ __thread_group_resize(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint32_t return (0); if (new_min > new_max) - WT_RET_MSG(session, EINVAL, "Illegal thread group resize: %s, from min: %" PRIu32 + WT_ERR_MSG(session, EINVAL, "Illegal thread group resize: %s, from min: %" PRIu32 " -> %" PRIu32 " from max: %" PRIu32 " -> %" PRIu32, group->name, group->min, new_min, group->max, new_max); @@ -158,7 +158,7 @@ __thread_group_resize(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint32_t * Call shrink to reduce the number of thread structures and running threads if required by the * change in group size. */ - WT_RET(__thread_group_shrink(session, group, new_max)); + WT_ERR(__thread_group_shrink(session, group, new_max)); /* * Only reallocate the thread array if it is the largest ever, since our realloc doesn't support @@ -166,7 +166,7 @@ __thread_group_resize(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint32_t */ if (group->alloc < new_max) { alloc = group->alloc * sizeof(*group->threads); - WT_RET(__wt_realloc(session, &alloc, new_max * sizeof(*group->threads), &group->threads)); + WT_ERR(__wt_realloc(session, &alloc, new_max * sizeof(*group->threads), &group->threads)); group->alloc = new_max; } @@ -175,14 +175,10 @@ __thread_group_resize(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint32_t */ for (i = group->max; i < new_max; i++) { WT_ERR(__wt_calloc_one(session, &thread)); - /* - * Threads get their own session and hs table cursor (if the hs table is open). - */ + /* Threads get their own session */ session_flags = LF_ISSET(WT_THREAD_CAN_WAIT) ? WT_SESSION_CAN_WAIT : 0; WT_ERR( __wt_open_internal_session(conn, group->name, false, session_flags, &thread->session)); - if (LF_ISSET(WT_THREAD_HS) && F_ISSET(conn, WT_CONN_HS_OPEN)) - WT_ERR(__wt_hs_cursor_open(thread->session)); if (LF_ISSET(WT_THREAD_PANIC_FAIL)) F_SET(thread, WT_THREAD_PANIC_FAIL); thread->id = i; @@ -247,7 +243,9 @@ __wt_thread_group_resize(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, uint3 __wt_writelock(session, &group->lock); WT_TRET(__thread_group_resize(session, group, new_min, new_max, flags)); - __wt_writeunlock(session, &group->lock); + /* If the resize fails, the thread group is destroyed, including the lock. */ + if (ret == 0) + __wt_writeunlock(session, &group->lock); return (ret); } @@ -282,7 +280,9 @@ __wt_thread_group_create(WT_SESSION_IMPL *session, WT_THREAD_GROUP *group, const group->name = name; WT_TRET(__thread_group_resize(session, group, min, max, flags)); - __wt_writeunlock(session, &group->lock); + /* If the resize fails, the thread group is destroyed, including the lock. */ + if (ret == 0) + __wt_writeunlock(session, &group->lock); /* Cleanup on error to avoid leaking resources */ err: diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c index 1c0be9f8f11..0c3ff78fa74 100644 --- a/src/third_party/wiredtiger/src/txn/txn.c +++ b/src/third_party/wiredtiger/src/txn/txn.c @@ -915,13 +915,13 @@ __txn_resolve_prepared_op(WT_SESSION_IMPL *session, WT_TXN_OP *op, bool commit, WT_UPDATE *fix_upd, *tombstone, *upd; size_t not_used; uint32_t hs_btree_id, session_flags; - bool is_owner, upd_appended; + bool upd_appended; hs_cursor = NULL; txn = session->txn; fix_upd = tombstone = NULL; session_flags = 0; - is_owner = upd_appended = false; + upd_appended = false; WT_RET(__txn_search_prepared_op(session, op, cursorp, &upd)); @@ -953,9 +953,7 @@ __txn_resolve_prepared_op(WT_SESSION_IMPL *session, WT_TXN_OP *op, bool commit, cbt = (WT_CURSOR_BTREE *)(*cursorp); hs_btree_id = S2BT(session)->id; /* Open a history store table cursor. */ - WT_ERR(__wt_hs_cursor(session, &session_flags, &is_owner)); - /* We must be the owner of the history store cursor. */ - WT_ASSERT(session, is_owner); + WT_ERR(__wt_hs_cursor_open(session, &session_flags)); hs_cursor = session->hs_cursor; /* @@ -1045,7 +1043,8 @@ __txn_resolve_prepared_op(WT_SESSION_IMPL *session, WT_TXN_OP *op, bool commit, WT_ERR(__txn_fixup_prepared_update(session, hs_cursor, fix_upd, commit)); err: - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + if (hs_cursor != NULL) + WT_TRET(__wt_hs_cursor_close(session, session_flags)); if (!upd_appended) __wt_free(session, fix_upd); __wt_free(session, tombstone); @@ -1587,10 +1586,13 @@ __wt_txn_prepare(WT_SESSION_IMPL *session, const char *cfg[]) * If there are older updates to this key by the same transaction, set the repeated key * flag on this operation. This is later used in txn commit/rollback so we only resolve * each set of prepared updates once. Skip reserved updates, they're ignored as they're - * simply discarded when we find them. + * simply discarded when we find them. Also ignore updates created by instantiating fast + * truncation pages, they aren't linked into the transaction's modify list and so can't + * be considered. */ for (tmp = upd->next; tmp != NULL && tmp->txnid == upd->txnid; tmp = tmp->next) - if (tmp->type != WT_UPDATE_RESERVE) { + if (tmp->type != WT_UPDATE_RESERVE && + !F_ISSET(tmp, WT_UPDATE_RESTORED_FAST_TRUNCATE)) { F_SET(op, WT_TXN_OP_KEY_REPEATED); break; } diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index d2399f5a649..9b3d1bb51fb 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -616,6 +616,8 @@ __checkpoint_prepare(WT_SESSION_IMPL *session, bool *trackingp, const char *cfg[ txn_global->meta_ckpt_timestamp = txn_global->checkpoint_timestamp; } else if (!F_ISSET(conn, WT_CONN_RECOVERING)) txn_global->meta_ckpt_timestamp = txn_global->recovery_timestamp; + txn_global->checkpoint_oldest_timestamp = + txn_global->has_oldest_timestamp ? txn_global->oldest_timestamp : WT_TS_NONE; } else { if (!F_ISSET(conn, WT_CONN_RECOVERING)) txn_global->meta_ckpt_timestamp = WT_TS_NONE; @@ -1347,17 +1349,16 @@ __checkpoint_lock_dirty_tree( WT_CONFIG_ITEM cval, k, v; WT_DATA_HANDLE *dhandle; WT_DECL_RET; + uint64_t now; char *name_alloc; const char *name; + bool is_drop, is_wt_ckpt, skip_ckpt; btree = S2BT(session); ckpt = ckptbase = NULL; dhandle = session->dhandle; name_alloc = NULL; - /* Only referenced in diagnostic builds. */ - WT_UNUSED(is_checkpoint); - /* * Only referenced in diagnostic builds and gcc 5.1 isn't satisfied with wrapping the entire * assert condition in the unused macro. @@ -1373,21 +1374,57 @@ __checkpoint_lock_dirty_tree( */ WT_ASSERT(session, !need_tracking || WT_IS_METADATA(dhandle) || WT_META_TRACKING(session)); - /* Get the list of checkpoints for this file. */ - WT_RET(__wt_meta_ckptlist_get(session, dhandle->name, true, &ckptbase)); - /* This may be a named checkpoint, check the configuration. */ cval.len = 0; + is_drop = is_wt_ckpt = false; if (cfg != NULL) WT_ERR(__wt_config_gets(session, cfg, "name", &cval)); - if (cval.len == 0) + if (cval.len == 0) { name = WT_CHECKPOINT; - else { + is_wt_ckpt = true; + } else { WT_ERR(__checkpoint_name_ok(session, cval.str, cval.len)); WT_ERR(__wt_strndup(session, cval.str, cval.len, &name_alloc)); name = name_alloc; } + /* + * Determine if a drop is part of the configuration. It usually isn't, so delay processing more + * until we know if we need to process this tree. + */ + if (cfg != NULL) { + cval.len = 0; + WT_ERR(__wt_config_gets(session, cfg, "drop", &cval)); + if (cval.len != 0) + is_drop = true; + } + + /* + * This is a complicated test to determine if we can avoid the expensive call of getting the + * list of checkpoints for this file. We want to avoid that for clean files. But on clean files + * we want to periodically check if we need to delete old checkpoints that may have been in use + * by an open cursor. + */ + if (!btree->modified && !force && is_checkpoint && is_wt_ckpt && !is_drop) { + /* In the common case of the timer set forever, don't even check the time. */ + skip_ckpt = true; + if (btree->clean_ckpt_timer != WT_BTREE_CLEAN_CKPT_FOREVER) { + __wt_seconds(session, &now); + if (now > btree->clean_ckpt_timer) + skip_ckpt = false; + } + if (skip_ckpt) { + F_SET(btree, WT_BTREE_SKIP_CKPT); + goto skip; + } + } + + /* If we have to process this btree for any reason, reset the timer. */ + WT_BTREE_CLEAN_CKPT(session, btree, 0); + + /* Get the list of checkpoints for this file. */ + WT_ERR(__wt_meta_ckptlist_get(session, dhandle->name, true, &ckptbase)); + /* We may be dropping specific checkpoints, check the configuration. */ if (cfg != NULL) { cval.len = 0; @@ -1442,6 +1479,7 @@ __checkpoint_lock_dirty_tree( err: __wt_meta_ckptlist_free(session, &ckptbase); } +skip: __wt_free(session, name_alloc); return (ret); @@ -1456,6 +1494,7 @@ __checkpoint_mark_skip(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, bool force) { WT_BTREE *btree; WT_CKPT *ckpt; + uint64_t timer; int deleted; const char *name; @@ -1500,6 +1539,19 @@ __checkpoint_mark_skip(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, bool force) (WT_PREFIX_MATCH(name, WT_CHECKPOINT) && WT_PREFIX_MATCH((ckpt - 2)->name, WT_CHECKPOINT)))) { F_SET(btree, WT_BTREE_SKIP_CKPT); + /* + * If there are potentially extra checkpoints to delete, we set the timer to recheck + * later. If there are at most two checkpoints, the current one and possibly a previous + * one, then we know there are no additional ones to delete. In that case, set the timer + * to forever. If the table gets dirtied or a checkpoint is forced that will clear the + * timer. + */ + if (ckpt - ckptbase > 2) { + __wt_seconds(session, &timer); + timer += WT_MINUTE * WT_BTREE_CLEAN_MINUTES; + WT_BTREE_CLEAN_CKPT(session, btree, timer); + } else + WT_BTREE_CLEAN_CKPT(session, btree, WT_BTREE_CLEAN_CKPT_FOREVER); return (0); } } diff --git a/src/third_party/wiredtiger/src/txn/txn_recover.c b/src/third_party/wiredtiger/src/txn/txn_recover.c index 2a6d7d12e38..9de0f333193 100644 --- a/src/third_party/wiredtiger/src/txn/txn_recover.c +++ b/src/third_party/wiredtiger/src/txn/txn_recover.c @@ -350,20 +350,50 @@ __txn_log_recover(WT_SESSION_IMPL *session, WT_ITEM *logrec, WT_LSN *lsnp, WT_LS } /* + * __recovery_retrieve_timestamp -- + * Retrieve a timestamp from the metadata. + */ +static int +__recovery_retrieve_timestamp( + WT_RECOVERY *r, const char *system_uri, const char *timestamp_name, wt_timestamp_t *timestampp) +{ + WT_CONFIG_ITEM cval; + WT_DECL_RET; + WT_SESSION_IMPL *session; + char *sys_config; + + sys_config = NULL; + + session = r->session; + + /* Search the metadata for the system information. */ + WT_ERR_NOTFOUND_OK(__wt_metadata_search(session, system_uri, &sys_config), false); + if (sys_config != NULL) { + WT_CLEAR(cval); + WT_ERR_NOTFOUND_OK(__wt_config_getones(session, sys_config, timestamp_name, &cval), false); + if (cval.len != 0) { + __wt_verbose(session, WT_VERB_RECOVERY, "Recovery %s %.*s", timestamp_name, + (int)cval.len, cval.str); + WT_ERR(__wt_txn_parse_timestamp_raw(session, timestamp_name, timestampp, &cval)); + } + } + +err: + __wt_free(session, sys_config); + return (ret); +} + +/* * __recovery_set_checkpoint_timestamp -- * Set the checkpoint timestamp as retrieved from the metadata file. */ static int __recovery_set_checkpoint_timestamp(WT_RECOVERY *r) { - WT_CONFIG_ITEM cval; WT_CONNECTION_IMPL *conn; - WT_DECL_RET; WT_SESSION_IMPL *session; wt_timestamp_t ckpt_timestamp; - char ts_string[WT_TS_INT_STRING_SIZE], *sys_config; - - sys_config = NULL; + char ts_string[WT_TS_INT_STRING_SIZE]; session = r->session; conn = S2C(session); @@ -373,18 +403,8 @@ __recovery_set_checkpoint_timestamp(WT_RECOVERY *r) */ ckpt_timestamp = 0; - /* Search in the metadata for the system information. */ - WT_ERR_NOTFOUND_OK(__wt_metadata_search(session, WT_SYSTEM_CKPT_URI, &sys_config), false); - if (sys_config != NULL) { - WT_CLEAR(cval); - WT_ERR_NOTFOUND_OK( - __wt_config_getones(session, sys_config, "checkpoint_timestamp", &cval), false); - if (cval.len != 0) { - __wt_verbose( - session, WT_VERB_RECOVERY, "Recovery timestamp %.*s", (int)cval.len, cval.str); - WT_ERR(__wt_txn_parse_timestamp_raw(session, "recovery", &ckpt_timestamp, &cval)); - } - } + WT_RET( + __recovery_retrieve_timestamp(r, WT_SYSTEM_CKPT_URI, WT_SYSTEM_CKPT_TS, &ckpt_timestamp)); /* * Set the recovery checkpoint timestamp and the metadata checkpoint timestamp so that the @@ -396,9 +416,39 @@ __recovery_set_checkpoint_timestamp(WT_RECOVERY *r) "Set global recovery timestamp: %s", __wt_timestamp_to_string(conn->txn_global.recovery_timestamp, ts_string)); -err: - __wt_free(session, sys_config); - return (ret); + return (0); +} + +/* + * __recovery_set_oldest_timestamp -- + * Set the oldest timestamp as retrieved from the metadata file. + */ +static int +__recovery_set_oldest_timestamp(WT_RECOVERY *r) +{ + WT_CONNECTION_IMPL *conn; + WT_SESSION_IMPL *session; + wt_timestamp_t oldest_timestamp; + char ts_string[WT_TS_INT_STRING_SIZE]; + + session = r->session; + conn = S2C(session); + /* + * Read the system checkpoint information from the metadata file and save the oldest timestamp + * of the last checkpoint for later query. This gets saved in the connection. + */ + oldest_timestamp = 0; + + WT_RET(__recovery_retrieve_timestamp( + r, WT_SYSTEM_OLDEST_URI, WT_SYSTEM_OLDEST_TS, &oldest_timestamp)); + conn->txn_global.oldest_timestamp = oldest_timestamp; + conn->txn_global.has_oldest_timestamp = oldest_timestamp != WT_TS_NONE; + + __wt_verbose(session, WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS, + "Set global oldest timestamp: %s", + __wt_timestamp_to_string(conn->txn_global.oldest_timestamp, ts_string)); + + return (0); } /* @@ -768,7 +818,7 @@ __wt_txn_recover(WT_SESSION_IMPL *session, const char *cfg[]) done: WT_ERR(__recovery_set_checkpoint_timestamp(&r)); - + WT_ERR(__recovery_set_oldest_timestamp(&r)); /* * Perform rollback to stable only when the following conditions met. * 1. The connection is not read-only. A read-only connection expects that there shouldn't be @@ -797,11 +847,8 @@ done: * written. The rollback to stable operation should only rollback the latest page changes * solely based on the write generation numbers. */ - WT_ASSERT(session, conn->txn_global.has_stable_timestamp == false && conn->txn_global.stable_timestamp == WT_TS_NONE); - WT_ASSERT(session, conn->txn_global.has_oldest_timestamp == false && - conn->txn_global.oldest_timestamp == WT_TS_NONE); /* * Set the stable timestamp from recovery timestamp and process the trees for rollback to @@ -810,12 +857,6 @@ done: conn->txn_global.stable_timestamp = conn->txn_global.recovery_timestamp; conn->txn_global.has_stable_timestamp = true; - /* - * Set the oldest timestamp to WT_TS_NONE to make sure that we didn't remove any history - * window as part of rollback to stable operation. - */ - conn->txn_global.oldest_timestamp = WT_TS_NONE; - conn->txn_global.has_oldest_timestamp = true; __wt_verbose(session, WT_VERB_RTS, "Performing recovery rollback_to_stable with stable timestamp: %s and oldest timestamp: " "%s", @@ -823,10 +864,6 @@ done: __wt_timestamp_to_string(conn->txn_global.oldest_timestamp, ts_string[1])); WT_ERR(__wt_rollback_to_stable(session, NULL, false)); - - /* Reset the oldest timestamp. */ - conn->txn_global.oldest_timestamp = WT_TS_NONE; - conn->txn_global.has_oldest_timestamp = false; } else if (do_checkpoint) /* * Forcibly log a checkpoint so the next open is fast and keep the metadata up to date with diff --git a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c index de53843e3c9..2c97ddf48c7 100644 --- a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c +++ b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c @@ -169,7 +169,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW uint8_t type; int cmp; char ts_string[4][WT_TS_INT_STRING_SIZE]; - bool is_owner, valid_update_found; + bool valid_update_found; #ifdef HAVE_DIAGNOSTIC bool first_record; #endif @@ -180,7 +180,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW hs_btree_id = S2BT(session)->id; session_flags = 0; WT_CLEAR(full_value); - is_owner = valid_update_found = false; + valid_update_found = false; #ifdef HAVE_DIAGNOSTIC first_record = true; #endif @@ -200,7 +200,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW newer_hs_durable_ts = unpack->tw.durable_start_ts; /* Open a history store table cursor. */ - WT_ERR(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_ERR(__wt_hs_cursor_open(session, &session_flags)); hs_cursor = session->hs_cursor; cbt = (WT_CURSOR_BTREE *)hs_cursor; @@ -317,6 +317,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW WT_ERR(__wt_upd_alloc_tombstone(session, &hs_upd, NULL)); WT_ERR(__wt_hs_modify(cbt, hs_upd)); WT_STAT_CONN_INCR(session, txn_rts_hs_removed); + WT_STAT_CONN_INCR(session, cache_hs_key_truncate_rts_unstable); } if (replace) { @@ -381,6 +382,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW WT_ERR(__wt_upd_alloc_tombstone(session, &hs_upd, NULL)); WT_ERR(__wt_hs_modify(cbt, hs_upd)); WT_STAT_CONN_INCR(session, txn_rts_hs_removed); + WT_STAT_CONN_INCR(session, cache_hs_key_truncate_rts); } if (0) { @@ -393,7 +395,7 @@ err: __wt_scr_free(session, &hs_value); __wt_scr_free(session, &key); __wt_buf_free(session, &full_value); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); return (ret); } @@ -433,7 +435,7 @@ __rollback_abort_row_ondisk_kv( } else return (0); } else if (vpack->tw.durable_start_ts > rollback_timestamp || - (vpack->tw.durable_stop_ts == WT_TS_NONE && prepared)) { + (!WT_TIME_WINDOW_HAS_STOP(&vpack->tw) && prepared)) { __wt_verbose(session, WT_VERB_RTS, "on-disk update aborted with start durable timestamp: %s, commit timestamp: %s, " "prepared: %s and stable timestamp: %s", @@ -450,23 +452,19 @@ __rollback_abort_row_ondisk_kv( WT_RET(__wt_upd_alloc_tombstone(session, &upd, NULL)); WT_STAT_CONN_INCR(session, txn_rts_keys_removed); } - } else if (vpack->tw.durable_stop_ts != WT_TS_NONE && + } else if (WT_TIME_WINDOW_HAS_STOP(&vpack->tw) && (vpack->tw.durable_stop_ts > rollback_timestamp || prepared)) { /* * Clear the remove operation from the key by inserting the original on-disk value as a * standard update. - * - * Take the value from the original page cell. If a value is simple(no compression), and is - * globally visible at the time of reading a page into cache, we encode its location into - * the WT_ROW. Otherwise, read it from the page. */ - if (!__wt_row_leaf_value(page, rip, &buf)) - WT_RET(__wt_page_cell_data_ref(session, page, vpack, &buf)); + WT_RET(__wt_page_cell_data_ref(session, page, vpack, &buf)); WT_ERR(__wt_upd_alloc(session, &buf, WT_UPDATE_STANDARD, &upd, NULL)); upd->txnid = vpack->tw.start_txn; upd->durable_ts = vpack->tw.durable_start_ts; upd->start_ts = vpack->tw.start_ts; + F_SET(upd, WT_UPDATE_RESTORED_FROM_DS); WT_STAT_CONN_INCR(session, txn_rts_keys_restored); __wt_verbose(session, WT_VERB_RTS, "key restored with commit timestamp: %s, durable timestamp: %s txnid: %" PRIu64 @@ -992,18 +990,16 @@ __rollback_to_stable_btree_hs_truncate(WT_SESSION_IMPL *session, uint32_t btree_ uint32_t hs_btree_id, session_flags; int exact; char ts_string[WT_TS_INT_STRING_SIZE]; - bool is_owner; hs_cursor = NULL; WT_CLEAR(key); hs_upd = NULL; session_flags = 0; - is_owner = false; WT_RET(__wt_scr_alloc(session, 0, &hs_key)); /* Open a history store table cursor. */ - WT_ERR(__wt_hs_cursor(session, &session_flags, &is_owner)); + WT_ERR(__wt_hs_cursor_open(session, &session_flags)); hs_cursor = session->hs_cursor; cbt = (WT_CURSOR_BTREE *)hs_cursor; @@ -1044,6 +1040,7 @@ __rollback_to_stable_btree_hs_truncate(WT_SESSION_IMPL *session, uint32_t btree_ WT_ERR(__wt_upd_alloc_tombstone(session, &hs_upd, NULL)); WT_ERR(__wt_hs_modify(cbt, hs_upd)); WT_STAT_CONN_INCR(session, txn_rts_hs_removed); + WT_STAT_CONN_INCR(session, cache_hs_key_truncate_rts); hs_upd = NULL; } WT_ERR_NOTFOUND_OK(ret, false); @@ -1051,7 +1048,7 @@ __rollback_to_stable_btree_hs_truncate(WT_SESSION_IMPL *session, uint32_t btree_ err: __wt_scr_free(session, &hs_key); __wt_free(session, hs_upd); - WT_TRET(__wt_hs_cursor_close(session, session_flags, is_owner)); + WT_TRET(__wt_hs_cursor_close(session, session_flags)); return (ret); } diff --git a/src/third_party/wiredtiger/test/csuite/incr_backup/main.c b/src/third_party/wiredtiger/test/csuite/incr_backup/main.c index e260081b78c..0dd403be91e 100644 --- a/src/third_party/wiredtiger/test/csuite/incr_backup/main.c +++ b/src/third_party/wiredtiger/test/csuite/incr_backup/main.c @@ -59,7 +59,7 @@ static void usage(void) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); static bool slow_incremental = false; static bool do_drop = true; -static bool do_rename = false; +static bool do_rename = true; #define VERBOSE(level, fmt, ...) \ do { \ @@ -547,7 +547,7 @@ reopen_file(int *fdp, char *buf, size_t buflen, const char *filename, int oflag) */ static void incr_backup(WT_CONNECTION *conn, const char *home, const char *backup_home, TABLE_INFO *tinfo, - ACTIVE_FILES *master_active) + ACTIVE_FILES *current_active) { ACTIVE_FILES active; WT_CURSOR *cursor, *file_cursor; @@ -560,7 +560,7 @@ incr_backup(WT_CONNECTION *conn, const char *home, const char *backup_home, TABL char *filename; VERBOSE(2, "INCREMENTAL BACKUP: %s\n", backup_home); - active_files_print(master_active, "master list before incremental backup"); + active_files_print(current_active, "current list before incremental backup"); WT_CLEAR(rbuf); WT_CLEAR(wbuf); rfd = wfd = -1; @@ -637,10 +637,10 @@ incr_backup(WT_CONNECTION *conn, const char *home, const char *backup_home, TABL VERBOSE(2, " finished incremental backup: %d files, %d range copy, %d file copy\n", nfiles, nrange, ncopy); active_files_sort(&active); - active_files_remove_missing(master_active, &active, backup_home); + active_files_remove_missing(current_active, &active, backup_home); - /* Move the current active list to the master list */ - active_files_move(master_active, &active); + /* Move the active list to the current list. */ + active_files_move(current_active, &active); } static void diff --git a/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c b/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c index ff59c66fbb7..9005c474801 100644 --- a/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c @@ -44,8 +44,8 @@ static void *thread_insert(void *); static void *thread_get(void *); #define BLOOM false -#define GAP_DISPLAY 5 /* Threshold for seconds of gap to be displayed */ -#define GAP_ERROR 25 /* Threshold for seconds of gap to be treated as error */ +#define GAP_DISPLAY 3 /* Threshold for seconds of gap to be displayed */ +#define GAP_ERROR 7 /* Threshold for seconds of gap to be treated as error */ #define N_RECORDS 10000 #define N_INSERT 1000000 #define N_INSERT_THREAD 1 diff --git a/src/third_party/wiredtiger/test/csuite/wt4333_handle_locks/main.c b/src/third_party/wiredtiger/test/csuite/wt4333_handle_locks/main.c index 9a263eb9ef6..b91d3c2222e 100644 --- a/src/third_party/wiredtiger/test/csuite/wt4333_handle_locks/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt4333_handle_locks/main.c @@ -259,7 +259,7 @@ runone(bool config_cache) testutil_check(__wt_snprintf(buf, sizeof(buf), "create" ", cache_cursors=%s" - ", cache_size=5GB" + ", cache_size=1GB" ", checkpoint_sync=true" ", eviction=(threads_max=5)" ", file_manager=(" @@ -306,10 +306,8 @@ run(int argc, char *argv[]) bool cache_cursors; } runs[] = { {1, 1, false}, {1, 1, true}, {8, 1, false}, {8, 1, true}, {16, 1, false}, {16, 1, true}, - {16, WT_ELEMENTS(uri_list), false}, {16, WT_ELEMENTS(uri_list), true}, {200, 100, false}, - {200, 100, true}, {200, WT_ELEMENTS(uri_list), false}, {200, WT_ELEMENTS(uri_list), true}, - {300, 100, false}, {300, 100, true}, {600, WT_ELEMENTS(uri_list), false}, - {600, WT_ELEMENTS(uri_list), true}, + {16, WT_ELEMENTS(uri_list), false}, {16, WT_ELEMENTS(uri_list), true}, {64, 100, false}, + {64, 100, true}, {64, WT_ELEMENTS(uri_list), false}, {64, WT_ELEMENTS(uri_list), true}, }; WT_RAND_STATE rnd; u_int i, n; diff --git a/src/third_party/wiredtiger/test/evergreen.yml b/src/third_party/wiredtiger/test/evergreen.yml index 9bf45be39dd..68ac9001277 100755 --- a/src/third_party/wiredtiger/test/evergreen.yml +++ b/src/third_party/wiredtiger/test/evergreen.yml @@ -55,7 +55,7 @@ functions: set -o verbose if [ "$OS" != "Windows_NT" ]; then sh reconf - ${configure_env_vars|CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-ggdb -fPIC"} \ + ${configure_env_vars|CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="-ggdb -fPIC"} \ ../configure ${configure_python_setting|} \ ${posix_configure_flags|--enable-silent-rules --enable-diagnostic --enable-python --enable-zlib --enable-strict --enable-static --prefix=$(pwd)/LOCAL_INSTALL} fi @@ -122,7 +122,7 @@ functions: set -o verbose sh reconf if [ "$OS" != "Windows_NT" ]; then - CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-ggdb -fPIC" \ + CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="-ggdb -fPIC" \ ../configure ${configure_python_setting|} \ --enable-strict --enable-diagnostic --with-builtins=lz4,snappy,zlib fi @@ -262,7 +262,7 @@ functions: permissions: public-read content_type: application/tar display_name: Artifacts - remote_file: wiredtiger/${build_variant}/${revision}/artifacts/${task_name}_${build_id}.tgz + remote_file: wiredtiger/${build_variant}/${revision}/artifacts/${task_name}_${build_id}${postfix|}.tgz "cleanup": command: shell.exec params: @@ -371,7 +371,7 @@ variables: configure_env_vars: CC="/opt/mongodbtoolchain/v3/bin/clang -fsanitize=address" PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-ggdb -fPIC -fno-omit-frame-pointer" - posix_configure_flags: --enable-diagnostic --with-builtins=lz4,snappy,zlib + posix_configure_flags: --enable-strict --enable-diagnostic --with-builtins=lz4,snappy,zlib - func: "format test script" vars: format_test_script_args: -R -t 360 @@ -388,12 +388,14 @@ variables: posix_configure_flags: --enable-strict --enable-diagnostic --with-builtins=lz4,snappy,zlib - func: "recovery stress test script" vars: - times: 40 + times: 25 pre: - func: "cleanup" post: - func: "upload artifact" + vars: + postfix: -${execution} - func: "cleanup" tasks: @@ -403,6 +405,8 @@ tasks: commands: - func: "get project" - func: "compile wiredtiger" + - func: "upload artifact" + - func: "cleanup" - name: compile-asan tags: ["pull_request"] @@ -412,6 +416,8 @@ tasks: vars: configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/clang CXX=/opt/mongodbtoolchain/v3/bin/clang++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-fsanitize=address -fno-omit-frame-pointer -ggdb" posix_configure_flags: --enable-silent-rules --enable-strict --enable-diagnostic --disable-static + - func: "upload artifact" + - func: "cleanup" - name: compile-msan commands: @@ -420,6 +426,8 @@ tasks: vars: configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/clang CXX=/opt/mongodbtoolchain/v3/bin/clang++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-fsanitize=memory -ggdb" posix_configure_flags: --enable-silent-rules --enable-strict --enable-diagnostic --disable-static + - func: "upload artifact" + - func: "cleanup" - name: compile-ubsan commands: @@ -428,6 +436,8 @@ tasks: vars: configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-fsanitize=undefined -ggdb" posix_configure_flags: --enable-silent-rules --enable-strict --enable-diagnostic + - func: "upload artifact" + - func: "cleanup" # production build with --disable-shared - name: compile-production-disable-shared @@ -437,6 +447,8 @@ tasks: - func: "compile wiredtiger" vars: posix_configure_flags: --enable-silent-rules --enable-strict --disable-shared + - func: "upload artifact" + - func: "cleanup" # production build with --disable-static - name: compile-production-disable-static @@ -446,6 +458,8 @@ tasks: - func: "compile wiredtiger" vars: posix_configure_flags: --enable-silent-rules --enable-strict --disable-static --enable-lz4 --enable-snappy --enable-zlib --enable-zstd --enable-python + - func: "upload artifact" + - func: "cleanup" - name: compile-linux-no-ftruncate commands: @@ -453,6 +467,8 @@ tasks: - func: "compile wiredtiger no linux ftruncate" vars: posix_configure_flags: --enable-silent-rules --enable-diagnostic --enable-strict --enable-python + - func: "upload artifact" + - func: "cleanup" - name: compile-wtperf commands: @@ -460,6 +476,8 @@ tasks: - func: "compile wiredtiger" vars: posix_configure_flags: --enable-strict --enable-diagnostic + - func: "upload artifact" + - func: "cleanup" - name: compile-gcc tags: ["pull_request", "pull_request_compilers"] @@ -467,25 +485,25 @@ tasks: - func: "get project" - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-4.8 CXX=g++-4.8 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=gcc-4.8 CXX=g++-4.8 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-5 CXX=g++-5 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=gcc-5 CXX=g++-5 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-6 CXX=g++-6 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=gcc-6 CXX=g++-6 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-6 CXX=g++-6 CFLAGS="-ggdb -fPIC" CPPFLAGS=-fvisibility=hidden + configure_env_vars: CC=gcc-6 CXX=g++-6 ADD_CFLAGS="-ggdb -fPIC" CPPFLAGS=-fvisibility=hidden - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-7 CXX=g++-7 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=gcc-7 CXX=g++-7 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-8 CXX=g++-8 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=gcc-8 CXX=g++-8 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=gcc-9 CXX=g++-9 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=gcc-9 CXX=g++-9 ADD_CFLAGS="-ggdb -fPIC" - name: compile-clang tags: ["pull_request", "pull_request_compilers"] @@ -493,22 +511,22 @@ tasks: - func: "get project" - func: "compile wiredtiger" vars: - configure_env_vars: CC=clang-3.9 CXX=clang++-3.9 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=clang-3.9 CXX=clang++-3.9 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=clang-4.0 CXX=clang++-4.0 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=clang-4.0 CXX=clang++-4.0 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=clang-5.0 CXX=clang++-5.0 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=clang-5.0 CXX=clang++-5.0 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=clang-6.0 CXX=clang++-6.0 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=clang-6.0 CXX=clang++-6.0 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=clang-7 CXX=clang++-7 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=clang-7 CXX=clang++-7 ADD_CFLAGS="-ggdb -fPIC" - func: "compile wiredtiger" vars: - configure_env_vars: CC=clang-8 CXX=clang++-8 CFLAGS="-ggdb -fPIC" + configure_env_vars: CC=clang-8 CXX=clang++-8 ADD_CFLAGS="-ggdb -fPIC" - name: make-check-test depends_on: @@ -770,6 +788,8 @@ tasks: - name: compile-ubsan commands: - func: "fetch artifacts" + vars: + dependent_task: compile-ubsan - func: "compile wiredtiger" vars: configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-fsanitize=undefined -ggdb" @@ -1782,8 +1802,8 @@ tasks: # Handle special build combination for running all the diagnostic tests. - func: "configure wiredtiger" vars: - configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-g -Werror" - posix_configure_flags: --enable-silent-rules --enable-diagnostic --disable-static + configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="-g -Werror" + posix_configure_flags: --enable-silent-rules --enable-strict --enable-diagnostic --disable-static - func: "make wiredtiger" vars: make_command: make all @@ -1874,7 +1894,7 @@ tasks: - func: "get project" - func: "compile wiredtiger" vars: - configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="--coverage -fPIC -ggdb" LDFLAGS=--coverage + configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="--coverage -fPIC -ggdb" LDFLAGS=--coverage posix_configure_flags: --enable-silent-rules --enable-diagnostic --enable-strict --enable-python --with-builtins=lz4,snappy,zlib - func: "make check all" - func: "unit test" @@ -1930,7 +1950,7 @@ tasks: permissions: public-read content_type: text/html display_name: Coverage report - remote_file: wiredtiger/${build_variant}/${revision}/coverage_report/coverage_report_${build_id}.html + remote_file: wiredtiger/${build_variant}/${revision}/coverage_report/coverage_report_${build_id}-${execution}.html - name: spinlock-gcc-test commands: @@ -1982,7 +2002,7 @@ tasks: - func: "get project" - func: "compile wiredtiger" vars: - posix_configure_flags: ac_cv_func_ftruncate=no + posix_configure_flags: --enable-strict ac_cv_func_ftruncate=no - command: shell.exec params: working_dir: "wiredtiger/build_posix" @@ -1998,8 +2018,8 @@ tasks: - func: "get project" - func: "configure wiredtiger" vars: - configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-g -Werror" - posix_configure_flags: --enable-silent-rules --enable-diagnostic --disable-static + configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="-g -Werror" + posix_configure_flags: --enable-silent-rules --enable-strict --enable-diagnostic --disable-static - func: "make wiredtiger" # Run the long version of make check, that includes the full csuite tests @@ -2121,7 +2141,7 @@ tasks: - func: "get project" - func: "compile wiredtiger" vars: - posix_configure_flags: --disable-shared --with-builtins=snappy,zlib + posix_configure_flags: --enable-strict --disable-shared --with-builtins=snappy,zlib - command: shell.exec params: working_dir: "wiredtiger/build_posix" @@ -2133,7 +2153,7 @@ tasks: # Delete wt util rm -f wt # Build static wt util - make CC='eval "g++ -static"' ${smp_command|} + ${make_command|make} CC='eval "g++ -static"' ${smp_command|} # -V option displays Wiredtiger library version ./wt -V @@ -2185,7 +2205,7 @@ tasks: vars: configure_env_vars: CXX=/opt/mongodbtoolchain/v3/bin/g++ - PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-ggdb -fPIC" + PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="-ggdb -fPIC" - command: shell.exec params: working_dir: "wiredtiger/bench/workgen/runner" @@ -2313,6 +2333,9 @@ tasks: - <<: *recovery-stress-test name: recovery-stress-test-2 tags: ["stress-test-2", "stress-test-zseries-2"] + - <<: *recovery-stress-test + name: recovery-stress-test-3 + tags: ["stress-test-3", "stress-test-zseries-3"] buildvariants: @@ -2488,7 +2511,7 @@ buildvariants: run_on: - macos-1012 expansions: - configure_env_vars: PATH=/opt/mongodbtoolchain/v3/bin:$PATH CFLAGS="-ggdb -fPIC" + configure_env_vars: PATH=/opt/mongodbtoolchain/v3/bin:$PATH ADD_CFLAGS="-ggdb -fPIC" posix_configure_flags: --enable-silent-rules --enable-diagnostic --enable-python --enable-zlib --enable-strict --enable-static --prefix=$(pwd)/LOCAL_INSTALL smp_command: -j $(sysctl -n hw.logicalcpu) make_command: PATH=/opt/mongodbtoolchain/v3/bin:$PATH ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future make @@ -2568,3 +2591,4 @@ buildvariants: - name: unit-test - name: ".stress-test-zseries-1" - name: ".stress-test-zseries-2" + - name: ".stress-test-zseries-3" diff --git a/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh b/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh index 5a396aad3dc..551bbd78764 100755 --- a/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh +++ b/src/third_party/wiredtiger/test/evergreen/compatibility_test_for_releases.sh @@ -14,6 +14,7 @@ bflag() { # Return if the branch's format command takes the -B flag for backward compatibility. test "$1" = "develop" && echo "-B " + test "$1" = "mongodb-4.6" && echo "-B " test "$1" = "mongodb-4.4" && echo "-B " return 0 } @@ -186,10 +187,11 @@ cd "$top" if [ "$long" = true ]; then (build_branch mongodb-3.4) (build_branch mongodb-3.6) + (build_branch mongodb-4.0) fi -(build_branch mongodb-4.0) (build_branch mongodb-4.2) (build_branch mongodb-4.4) +(build_branch mongodb-4.6) (build_branch develop) # Get the names of the last two WiredTiger releases, wt1 is the most recent release, wt2 is the @@ -206,10 +208,11 @@ fi if [ "$long" = true ]; then (run_format mongodb-3.4 "fix row var") (run_format mongodb-3.6 "fix row var") + (run_format mongodb-4.0 "fix row var") fi -(run_format mongodb-4.0 "fix row var") (run_format mongodb-4.2 "fix row var") (run_format mongodb-4.4 "row") +(run_format mongodb-4.6 "row") (run_format develop "row") if [ "$long" = true ]; then (run_format "$wt1" "fix row var") @@ -220,11 +223,11 @@ fi if [ "$long" = true ]; then (verify_branches mongodb-3.6 mongodb-3.4 "fix row var") (verify_branches mongodb-4.0 mongodb-3.6 "fix row var") + (verify_branches mongodb-4.2 mongodb-4.0 "fix row var") fi -(verify_branches mongodb-4.2 mongodb-4.0 "fix row var") (verify_branches mongodb-4.4 mongodb-4.2 "fix row var") -(verify_branches develop mongodb-4.4 "row") -(verify_branches develop mongodb-4.2 "row") +(verify_branches mongodb-4.6 mongodb-4.4 "row") +(verify_branches develop mongodb-4.6 "row") if [ "$long" = true ]; then (verify_branches "$wt1" "$wt2" "row") (verify_branches develop "$wt1" "row") @@ -232,12 +235,12 @@ fi # Verify forward compatibility for supported access methods. (verify_branches mongodb-4.2 mongodb-4.4 "row") -(verify_branches mongodb-4.2 develop "row") -(verify_branches mongodb-4.4 develop "row") +(verify_branches mongodb-4.4 mongodb-4.6 "row") +(verify_branches mongodb-4.6 develop "row") # Upgrade/downgrade testing for supported access methods. (upgrade_downgrade mongodb-4.2 mongodb-4.4 "row") -(upgrade_downgrade mongodb-4.2 develop "row") -(upgrade_downgrade mongodb-4.4 develop "row") +(upgrade_downgrade mongodb-4.4 mongodb-4.6"row") +(upgrade_downgrade mongodb-4.6 develop "row") exit 0 diff --git a/src/third_party/wiredtiger/test/format/bulk.c b/src/third_party/wiredtiger/test/format/bulk.c index 72c17366639..bfbddaffaa5 100644 --- a/src/third_party/wiredtiger/test/format/bulk.c +++ b/src/third_party/wiredtiger/test/format/bulk.c @@ -171,8 +171,12 @@ wts_load(void) break; } - /* Restart the enclosing transaction every 5K operations so we don't overflow the cache. */ - if (keyno % 5000 == 0) { + /* + * When first starting up, restart the enclosing transaction every 10 operations so we never + * end up with an empty object. After 5K records, restart the transaction every 5K records + * so we don't overflow the cache. + */ + if ((keyno < 5000 && keyno % 10 == 0) || keyno % 5000 == 0) { /* Report on progress. */ track("bulk load", keyno, NULL); @@ -190,6 +194,8 @@ wts_load(void) * aren't surprised). */ if (keyno != g.c_rows + 1) { + testutil_assert(committed_keyno > 0); + g.rows = committed_keyno; g.c_rows = (uint32_t)committed_keyno; config_print(false); diff --git a/src/third_party/wiredtiger/test/format/format.h b/src/third_party/wiredtiger/test/format/format.h index 5b4e8589b8c..4f7db16a3c0 100644 --- a/src/third_party/wiredtiger/test/format/format.h +++ b/src/third_party/wiredtiger/test/format/format.h @@ -402,6 +402,7 @@ void operations(u_int, bool); void path_setup(const char *); void set_alarm(u_int); void set_core_off(void); +void set_oldest_timestamp(void); void snap_init(TINFO *); void snap_teardown(TINFO *); void snap_op_init(TINFO *, uint64_t, bool); diff --git a/src/third_party/wiredtiger/test/format/t.c b/src/third_party/wiredtiger/test/format/t.c index 11d3d48db32..fadbb1c79c9 100644 --- a/src/third_party/wiredtiger/test/format/t.c +++ b/src/third_party/wiredtiger/test/format/t.c @@ -165,6 +165,8 @@ main(int argc, char *argv[]) format_process_env(); + __wt_random_init_seed(NULL, &g.rnd); /* Initialize the RNG. */ + /* Set values from the command line. */ home = NULL; one_flag = quiet_flag = false; @@ -256,8 +258,6 @@ main(int argc, char *argv[]) */ ops_seconds = g.c_timer == 0 ? 0 : ((g.c_timer * 60) - 15) / FORMAT_OPERATION_REPS; - __wt_random_init_seed(NULL, &g.rnd); /* Initialize the RNG. */ - testutil_check(__wt_thread_str(g.tidbuf, sizeof(g.tidbuf))); while (++g.run_cnt <= g.c_runs || g.c_runs == 0) { @@ -269,6 +269,7 @@ main(int argc, char *argv[]) if (g.reopen) { config_final(); wts_open(g.home, &g.wts_conn, &g.wts_session, true); + set_oldest_timestamp(); } else { wts_create(g.home); config_final(); diff --git a/src/third_party/wiredtiger/test/format/util.c b/src/third_party/wiredtiger/test/format/util.c index d2ae281e281..069340df59b 100644 --- a/src/third_party/wiredtiger/test/format/util.c +++ b/src/third_party/wiredtiger/test/format/util.c @@ -303,7 +303,8 @@ timestamp_parse(WT_SESSION *session, const char *str, uint64_t *tsp) char *p; *tsp = strtoull(str, &p, 16); - WT_ASSERT((WT_SESSION_IMPL *)session, p - str <= 16); + if (session != NULL) + WT_ASSERT((WT_SESSION_IMPL *)session, p - str <= 16); } /* @@ -356,6 +357,39 @@ timestamp(void *arg) } /* + * set_oldest_timestamp -- + * Query the oldest timestamp from wiredtiger and set it as our global oldest timestamp. This + * should only be called on runs for pre existing databases. + */ +void +set_oldest_timestamp(void) +{ + static const char *oldest_timestamp_str = "oldest_timestamp="; + + WT_CONNECTION *conn; + WT_DECL_RET; + uint64_t oldest_ts; + char buf[WT_TS_HEX_STRING_SIZE * 2 + 64], tsbuf[WT_TS_HEX_STRING_SIZE]; + + conn = g.wts_conn; + + if ((ret = conn->query_timestamp(conn, tsbuf, "get=oldest")) == 0) { + timestamp_parse(NULL, tsbuf, &oldest_ts); + g.timestamp = oldest_ts; + testutil_check( + __wt_snprintf(buf, sizeof(buf), "%s%" PRIx64, oldest_timestamp_str, g.oldest_timestamp)); + } else if (ret != WT_NOTFOUND) + /* + * Its possible there may not be an oldest timestamp as such we could get not found. This + * should be okay assuming timestamps are not configured if they are, it's still okay as we + * could have configured timestamps after not running with timestamps. As such only error if + * we get a non not found error. If we were supposed to fail with not found we'll see an + * error later on anyway. + */ + testutil_die(ret, "unable to query oldest timestamp"); +} + +/* * lock_init -- * Initialize abstract lock that can use either pthread of wt reader-writer locks. */ diff --git a/src/third_party/wiredtiger/test/suite/test_bug019.py b/src/third_party/wiredtiger/test/suite/test_bug019.py index abf68827959..a5af1f33d0d 100644..100755 --- a/src/third_party/wiredtiger/test/suite/test_bug019.py +++ b/src/third_party/wiredtiger/test/suite/test_bug019.py @@ -37,6 +37,7 @@ class test_bug019(wttest.WiredTigerTestCase): conn_config = 'log=(enabled,file_max=100K),statistics=(fast)' uri = "table:bug019" entries = 5000 + max_initial_entries = 50000 max_prealloc = 1 # Modify rows so we write log records. We're writing a lot more than a @@ -51,15 +52,20 @@ class test_bug019(wttest.WiredTigerTestCase): def populate(self, nentries): c = self.session.open_cursor(self.uri, None, None) for i in range(0, nentries): - # Make the values about 200 bytes. That's about 1MB of data for - # 5000 records, generating 10 log files used plus more for overhead. - c[i] = "abcde" * 40 - if i % 500 == 0: + # Make the values about 2000 bytes. When called with 5000 records + # that's about 10MB of data, generating 100 log files used plus more for overhead. + # Typically the huge traffic causes the preallocation statistic to + # increase. We'll quit when it does, as that's our goal here. + # For the initial populate, we'll insert up to 10x as many records, + # so up to 1000 log files. + c[i] = "abcde" * 400 + if i % 50 == 0: prealloc = self.get_prealloc_stat() if prealloc > self.max_prealloc: - self.pr("Updating max_prealloc from " + str(self.max_prealloc)) - self.pr(" to new prealloc " + str(prealloc)) + self.pr("Updating max_prealloc from {} to {} after {} inserts". + format(self.max_prealloc, prealloc, i)) self.max_prealloc = prealloc + break c.close() # Wait for a log file to be pre-allocated. Avoid timing problems, but @@ -75,10 +81,14 @@ class test_bug019(wttest.WiredTigerTestCase): # There was a bug where pre-allocated log files accumulated on # Windows systems due to an issue with the directory list code. def test_bug019(self): - # Create a table just to write something into the log. - self.session.create(self.uri, 'key_format=i,value_format=S') start_prealloc = self.get_prealloc_stat() - self.populate(self.entries) + self.max_prealloc = start_prealloc + + # Populate a new table to generate log traffic. This typically + # increase the max number of log files preallocated, as indicated by + # the statistic. + self.session.create(self.uri, 'key_format=i,value_format=S') + self.populate(self.max_initial_entries) self.session.checkpoint() if self.max_prealloc <= start_prealloc: self.pr("FAILURE: max_prealloc " + str(self.max_prealloc)) diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint05.py b/src/third_party/wiredtiger/test/suite/test_checkpoint05.py index 58af3003a60..c28d634d54f 100644 --- a/src/third_party/wiredtiger/test/suite/test_checkpoint05.py +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint05.py @@ -44,7 +44,7 @@ class test_checkpoint05(wttest.WiredTigerTestCase): while metadata_cursor.next() == 0: key = metadata_cursor.get_key() value = metadata_cursor[key] - nckpt = nckpt + value.count("WiredTigerCheckpoint") + nckpt += value.count("WiredTigerCheckpoint") metadata_cursor.close() return nckpt diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint07.py b/src/third_party/wiredtiger/test/suite/test_checkpoint07.py new file mode 100755 index 00000000000..52b3104f69b --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint07.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2020 MongoDB, Inc. +# Public Domain 2008-2014 WiredTiger, Inc. +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# test_checkpoint07.py +# Test that the checkpoints timing statistics are populated as expected. + +import wiredtiger, wttest +from wiredtiger import stat +from wtdataset import SimpleDataSet + +def timestamp_str(t): + return '%x' % t + +class test_checkpoint07(wttest.WiredTigerTestCase): + conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + session_config = 'isolation=snapshot' + + def get_stat(self, uri): + stat_uri = 'statistics:' + uri + stat_cursor = self.session.open_cursor(stat_uri) + val = stat_cursor[stat.dsrc.btree_clean_checkpoint_timer][2] + stat_cursor.close() + return val + + def test_checkpoint07(self): + self.uri1 = 'table:ckpt05.1' + self.file1 = 'file:ckpt05.1.wt' + self.uri2 = 'table:ckpt05.2' + self.file2 = 'file:ckpt05.2.wt' + self.uri3 = 'table:ckpt05.3' + self.file3 = 'file:ckpt05.3.wt' + self.session.create(self.uri1, 'key_format=i,value_format=i') + self.session.create(self.uri2, 'key_format=i,value_format=i') + self.session.create(self.uri3, 'key_format=i,value_format=i') + + # Setup: Insert some data and checkpoint it. Then modify only + # the data in the first table and checkpoint. Verify the clean skip + # timer is not set for the modified table and is set for the clean one. + c1 = self.session.open_cursor(self.uri1, None) + c2 = self.session.open_cursor(self.uri2, None) + c3 = self.session.open_cursor(self.uri3, None) + c1[1] = 1 + c2[1] = 1 + c3[1] = 1 + self.session.checkpoint(None) + c1[2] = 2 + self.session.checkpoint(None) + val1 = self.get_stat(self.file1) + self.assertEqual(val1, 0) + val2 = self.get_stat(self.file2) + self.assertNotEqual(val2, 0) + val3 = self.get_stat(self.file3) + self.assertNotEqual(val3, 0) + # It is possible that we could span the second timer when processing table + # two and table three during the checkpoint. If they're different check + # they are within 1 second of each other. + if val2 != val3: + self.assertTrue(val2 == val3 - 1 or val3 == val2 - 1) + + # Now force a checkpoint on clean tables. No clean timer should be set. + self.session.checkpoint('force=true') + val = self.get_stat(self.uri1) + self.assertEqual(val, 0) + val = self.get_stat(self.uri2) + self.assertEqual(val, 0) + val = self.get_stat(self.uri3) + self.assertEqual(val, 0) + + # Modify the first two tables and reverify all three. + c1[3] = 3 + c2[3] = 3 + self.session.checkpoint(None) + val = self.get_stat(self.uri1) + self.assertEqual(val, 0) + val = self.get_stat(self.uri2) + self.assertEqual(val, 0) + val = self.get_stat(self.uri3) + self.assertNotEqual(val, 0) + + # Open a backup cursor. This will pin the most recent checkpoint. + # Modify table 1 and checkpoint, then modify table 2 and checkpoint. + # The open backup cursor will cause table 1 to get the smaller timer. + backup_cursor = self.session.open_cursor('backup:', None, None) + c1[4] = 4 + self.session.checkpoint(None) + val = self.get_stat(self.uri1) + self.assertEqual(val, 0) + + c2[4] = 4 + self.session.checkpoint(None) + val2 = self.get_stat(self.uri2) + self.assertEqual(val2, 0) + + val1 = self.get_stat(self.uri1) + val3 = self.get_stat(self.uri3) + # Assert table 1 does not have the forever timer value, but it is set. + # This assumes table 3 has the forever value. + self.assertNotEqual(val1, 0) + self.assertNotEqual(val3, 0) + self.assertLess(val1, val3) + # Save the old forever value from table 3. + oldval3 = val3 + + # Force a checkpoint while the backup cursor is open. Then write again + # to table 2. Since table 1 and table 3 are clean again, this should + # force both table 1 and table 3 to have the smaller timer. + self.session.checkpoint('force=true') + val1 = self.get_stat(self.uri1) + val3 = self.get_stat(self.uri3) + self.assertEqual(val1, 0) + self.assertEqual(val3, 0) + c2[5] = 5 + self.session.checkpoint(None) + val2 = self.get_stat(self.uri2) + self.assertEqual(val2, 0) + + val1 = self.get_stat(self.uri1) + val3 = self.get_stat(self.uri3) + self.assertNotEqual(val1, 0) + self.assertNotEqual(val3, 0) + self.assertLess(val3, oldval3) + # It is possible that we could span the second timer when processing table + # two and table three during the checkpoint. If they're different check + # they are within 1 second of each other. + if val1 != val3: + self.assertTrue(val1 == val3 - 1 or val3 == val1 - 1) + + backup_cursor.close() + + # Repeat the sequence of forcing a checkpoint and then modifying after + # closing the backup cursor to check that both tables are now marked + # with the forever value. + self.session.checkpoint('force=true') + val1 = self.get_stat(self.uri1) + val3 = self.get_stat(self.uri3) + self.assertEqual(val1, 0) + self.assertEqual(val3, 0) + c2[6] = 6 + self.session.checkpoint(None) + val2 = self.get_stat(self.uri2) + self.assertEqual(val2, 0) + + val1 = self.get_stat(self.uri1) + val3 = self.get_stat(self.uri3) + self.assertNotEqual(val1, 0) + self.assertNotEqual(val3, 0) + # It is possible that we could span the second timer when processing table + # two and table three during the checkpoint. If they're different check + # they are within 1 second of each other. + if val1 != val3: + self.assertTrue(val1 == val3 - 1 or val3 == val1 - 1) + self.assertEqual(val3, oldval3) + + self.session.close() + +if __name__ == '__main__': + wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_cursor13.py b/src/third_party/wiredtiger/test/suite/test_cursor13.py index c4bb50c5bad..c90db17e299 100755 --- a/src/third_party/wiredtiger/test/suite/test_cursor13.py +++ b/src/third_party/wiredtiger/test/suite/test_cursor13.py @@ -65,16 +65,18 @@ class test_cursor13_base(wttest.WiredTigerTestCase): if expect_change: self.assertGreater(stats[0], self.stat_cursor_cache) self.stat_cursor_cache = stats[0] - else: - self.assertEqual(stats[0], self.stat_cursor_cache) + # Stats may change due to background operations in history store cursor + #else: + # self.assertEqual(stats[0], self.stat_cursor_cache) def assert_cursor_reopened(self, expect_change): stats = self.caching_stats() if expect_change: self.assertGreater(stats[1], self.stat_cursor_reopen) self.stat_cursor_reopen = stats[1] - else: - self.assertEqual(stats[1], self.stat_cursor_reopen) + # Stats may change due to background operations in history store cursor + #else: + # self.assertEqual(stats[1], self.stat_cursor_reopen) def cursor_stats_init(self): stats = self.caching_stats() @@ -447,8 +449,11 @@ class test_cursor13_big(test_cursor13_big_base): #self.tty('opens = ' + str(self.opencount) + \ # ', closes = ' + str(self.closecount)) #self.tty('stats after = ' + str(end_stats)) - self.assertEquals(end_stats[0] - begin_stats[0], self.closecount) - self.assertEquals(end_stats[1] - begin_stats[1], self.opencount) + + # Stats won't be exact because they may include operations triggered by other + # threads (e.g., eviction) opening and closing history store cursors. + self.assertGreaterEqual(end_stats[0] - begin_stats[0], self.closecount) + self.assertGreaterEqual(end_stats[1] - begin_stats[1], self.opencount) class test_cursor13_sweep(test_cursor13_big_base): # Set dhandle sweep configuration so that dhandles should be closed within @@ -507,7 +512,7 @@ class test_cursor13_sweep(test_cursor13_big_base): # ', closes = ' + str(self.closecount)) #self.tty('stats after = ' + str(end_stats)) #self.tty('sweep stats after = ' + str(end_sweep_stats)) - self.assertEquals(end_stats[0] - begin_stats[0], self.closecount) + self.assertGreaterEqual(end_stats[0] - begin_stats[0], self.closecount) swept = end_sweep_stats[3] - begin_sweep_stats[3] # Although this is subject to tuning parameters, we know that diff --git a/src/third_party/wiredtiger/test/suite/test_cursor16.py b/src/third_party/wiredtiger/test/suite/test_cursor16.py index 6ce58f01ae8..b5fbd7996eb 100755 --- a/src/third_party/wiredtiger/test/suite/test_cursor16.py +++ b/src/third_party/wiredtiger/test/suite/test_cursor16.py @@ -64,7 +64,8 @@ class test_cursor16(wttest.WiredTigerTestCase): for j in range(0, 10): cursor[str(j)] = str(j) - self.assertEqual(0, self.cached_stats()) + # Skewed by internal history store operations + #self.assertEqual(0, self.cached_stats()) sessions = [] for i in range(0, self.session_count): @@ -89,7 +90,8 @@ class test_cursor16(wttest.WiredTigerTestCase): session.close() #self.tty('end cursors cached=' + str(self.cached_stats())) - self.assertEqual(0, self.cached_stats()) + # Skewed by internal history store operations + #self.assertEqual(0, self.cached_stats()) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_hs15.py b/src/third_party/wiredtiger/test/suite/test_hs15.py new file mode 100644 index 00000000000..8124f1d5f1e --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_hs15.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2020 MongoDB, Inc. +# Public Domain 2008-2014 WiredTiger, Inc. +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +import time, wiredtiger, wttest + +def timestamp_str(t): + return '%x' % t + +# test_hs15.py +# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp. +class test_hs14(wttest.WiredTigerTestCase): + conn_config = 'cache_size=5MB' + session_config = 'isolation=snapshot' + + def test_hs15(self): + uri = 'table:test_hs15' + self.session.create(uri, 'key_format=S,value_format=S') + cursor = self.session.open_cursor(uri) + + value1 = 'a' * 500 + value2 = 'b' * 500 + value3 = 'c' * 500 + + # Insert an update without timestamp + self.session.begin_transaction() + cursor[str(0)] = value1 + self.session.commit_transaction() + + # Insert a bunch of other contents to trigger eviction + for i in range(1, 1000): + self.session.begin_transaction() + cursor[str(i)] = value2 + self.session.commit_transaction('commit_timestamp=' + timestamp_str(3)) + + # Do a modify and an update with timestamps + self.session.begin_transaction() + cursor.set_key(str(0)) + mods = [wiredtiger.Modify('B', 100, 1)] + self.assertEqual(cursor.modify(mods), 0) + self.session.commit_transaction('commit_timestamp=' + timestamp_str(1)) + + self.session.begin_transaction() + cursor[str(0)] = value2 + self.session.commit_transaction('commit_timestamp=' + timestamp_str(2)) + + # Make the modify with timestamp and the update without timestamp obsolete + self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(1)) + + # Do a checkpoint + self.session.checkpoint() + + self.session.begin_transaction() + cursor[str(0)] = value3 + self.session.commit_transaction('commit_timestamp=' + timestamp_str(3)) + + # Insert a bunch of other contents to trigger eviction + for i in range(1, 1000): + self.session.begin_transaction() + cursor[str(i)] = value3 + self.session.commit_transaction('commit_timestamp=' + timestamp_str(3)) + + expected = list(value1) + expected[100] = 'B' + expected = str().join(expected) + self.session.begin_transaction('read_timestamp=' + timestamp_str(1)) + self.assertEqual(cursor[str(0)], expected) + self.session.rollback_transaction() + + self.session.begin_transaction('read_timestamp=' + timestamp_str(2)) + self.assertEqual(cursor[str(0)], value2) + self.session.rollback_transaction() + + self.session.begin_transaction('read_timestamp=' + timestamp_str(3)) + self.assertEqual(cursor[str(0)], value3) + self.session.rollback_transaction() diff --git a/src/third_party/wiredtiger/test/suite/test_join10.py b/src/third_party/wiredtiger/test/suite/test_join10.py new file mode 100755 index 00000000000..852ef29437d --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_join10.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2020 MongoDB, Inc. +# Public Domain 2008-2014 WiredTiger, Inc. +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +import wiredtiger, wttest +from wtscenario import make_scenarios + +# test_join10.py +# Test modeled on the C example for join. +class test_join10(wttest.WiredTigerTestCase): + + # We need statistics for these tests. + conn_config = 'statistics=(all)' + + def check_stats(self, jc, expect): + statcursor = self.session.open_cursor('statistics:join', jc, None) + for id, desc, valstr, val in statcursor: + if desc in expect: + expect_val = expect.pop(desc) + self.assertEqual(val, expect_val) + self.assertTrue(len(expect) == 0, + 'missing expected values in stats: ' + str(expect)) + statcursor.close() + + def test_country(self): + session = self.session + pop_data = [["AU", 1900, 4000000], + ["AU", 1950, 8267337], + ["AU", 2000, 19053186], + ["CAN", 1900, 5500000], + ["CAN", 1950, 14011422], + ["CAN", 2000, 31099561], + ["UK", 1900, 369000000], + ["UK", 1950, 50127000], + ["UK", 2000, 59522468], + ["USA", 1900, 76212168], + ["USA", 1950, 150697361], + ["USA", 2000, 301279593]] + + session.create("table:poptable", \ + "key_format=r,value_format=SHQ," + + "columns=(id,country,year,population),colgroups=(main,population)") + + session.create("colgroup:poptable:main", "columns=(country,year,population)") + session.create("colgroup:poptable:population", "columns=(population)") + + session.create("index:poptable:country", "columns=(country)") + session.create("index:poptable:immutable_year", "columns=(year),immutable") + + cursor = session.open_cursor("table:poptable", None, "append") + for p in pop_data: + cursor.set_value(p[0], p[1], p[2]) + cursor.insert() + cursor.close() + + join_cursor = session.open_cursor("join:table:poptable") + country_cursor = session.open_cursor("index:poptable:country") + year_cursor = session.open_cursor("index:poptable:immutable_year") + + # select values WHERE country == "AU" AND year > 1900 + country_cursor.set_key("AU") + self.assertEqual(country_cursor.search(), 0) + session.join(join_cursor, country_cursor, "compare=eq,count=10") + year_cursor.set_key(1900) + self.assertEqual(year_cursor.search(), 0) + session.join(join_cursor, year_cursor, "compare=gt,count=10,strategy=bloom") + + # Check results + expect = [[c,y,p] for c,y,p in pop_data if c == "AU" and y > 1900] + got = [] + for recno, country, year, population in join_cursor: + got.append([country, year, population]) + self.assertEqual(expect, got) + + # Check statistics + # It may seem odd to encode specific values to check against, but each of these + # statistics represent significant and predictable events in the code, and we + # want to know if anything changes. + expect_stat = dict() + pfxc = 'join: index:poptable:country: ' + pfxy = 'join: index:poptable:immutable_year: ' + + expect_stat[pfxc + 'accesses to the main table'] = 2 + expect_stat[pfxc + 'bloom filter false positives'] = 0 + expect_stat[pfxc + 'checks that conditions of membership are satisfied'] = 4 + expect_stat[pfxc + 'items inserted into a bloom filter'] = 0 + expect_stat[pfxc + 'items iterated'] = 4 + + # We're using a bloom filter on this one, but we don't check for bloom filter + # false positives, it's a bit tied to implementation details. + expect_stat[pfxy + 'accesses to the main table'] = 2 + expect_stat[pfxy + 'checks that conditions of membership are satisfied'] = 3 + expect_stat[pfxy + 'items inserted into a bloom filter'] = 8 + expect_stat[pfxy + 'items iterated'] = 12 + + self.check_stats(join_cursor, expect_stat) + + join_cursor.close() + year_cursor.close() + country_cursor.close() + + # Complex join cursors + join_cursor = session.open_cursor("join:table:poptable") + subjoin_cursor = session.open_cursor("join:table:poptable") + + country_cursor = session.open_cursor("index:poptable:country") + country_cursor2 = session.open_cursor("index:poptable:country") + year_cursor = session.open_cursor("index:poptable:immutable_year") + + # select values WHERE (country == "AU" OR country == "UK") + # AND year > 1900 + + # First, set up the join representing the country clause. + country_cursor.set_key("AU") + self.assertEqual(country_cursor.search(), 0) + session.join(subjoin_cursor, country_cursor, "operation=or,compare=eq,count=10") + + country_cursor2.set_key("UK") + self.assertEqual(country_cursor2.search(), 0) + session.join(subjoin_cursor, country_cursor2, "operation=or,compare=eq,count=10") + + # Join that to the top join, and add the year clause + session.join(join_cursor, subjoin_cursor) + year_cursor.set_key(1900) + self.assertEqual(year_cursor.search(), 0) + + session.join(join_cursor, year_cursor, "compare=gt,count=10,strategy=bloom") + + # Check results + expect = [[c,y,p] for c,y,p in pop_data if (c == "AU" or c == "UK") and y > 1900] + got = [] + for recno, country, year, population in join_cursor: + got.append([country, year, population]) + self.assertEqual(expect, got) + + expect_stat = dict() + + # Note: the stats collected for the clause (country == "AU" OR country == "UK") + # are in a join entry that is a "subjoin". Due to a quirk in the implementation + # of join statistics, subjoin statistics are returned using the main table prefix. + pfxm = 'join: table:poptable: ' + pfxy = 'join: index:poptable:immutable_year: ' + + expect_stat[pfxm + 'accesses to the main table'] = 4 + expect_stat[pfxm + 'bloom filter false positives'] = 0 + expect_stat[pfxm + 'checks that conditions of membership are satisfied'] = 12 + expect_stat[pfxm + 'items inserted into a bloom filter'] = 0 + expect_stat[pfxm + 'items iterated'] = 0 + + expect_stat[pfxy + 'accesses to the main table'] = 6 + expect_stat[pfxy + 'bloom filter false positives'] = 0 + expect_stat[pfxy + 'checks that conditions of membership are satisfied'] = 6 + expect_stat[pfxy + 'items inserted into a bloom filter'] = 0 + expect_stat[pfxy + 'items iterated'] = 0 + + self.check_stats(join_cursor, expect_stat) + + join_cursor.close() + subjoin_cursor.close() + country_cursor.close() + country_cursor2.close() + year_cursor.close() + +if __name__ == '__main__': + wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_prepare_conflict.py b/src/third_party/wiredtiger/test/suite/test_prepare_conflict.py new file mode 100644 index 00000000000..267aafd79cd --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_prepare_conflict.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2020 MongoDB, Inc. +# Public Domain 2008-2014 WiredTiger, Inc. +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# test_prepare_conflict.py +# Evict a page while in the fast-truncate state. +# + +import wiredtiger, wttest +from wtdataset import simple_key, simple_value + +def timestamp_str(t): + return '%x' % t + +class test_prepare_conflict(wttest.WiredTigerTestCase): + def test_prepare(self): + # Create a large table with lots of pages. + uri = "table:test_prepare_conflict" + config = 'allocation_size=512,leaf_page_max=512,key_format=S,value_format=S' + self.session.create(uri, config) + cursor = self.session.open_cursor(uri) + for i in range(1, 80000): + cursor[simple_key(cursor, i)] = simple_value(cursor, i) + cursor.close() + + # Force to disk. + self.reopen_conn() + + # Start a transaction. + self.session.begin_transaction('isolation=snapshot') + + # Truncate the middle chunk. + c1 = self.session.open_cursor(uri, None) + c1.set_key(simple_key(c1, 10000)) + c2 = self.session.open_cursor(uri, None) + c2.set_key(simple_key(c1, 70000)) + self.session.truncate(None, c1, c2, None) + c1.close() + c2.close() + + # Modify a record on a fast-truncate page. + cursor = self.session.open_cursor(uri) + cursor[simple_key(cursor, 40000)] = "replacement_value" + cursor.close() + + # Prepare and commit the transaction. + self.session.prepare_transaction('prepare_timestamp=' + timestamp_str(10)) + self.session.timestamp_transaction('commit_timestamp=' + timestamp_str(20)) + self.session.timestamp_transaction('durable_timestamp=' + timestamp_str(20)) + self.session.commit_transaction() + + # WT-6325 reports WT_PREPARE_CONFLICT while iterating the cursor. + # Walk the table, the bug will cause a prepared conflict return. + cursor = self.session.open_cursor(uri) + while cursor.next() == 0: + continue + cursor.close() + +if __name__ == '__main__': + wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py index eed6d8e0c26..e8db0550960 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py @@ -49,7 +49,7 @@ class test_rollback_to_stable11(test_rollback_to_stable_base): scenarios = make_scenarios(prepare_values) def conn_config(self): - config = 'cache_size=1MB,statistics=(all),log=(enabled=true)' + config = 'cache_size=1MB,statistics=(all),log=(archive=false,enabled=true)' return config def simulate_crash_restart(self, olddir, newdir): diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp19.py b/src/third_party/wiredtiger/test/suite/test_timestamp19.py new file mode 100644 index 00000000000..54e121291d0 --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_timestamp19.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2020 MongoDB, Inc. +# Public Domain 2008-2014 WiredTiger, Inc. +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# test_timestamp19.py +# Use the oldest timestamp in the metadata as the oldest timestamp on restart. +import wiredtiger, wttest +from wtdataset import SimpleDataSet + +def timestamp_str(t): + return '%x' % t + +class test_timestamp19(wttest.WiredTigerTestCase): + conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + session_config = 'isolation=snapshot' + + def updates(self, uri, value, ds, nrows, commit_ts): + session = self.session + cursor = session.open_cursor(uri) + for i in range(0, nrows): + session.begin_transaction() + cursor[ds.key(i)] = value + session.commit_transaction('commit_timestamp=' + timestamp_str(commit_ts)) + cursor.close() + + def test_timestamp(self): + uri = "table:test_timestamp19" + create_params = 'value_format=S,key_format=i' + self.session.create(uri, create_params) + + ds = SimpleDataSet( + self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds.populate() + + nrows = 1000 + value_x = 'x' * 1000 + value_y = 'y' * 1000 + value_z = 'z' * 1000 + + # Set the oldest and stable timestamps to 10. + self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(10) + + ', stable_timestamp=' + timestamp_str(10)) + + # Insert values with varying timestamps. + self.updates(uri, value_x, ds, nrows, 20) + self.updates(uri, value_y, ds, nrows, 30) + self.updates(uri, value_z, ds, nrows, 40) + + # Perform a checkpoint. + self.session.checkpoint('use_timestamp=true') + + # Move the oldest and stable timestamps to 40. + self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(40) + + ', stable_timestamp=' + timestamp_str(40)) + + # Update values. + self.updates(uri, value_z, ds, nrows, 50) + self.updates(uri, value_x, ds, nrows, 60) + self.updates(uri, value_y, ds, nrows, 70) + + # Perform a checkpoint. + self.session.checkpoint('use_timestamp=true') + + # Close and reopen the connection. + self.close_conn() + self.conn = self.setUpConnectionOpen('.') + self.session = self.setUpSessionOpen(self.conn) + + # The oldest timestamp on recovery is 40. Trying to set it earlier is a no-op. + self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(10)) + self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), timestamp_str(40)) + + # Trying to set an earlier stable timestamp is an error. + self.assertRaisesWithMessage(wiredtiger.WiredTigerError, + lambda: self.conn.set_timestamp('stable_timestamp=' + timestamp_str(10)), + '/oldest timestamp \(0, 40\) must not be later than stable timestamp \(0, 10\)/') + self.assertTimestampsEqual(self.conn.query_timestamp('get=stable'), timestamp_str(40)) + + # Move the oldest and stable timestamps to 70. + self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(70) + + ', stable_timestamp=' + timestamp_str(70)) + self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), timestamp_str(70)) + self.assertTimestampsEqual(self.conn.query_timestamp('get=stable'), timestamp_str(70)) + +if __name__ == '__main__': + wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_txn13.py b/src/third_party/wiredtiger/test/suite/test_txn13.py index 541017804c9..fcd1dae95da 100644 --- a/src/third_party/wiredtiger/test/suite/test_txn13.py +++ b/src/third_party/wiredtiger/test/suite/test_txn13.py @@ -40,13 +40,16 @@ class test_txn13(wttest.WiredTigerTestCase, suite_subprocess): logmax = "100K" tablename = 'test_txn13' uri = 'table:' + tablename - nops = 1024 + # We use 8 ops here to get around the 10 operation check done by WiredTiger to determine if + # a transaction is blocking or not. + nops = 8 create_params = 'key_format=i,value_format=S' + # The 1gb, 2gb and 4gb scenario names refer to the valuesize * nops. scenarios = make_scenarios([ - ('1gb', dict(expect_err=False, valuesize=1048576)), - ('2gb', dict(expect_err=False, valuesize=2097152)), - ('4gb', dict(expect_err=True, valuesize=4194304)) + ('1gb', dict(expect_err=False, valuesize=134217728)), + ('2gb', dict(expect_err=False, valuesize=268435456)), + ('4gb', dict(expect_err=True, valuesize=536870912)) ]) # Turn on logging for this test. diff --git a/src/third_party/wiredtiger/test/suite/test_txn19.py b/src/third_party/wiredtiger/test/suite/test_txn19.py index 004e849671e..3d81e2e9e6f 100755 --- a/src/third_party/wiredtiger/test/suite/test_txn19.py +++ b/src/third_party/wiredtiger/test/suite/test_txn19.py @@ -481,7 +481,13 @@ class test_txn19_meta(wttest.WiredTigerTestCase, suite_subprocess): closeconn=False) if expect_fail: - self.check_file_contains_one_of(errfile, ['WT_TRY_SALVAGE: database corruption detected']) + errmsg = 'WT_TRY_SALVAGE: database corruption detected' + if self.filename == 'WiredTigerHS.wt': + if self.kind == 'removal': + errmsg = 'hs_exists' + elif self.kind == 'truncate': + errmsg = 'file size=0, alloc size=4096' + self.check_file_contains_one_of(errfile, [errmsg]) def test_corrupt_meta(self): errfile = 'list.err' |