summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/txn
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2020-08-10 13:47:18 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-10 04:00:15 +0000
commit78207ca380688c73b1a217f23d5b7c8803bef9cd (patch)
tree12572958536b96c3a73e3bd545776768c1f93926 /src/third_party/wiredtiger/src/txn
parente6e4fb531c545ce538e84116c7cb6046de009bb0 (diff)
downloadmongo-78207ca380688c73b1a217f23d5b7c8803bef9cd.tar.gz
Import wiredtiger: 9c79fedf125e1d63250d767a8bddffcfa9fb7757 from branch mongodb-4.4
ref: 8092bf0a39..9c79fedf12 for: 4.4.1 WT-5571 Evergreen loses compiler warnings, need way to add to CFLAGS WT-5717 Reenable history store salvage test WT-5945 Enable stricter performance for test_wt2853_perf WT-5970 Update test_wt4333_handle_locks to use 1GB cache size WT-6215 Clear backup block information on rename WT-6233 Add statistic to track the number of times we remove keys from the history store due to inserting 0 timestamped entries WT-6274 SESSIONs shouldn't nest calls to get/release hs cursor WT-6325 Fast truncate can lead to never resolved prepared operations WT-6331 Set oldest timestamp on startup of WiredTiger WT-6421 Avoid parsing metadata checkpoint for clean files WT-6425 Turn off log archiving to avoid file copy race WT-6440 Use onpage visibility check helpers in __wt_txn_update_check WT-6466 Don't reset the WT_SESSION timers when HS cursors are closed WT-6468 Discard a deleted page that is cleaned by a checkpoint WT-6473 format configuration with tiny caches can result in empty objects WT-6474 Configure the global RNG before doing any command-line or configuration file processing WT-6479 Don't insert updates after the first globally visible update to the history store WT-6488 Fail update restore eviction if no new updates were written WT-6491 No need to append the onpage value if it is prepared WT-6492 Use WT_UPDATE_RESTORED_FROM_DS to determine if the onpage value is on the update chain or not WT-6493 Retry processing update list if a prepared update is modified concurrently WT-6499 Ignore evict priority for btrees that are dominating cache usage WT-6508 Perform checkpoint cleanup on data store as part of checkpoint WT-6511 cursor join: explicitly advance the iterator when finished with a clause WT-6514 Fix description of eviction_updates_trigger in the documentation WT-6517 Update test_txn13 to avoid getting a rollback error WT-6519 Add testing coverage for mongodb-4.6 branch in compatibility test WT-6521 Don't perform checkpoint cleanup during server startup and shutdown phase WT-6527 When a thread cannot be allocated, return cleanly from WT API WT-6528 Remove offensive terminology in WiredTiger API and source code WT-6529 Use helper function in __rollback_abort_row_ondisk_kv WT-6533 No need to do obsolete check before inserting to history store WT-6539 Fix backup and rename memory leak WT-6543 Distinguish Evergreen artifacts links across restarts for testing tasks WT-6551 Avoid a timing problem at the beginning of a test for log preallocation WT-6552 Fix configure flags in evergreen.yml for failing PPC tests
Diffstat (limited to 'src/third_party/wiredtiger/src/txn')
-rw-r--r--src/third_party/wiredtiger/src/txn/txn.c18
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_ckpt.c68
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_recover.c105
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c29
4 files changed, 154 insertions, 66 deletions
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);
}