Import wiredtiger: bf55d99eb5b5f9fb9d51fb5c6bbb335bf569ef5f from branch mongodb-8.2 (#46180)
Co-authored-by: wt-vendoring-bot <wt-vendoring-bot@mongodb.com> GitOrigin-RevId: afb70d316c668699d8b8fb5a9eebbecebe87ccf2
This commit is contained in:
parent
fa497b53f1
commit
bca052045b
2
src/third_party/wiredtiger/dist/stat_data.py
vendored
2
src/third_party/wiredtiger/dist/stat_data.py
vendored
@ -1089,6 +1089,7 @@ conn_dsrc_stats = [
|
||||
CacheStat('cache_hs_insert_full_update', 'the number of times full update inserted to history store'),
|
||||
CacheStat('cache_hs_insert_restart', 'history store table insert calls that returned restart'),
|
||||
CacheStat('cache_hs_insert_reverse_modify', 'the number of times reverse modify inserted to history store'),
|
||||
CacheStat('cache_hs_key_processed', 'history store table key to be processed'),
|
||||
CacheStat('cache_hs_key_truncate', 'history store table truncation to remove an update'),
|
||||
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'),
|
||||
@ -1101,6 +1102,7 @@ conn_dsrc_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_update_processed', 'history store table update to be processed'),
|
||||
CacheStat('cache_hs_write_squash', 'history store table writes requiring squashed modifies'),
|
||||
CacheStat('cache_inmem_split', 'in-memory page splits'),
|
||||
CacheStat('cache_inmem_splittable', 'in-memory page passed criteria to be split'),
|
||||
|
||||
2
src/third_party/wiredtiger/import.data
vendored
2
src/third_party/wiredtiger/import.data
vendored
@ -2,5 +2,5 @@
|
||||
"vendor": "wiredtiger",
|
||||
"github": "wiredtiger/wiredtiger",
|
||||
"branch": "mongodb-8.2",
|
||||
"commit": "607c3cd185afef9edfd56e180236a58062353e84"
|
||||
"commit": "bf55d99eb5b5f9fb9d51fb5c6bbb335bf569ef5f"
|
||||
}
|
||||
|
||||
@ -594,6 +594,7 @@ struct __wt_connection_stats {
|
||||
int64_t cache_hazard_max;
|
||||
int64_t cache_hs_insert;
|
||||
int64_t cache_hs_insert_restart;
|
||||
int64_t cache_hs_key_processed;
|
||||
int64_t cache_hs_ondisk_max;
|
||||
int64_t cache_hs_ondisk;
|
||||
int64_t cache_hs_read;
|
||||
@ -609,6 +610,7 @@ struct __wt_connection_stats {
|
||||
int64_t cache_hs_btree_truncate_dryrun;
|
||||
int64_t cache_hs_key_truncate_rts_unstable_dryrun;
|
||||
int64_t cache_hs_key_truncate_rts_dryrun;
|
||||
int64_t cache_hs_update_processed;
|
||||
int64_t cache_hs_order_reinsert;
|
||||
int64_t cache_hs_write_squash;
|
||||
int64_t cache_inmem_splittable;
|
||||
@ -1300,6 +1302,7 @@ struct __wt_dsrc_stats {
|
||||
int64_t cache_eviction_blocked_hazard;
|
||||
int64_t cache_hs_insert;
|
||||
int64_t cache_hs_insert_restart;
|
||||
int64_t cache_hs_key_processed;
|
||||
int64_t cache_hs_read;
|
||||
int64_t cache_hs_read_miss;
|
||||
int64_t cache_hs_read_squash;
|
||||
@ -1313,6 +1316,7 @@ struct __wt_dsrc_stats {
|
||||
int64_t cache_hs_btree_truncate_dryrun;
|
||||
int64_t cache_hs_key_truncate_rts_unstable_dryrun;
|
||||
int64_t cache_hs_key_truncate_rts_dryrun;
|
||||
int64_t cache_hs_update_processed;
|
||||
int64_t cache_hs_order_reinsert;
|
||||
int64_t cache_hs_write_squash;
|
||||
int64_t cache_inmem_splittable;
|
||||
|
||||
1710
src/third_party/wiredtiger/src/include/wiredtiger.in
vendored
1710
src/third_party/wiredtiger/src/include/wiredtiger.in
vendored
File diff suppressed because it is too large
Load Diff
@ -670,6 +670,7 @@ __wti_rec_hs_insert_updates(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_MULTI
|
||||
wt_off_t hs_size;
|
||||
uint64_t insert_cnt, max_hs_size, modify_cnt;
|
||||
uint64_t cache_hs_insert_full_update, cache_hs_insert_reverse_modify, cache_hs_write_squash;
|
||||
uint64_t cache_hs_key_processed, cache_hs_update_processed;
|
||||
uint32_t i;
|
||||
int nentries;
|
||||
bool enable_reverse_modify, error_on_ts_ordering, hs_inserted, squashed, hs_flag_set;
|
||||
@ -684,6 +685,7 @@ __wti_rec_hs_insert_updates(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_MULTI
|
||||
error_on_ts_ordering = F_ISSET(r, WT_REC_CHECKPOINT_RUNNING) ||
|
||||
FLD_ISSET(S2C(session)->debug_flags, WT_CONN_DEBUG_EVICTION_CKPT_TS_ORDERING);
|
||||
cache_hs_insert_full_update = cache_hs_insert_reverse_modify = cache_hs_write_squash = 0;
|
||||
cache_hs_key_processed = cache_hs_update_processed = 0;
|
||||
|
||||
WT_RET(__wt_curhs_open(session, NULL, &hs_cursor));
|
||||
F_SET(hs_cursor, WT_CURSTD_HS_READ_COMMITTED);
|
||||
@ -727,6 +729,8 @@ __wti_rec_hs_insert_updates(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_MULTI
|
||||
|
||||
__wt_update_vector_clear(&updates);
|
||||
|
||||
++cache_hs_key_processed;
|
||||
|
||||
/*
|
||||
* Reverse deltas are only supported on 'S' and 'u' value formats.
|
||||
*/
|
||||
@ -873,29 +877,32 @@ __wti_rec_hs_insert_updates(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_MULTI
|
||||
"moving %" WT_SIZET_FMT " updates to the history store in saved update list %u of ref %p",
|
||||
updates.size, i, (void *)ref);
|
||||
|
||||
WT_ASSERT(session, updates.size > 0);
|
||||
__wt_update_vector_peek(&updates, &oldest_upd);
|
||||
if (updates.size > 0) {
|
||||
cache_hs_update_processed += updates.size;
|
||||
|
||||
WT_ASSERT(session,
|
||||
oldest_upd->type == WT_UPDATE_STANDARD || oldest_upd->type == WT_UPDATE_TOMBSTONE);
|
||||
__wt_update_vector_peek(&updates, &oldest_upd);
|
||||
|
||||
/*
|
||||
* Fix the history store record here if the oldest update is a tombstone without a
|
||||
* timestamp. This situation is possible only when the tombstone is globally visible. Delete
|
||||
* all the updates of the key in the history store with timestamps. In the rare case we have
|
||||
* a modify update already written to the history store (we saved the state in hs_flag_set),
|
||||
* deal with it here and skip the deletion as there is nothing to do
|
||||
*/
|
||||
if (!hs_flag_set && oldest_upd->type == WT_UPDATE_TOMBSTONE &&
|
||||
oldest_upd->start_ts == WT_TS_NONE) {
|
||||
WT_ERR(__wti_rec_hs_delete_key(
|
||||
session, hs_cursor, btree->id, key, false, error_on_ts_ordering));
|
||||
WT_ASSERT(session,
|
||||
oldest_upd->type == WT_UPDATE_STANDARD || oldest_upd->type == WT_UPDATE_TOMBSTONE);
|
||||
|
||||
WT_STAT_CONN_DSRC_INCR(session, cache_hs_key_truncate);
|
||||
/*
|
||||
* Fix the history store record here if the oldest update is a tombstone without a
|
||||
* timestamp. This situation is possible only when the tombstone is globally visible.
|
||||
* Delete all the updates of the key in the history store with timestamps. In the rare
|
||||
* case we have a modify update already written to the history store (we saved the state
|
||||
* in hs_flag_set), deal with it here and skip the deletion as there is nothing to do
|
||||
*/
|
||||
if (!hs_flag_set && oldest_upd->type == WT_UPDATE_TOMBSTONE &&
|
||||
oldest_upd->start_ts == WT_TS_NONE) {
|
||||
WT_ERR(__wti_rec_hs_delete_key(
|
||||
session, hs_cursor, btree->id, key, false, error_on_ts_ordering));
|
||||
|
||||
/* Reset the update without a timestamp if it is the last update in the chain. */
|
||||
if (oldest_upd == no_ts_upd)
|
||||
no_ts_upd = NULL;
|
||||
WT_STAT_CONN_DSRC_INCR(session, cache_hs_key_truncate);
|
||||
|
||||
/* Reset the update without a timestamp if it is the last update in the chain. */
|
||||
if (oldest_upd == no_ts_upd)
|
||||
no_ts_upd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skip if we have nothing to insert to the history store. */
|
||||
@ -1101,6 +1108,8 @@ err:
|
||||
WT_STAT_CONN_DSRC_INCRV(
|
||||
session, cache_hs_insert_reverse_modify, cache_hs_insert_reverse_modify);
|
||||
WT_STAT_CONN_DSRC_INCRV(session, cache_hs_write_squash, cache_hs_write_squash);
|
||||
WT_STAT_CONN_DSRC_INCRV(session, cache_hs_key_processed, cache_hs_key_processed);
|
||||
WT_STAT_CONN_DSRC_INCRV(session, cache_hs_update_processed, cache_hs_update_processed);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
@ -763,11 +763,12 @@ __rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *first_up
|
||||
* Fill the time window information and the selected update.
|
||||
*/
|
||||
static int
|
||||
__rec_fill_tw_from_upd_select(
|
||||
WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK_KV *vpack, WTI_UPDATE_SELECT *upd_select)
|
||||
__rec_fill_tw_from_upd_select(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK_KV *vpack,
|
||||
WTI_UPDATE_SELECT *upd_select, WTI_RECONCILE *r)
|
||||
{
|
||||
WT_TIME_WINDOW *select_tw;
|
||||
WT_UPDATE *last_upd, *tombstone, *upd;
|
||||
bool tombstone_globally_visible;
|
||||
|
||||
upd = upd_select->upd;
|
||||
last_upd = tombstone = NULL;
|
||||
@ -798,16 +799,40 @@ __rec_fill_tw_from_upd_select(
|
||||
WT_TIME_WINDOW_SET_STOP(select_tw, upd);
|
||||
tombstone = upd_select->tombstone = upd;
|
||||
|
||||
/* Find the update this tombstone applies to. */
|
||||
if (!__wt_txn_upd_visible_all(session, upd)) {
|
||||
/*
|
||||
* Find the update this tombstone applies to.
|
||||
*
|
||||
* To handle scenarios where a prepared tombstone is rolled back, we need to retrieve the
|
||||
* full update associated with it. We resolve prepared updates recursively, processing them
|
||||
* from the oldest to the newest. If a prepared tombstone is written, there's a possibility
|
||||
* that a prepared update from the same transaction was rolled back. In such cases, ensure
|
||||
* that the rolled-back update is also written to disk to maintain data consistency.
|
||||
*
|
||||
* Additionally, if a tombstone with a zero timestamp is selected and there is a need to
|
||||
* move the updates from this btree to the history store, it is essential to identify the
|
||||
* update that the tombstone deletes. Failing to do so could lead to missed deletions of
|
||||
* related updates in the history store, potentially causing data inconsistencies.
|
||||
*/
|
||||
tombstone_globally_visible = __wt_txn_upd_visible_all(session, upd);
|
||||
if ((F_ISSET(r, WT_REC_HS) && upd->start_ts == WT_TS_NONE) || !tombstone_globally_visible) {
|
||||
while (upd->next != NULL && upd->next->txnid == WT_TXN_ABORTED)
|
||||
upd = upd->next;
|
||||
|
||||
WT_ASSERT(session, upd->next == NULL || upd->next->txnid != WT_TXN_ABORTED);
|
||||
upd_select->upd = upd = upd->next;
|
||||
/* We should not see multiple consecutive tombstones. */
|
||||
WT_ASSERT_ALWAYS(session, upd == NULL || upd->type != WT_UPDATE_TOMBSTONE,
|
||||
"Consecutive tombstones found on the update chain");
|
||||
/*
|
||||
* Do not write the key to the disk image if the tombstone is globally visible. However,
|
||||
* the timestamps of the update it deletes are still required to determine whether the
|
||||
* key's values need to be removed from the history store.
|
||||
*/
|
||||
if (tombstone_globally_visible) {
|
||||
if (upd->next != NULL)
|
||||
upd = upd->next;
|
||||
else
|
||||
upd = tombstone;
|
||||
} else {
|
||||
upd_select->upd = upd = upd->next;
|
||||
/* We should not see multiple consecutive tombstones. */
|
||||
WT_ASSERT_ALWAYS(session, upd == NULL || upd->type != WT_UPDATE_TOMBSTONE,
|
||||
"Consecutive tombstones found on the update chain");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -975,7 +1000,7 @@ __wti_rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_INSERT *ins,
|
||||
r->update_used = true;
|
||||
|
||||
if (upd != NULL)
|
||||
WT_RET(__rec_fill_tw_from_upd_select(session, page, vpack, upd_select));
|
||||
WT_RET(__rec_fill_tw_from_upd_select(session, page, vpack, upd_select, r));
|
||||
|
||||
/* Mark the page dirty after reconciliation. */
|
||||
if (has_newer_updates)
|
||||
@ -1000,26 +1025,14 @@ __wti_rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_INSERT *ins,
|
||||
* Set the flag if the selected tombstone has no timestamp. Based on this flag, the caller
|
||||
* functions perform the history store truncation for this key.
|
||||
*/
|
||||
if (!F_ISSET(session->dhandle, WT_DHANDLE_HS) && upd_select->tombstone != NULL &&
|
||||
if (!WT_IS_HS(session->dhandle) && upd_select->tombstone != NULL &&
|
||||
!F_ISSET(upd_select->tombstone, WT_UPDATE_RESTORED_FROM_DS | WT_UPDATE_RESTORED_FROM_HS)) {
|
||||
upd = upd_select->upd;
|
||||
|
||||
/*
|
||||
* The selected update can be the tombstone itself when the tombstone is globally visible.
|
||||
* Compare the tombstone's timestamp with either the next update in the update list or the
|
||||
* on-disk cell timestamp to determine if the tombstone is discarding a timestamp.
|
||||
*/
|
||||
if (upd_select->tombstone == upd) {
|
||||
upd = upd->next;
|
||||
|
||||
/* Loop until a valid update is found. */
|
||||
while (upd != NULL && upd->txnid == WT_TXN_ABORTED)
|
||||
upd = upd->next;
|
||||
}
|
||||
|
||||
if ((upd != NULL && upd->start_ts > upd_select->tombstone->start_ts) ||
|
||||
(vpack != NULL && vpack->tw.start_ts > upd_select->tombstone->start_ts))
|
||||
if (upd_select->tw.start_ts > upd_select->tw.stop_ts ||
|
||||
(vpack != NULL && vpack->type != WT_CELL_DEL &&
|
||||
vpack->tw.start_ts > upd_select->tw.stop_ts && upd_select->tw.stop_ts == WT_TS_NONE)) {
|
||||
WT_ASSERT(session, upd_select->tw.stop_ts == WT_TS_NONE);
|
||||
upd_select->no_ts_tombstone = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1029,8 +1042,8 @@ __wti_rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_INSERT *ins,
|
||||
* Returning EBUSY here is okay as the previous call to validate the update chain wouldn't have
|
||||
* caught the situation where only a tombstone is selected.
|
||||
*/
|
||||
if (__timestamp_no_ts_fix(session, &upd_select->tw) && F_ISSET(r, WT_REC_HS) &&
|
||||
F_ISSET(r, WT_REC_CHECKPOINT_RUNNING)) {
|
||||
if (onpage_upd != NULL && __timestamp_no_ts_fix(session, &upd_select->tw) &&
|
||||
F_ISSET(r, WT_REC_HS) && F_ISSET(r, WT_REC_CHECKPOINT_RUNNING)) {
|
||||
/* Catch this case in diagnostic builds. */
|
||||
WT_STAT_CONN_DSRC_INCR(session, cache_eviction_blocked_no_ts_checkpoint_race_3);
|
||||
WT_ASSERT(session, false);
|
||||
|
||||
@ -2839,8 +2839,7 @@ __wti_rec_hs_clear_on_tombstone(
|
||||
__wt_failpoint(session, WT_TIMING_STRESS_FAILPOINT_HISTORY_STORE_DELETE_KEY_FROM_TS, 1))
|
||||
return (EBUSY);
|
||||
|
||||
WT_STAT_CONN_INCR(session, cache_hs_key_truncate_onpage_removal);
|
||||
WT_STAT_DSRC_INCR(session, cache_hs_key_truncate_onpage_removal);
|
||||
WT_STAT_CONN_DSRC_INCR(session, cache_hs_key_truncate_onpage_removal);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
14
src/third_party/wiredtiger/src/support/stat.c
vendored
14
src/third_party/wiredtiger/src/support/stat.c
vendored
@ -87,6 +87,7 @@ static const char *const __stats_dsrc_desc[] = {
|
||||
"cache: hazard pointer blocked page eviction",
|
||||
"cache: history store table insert calls",
|
||||
"cache: history store table insert calls that returned restart",
|
||||
"cache: history store table key to be processed",
|
||||
"cache: history store table reads",
|
||||
"cache: history store table reads missed",
|
||||
"cache: history store table reads requiring squashed modifies",
|
||||
@ -105,6 +106,7 @@ static const char *const __stats_dsrc_desc[] = {
|
||||
"non-dryrun mode",
|
||||
"cache: history store table truncations to remove an update that would have happened in "
|
||||
"non-dryrun mode",
|
||||
"cache: history store table update to be processed",
|
||||
"cache: history store table updates without timestamps fixed up by reinserting with the fixed "
|
||||
"timestamp",
|
||||
"cache: history store table writes requiring squashed modifies",
|
||||
@ -452,6 +454,7 @@ __wt_stat_dsrc_clear_single(WT_DSRC_STATS *stats)
|
||||
stats->cache_eviction_blocked_hazard = 0;
|
||||
stats->cache_hs_insert = 0;
|
||||
stats->cache_hs_insert_restart = 0;
|
||||
stats->cache_hs_key_processed = 0;
|
||||
stats->cache_hs_read = 0;
|
||||
stats->cache_hs_read_miss = 0;
|
||||
stats->cache_hs_read_squash = 0;
|
||||
@ -465,6 +468,7 @@ __wt_stat_dsrc_clear_single(WT_DSRC_STATS *stats)
|
||||
stats->cache_hs_btree_truncate_dryrun = 0;
|
||||
stats->cache_hs_key_truncate_rts_unstable_dryrun = 0;
|
||||
stats->cache_hs_key_truncate_rts_dryrun = 0;
|
||||
stats->cache_hs_update_processed = 0;
|
||||
stats->cache_hs_order_reinsert = 0;
|
||||
stats->cache_hs_write_squash = 0;
|
||||
stats->cache_inmem_splittable = 0;
|
||||
@ -795,6 +799,7 @@ __wt_stat_dsrc_aggregate_single(WT_DSRC_STATS *from, WT_DSRC_STATS *to)
|
||||
to->cache_eviction_blocked_hazard += from->cache_eviction_blocked_hazard;
|
||||
to->cache_hs_insert += from->cache_hs_insert;
|
||||
to->cache_hs_insert_restart += from->cache_hs_insert_restart;
|
||||
to->cache_hs_key_processed += from->cache_hs_key_processed;
|
||||
to->cache_hs_read += from->cache_hs_read;
|
||||
to->cache_hs_read_miss += from->cache_hs_read_miss;
|
||||
to->cache_hs_read_squash += from->cache_hs_read_squash;
|
||||
@ -809,6 +814,7 @@ __wt_stat_dsrc_aggregate_single(WT_DSRC_STATS *from, WT_DSRC_STATS *to)
|
||||
to->cache_hs_key_truncate_rts_unstable_dryrun +=
|
||||
from->cache_hs_key_truncate_rts_unstable_dryrun;
|
||||
to->cache_hs_key_truncate_rts_dryrun += from->cache_hs_key_truncate_rts_dryrun;
|
||||
to->cache_hs_update_processed += from->cache_hs_update_processed;
|
||||
to->cache_hs_order_reinsert += from->cache_hs_order_reinsert;
|
||||
to->cache_hs_write_squash += from->cache_hs_write_squash;
|
||||
to->cache_inmem_splittable += from->cache_inmem_splittable;
|
||||
@ -1152,6 +1158,7 @@ __wt_stat_dsrc_aggregate(WT_DSRC_STATS **from, WT_DSRC_STATS *to)
|
||||
to->cache_eviction_blocked_hazard += WT_STAT_DSRC_READ(from, cache_eviction_blocked_hazard);
|
||||
to->cache_hs_insert += WT_STAT_DSRC_READ(from, cache_hs_insert);
|
||||
to->cache_hs_insert_restart += WT_STAT_DSRC_READ(from, cache_hs_insert_restart);
|
||||
to->cache_hs_key_processed += WT_STAT_DSRC_READ(from, cache_hs_key_processed);
|
||||
to->cache_hs_read += WT_STAT_DSRC_READ(from, cache_hs_read);
|
||||
to->cache_hs_read_miss += WT_STAT_DSRC_READ(from, cache_hs_read_miss);
|
||||
to->cache_hs_read_squash += WT_STAT_DSRC_READ(from, cache_hs_read_squash);
|
||||
@ -1170,6 +1177,7 @@ __wt_stat_dsrc_aggregate(WT_DSRC_STATS **from, WT_DSRC_STATS *to)
|
||||
WT_STAT_DSRC_READ(from, cache_hs_key_truncate_rts_unstable_dryrun);
|
||||
to->cache_hs_key_truncate_rts_dryrun +=
|
||||
WT_STAT_DSRC_READ(from, cache_hs_key_truncate_rts_dryrun);
|
||||
to->cache_hs_update_processed += WT_STAT_DSRC_READ(from, cache_hs_update_processed);
|
||||
to->cache_hs_order_reinsert += WT_STAT_DSRC_READ(from, cache_hs_order_reinsert);
|
||||
to->cache_hs_write_squash += WT_STAT_DSRC_READ(from, cache_hs_write_squash);
|
||||
to->cache_inmem_splittable += WT_STAT_DSRC_READ(from, cache_inmem_splittable);
|
||||
@ -1611,6 +1619,7 @@ static const char *const __stats_connection_desc[] = {
|
||||
"cache: hazard pointer maximum array length",
|
||||
"cache: history store table insert calls",
|
||||
"cache: history store table insert calls that returned restart",
|
||||
"cache: history store table key to be processed",
|
||||
"cache: history store table max on-disk size",
|
||||
"cache: history store table on-disk size",
|
||||
"cache: history store table reads",
|
||||
@ -1631,6 +1640,7 @@ static const char *const __stats_connection_desc[] = {
|
||||
"non-dryrun mode",
|
||||
"cache: history store table truncations to remove an update that would have happened in "
|
||||
"non-dryrun mode",
|
||||
"cache: history store table update to be processed",
|
||||
"cache: history store table updates without timestamps fixed up by reinserting with the fixed "
|
||||
"timestamp",
|
||||
"cache: history store table writes requiring squashed modifies",
|
||||
@ -2468,6 +2478,7 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats)
|
||||
stats->cache_hazard_max = 0;
|
||||
stats->cache_hs_insert = 0;
|
||||
stats->cache_hs_insert_restart = 0;
|
||||
stats->cache_hs_key_processed = 0;
|
||||
/* not clearing cache_hs_ondisk_max */
|
||||
/* not clearing cache_hs_ondisk */
|
||||
stats->cache_hs_read = 0;
|
||||
@ -2483,6 +2494,7 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats)
|
||||
stats->cache_hs_btree_truncate_dryrun = 0;
|
||||
stats->cache_hs_key_truncate_rts_unstable_dryrun = 0;
|
||||
stats->cache_hs_key_truncate_rts_dryrun = 0;
|
||||
stats->cache_hs_update_processed = 0;
|
||||
stats->cache_hs_order_reinsert = 0;
|
||||
stats->cache_hs_write_squash = 0;
|
||||
stats->cache_inmem_splittable = 0;
|
||||
@ -3323,6 +3335,7 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS *
|
||||
to->cache_hazard_max = v;
|
||||
to->cache_hs_insert += WT_STAT_CONN_READ(from, cache_hs_insert);
|
||||
to->cache_hs_insert_restart += WT_STAT_CONN_READ(from, cache_hs_insert_restart);
|
||||
to->cache_hs_key_processed += WT_STAT_CONN_READ(from, cache_hs_key_processed);
|
||||
to->cache_hs_ondisk_max += WT_STAT_CONN_READ(from, cache_hs_ondisk_max);
|
||||
to->cache_hs_ondisk += WT_STAT_CONN_READ(from, cache_hs_ondisk);
|
||||
to->cache_hs_read += WT_STAT_CONN_READ(from, cache_hs_read);
|
||||
@ -3343,6 +3356,7 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS *
|
||||
WT_STAT_CONN_READ(from, cache_hs_key_truncate_rts_unstable_dryrun);
|
||||
to->cache_hs_key_truncate_rts_dryrun +=
|
||||
WT_STAT_CONN_READ(from, cache_hs_key_truncate_rts_dryrun);
|
||||
to->cache_hs_update_processed += WT_STAT_CONN_READ(from, cache_hs_update_processed);
|
||||
to->cache_hs_order_reinsert += WT_STAT_CONN_READ(from, cache_hs_order_reinsert);
|
||||
to->cache_hs_write_squash += WT_STAT_CONN_READ(from, cache_hs_write_squash);
|
||||
to->cache_inmem_splittable += WT_STAT_CONN_READ(from, cache_inmem_splittable);
|
||||
|
||||
@ -142,7 +142,11 @@ class test_hs01(wttest.WiredTigerTestCase):
|
||||
# Checkpoint and then assert that the (nrows-1) insertions were moved to history store from data store.
|
||||
self.session.checkpoint()
|
||||
hs_writes = self.get_stat(stat.conn.cache_hs_insert)
|
||||
cache_hs_key_processed = self.get_stat(stat.conn.cache_hs_key_processed)
|
||||
cache_hs_update_processed = self.get_stat(stat.conn.cache_hs_update_processed)
|
||||
self.assertEqual(hs_writes, nrows-1)
|
||||
self.assertEqual(cache_hs_key_processed, nrows - 1)
|
||||
self.assertGreaterEqual(cache_hs_update_processed, nrows - 1)
|
||||
|
||||
# Check to see the latest updated value after recovery.
|
||||
self.durable_check(bigvalue2, uri, ds)
|
||||
|
||||
@ -56,7 +56,11 @@ class test_hs11(wttest.WiredTigerTestCase):
|
||||
('small-nrows', dict(nrows=100)),
|
||||
('large-nrows', dict(nrows=10000))
|
||||
]
|
||||
scenarios = make_scenarios(format_values, update_type_values,long_running_txn_values, last_update_type_values, nrows)
|
||||
location = [
|
||||
('insert-list', dict(insert=True)),
|
||||
('update-list', dict(insert=False))
|
||||
]
|
||||
scenarios = make_scenarios(format_values, update_type_values,long_running_txn_values, last_update_type_values, nrows, location)
|
||||
timestamps = 5
|
||||
|
||||
def create_key(self, i):
|
||||
@ -105,7 +109,8 @@ class test_hs11(wttest.WiredTigerTestCase):
|
||||
|
||||
# Reconcile and flush versions 1-3 to the history store.
|
||||
self.session.checkpoint()
|
||||
self.evict_cursor(uri, self.nrows)
|
||||
if not self.insert:
|
||||
self.evict_cursor(uri, self.nrows)
|
||||
|
||||
# Apply a modify update at timestamp 5.
|
||||
if self.modify and self.value_format != '8t':
|
||||
@ -194,6 +199,8 @@ class test_hs11(wttest.WiredTigerTestCase):
|
||||
|
||||
# Reconcile and flush versions 1-3 to the history store.
|
||||
self.session.checkpoint()
|
||||
if not self.insert:
|
||||
self.evict_cursor(uri, self.nrows)
|
||||
|
||||
# Apply a modify update at timestamp 5.
|
||||
if self.modify and self.value_format != '8t':
|
||||
@ -216,8 +223,8 @@ class test_hs11(wttest.WiredTigerTestCase):
|
||||
|
||||
# Now apply an update at timestamp 20.
|
||||
for i in range(1, self.nrows):
|
||||
with self.transaction(commit_timestamp = 20):
|
||||
cursor[self.create_key(i)] = value2
|
||||
with self.transaction(commit_timestamp = 20):
|
||||
cursor[self.create_key(i)] = value2
|
||||
|
||||
# Ensure that we didn't select old history store content even if it is not blew away.
|
||||
with self.transaction(read_timestamp = 10, rollback = True):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user