summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
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/txn_rollback_to_stable.c
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/txn_rollback_to_stable.c')
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c29
1 files changed, 13 insertions, 16 deletions
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);
}