summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/txn
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2020-05-25 15:55:23 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-25 06:16:02 +0000
commitc480627eae1b5d09f8eea247b396b45b89a5c275 (patch)
tree3f189d5d70cfab814fe7e0808692b271663d8c39 /src/third_party/wiredtiger/src/txn
parentd169769bba283cd0a1906c81580ff8e7cf7bcd93 (diff)
downloadmongo-c480627eae1b5d09f8eea247b396b45b89a5c275.tar.gz
Import wiredtiger: 0ec94ad7e360d93cb91f558d7efc03c644b1a9f8 from branch mongodb-4.4
ref: 5a3c70d7e4..0ec94ad7e3 for: 4.5.1 WT-6199 Fix PPC test variables in evergreen.yml WT-6219 Fix application threads history store visibility during eviction WT-6220 Add statistics tracking when times are written to disk WT-6251 Fix splits to reduce the size of index files WT-6260 Disable post salvage verify in format WT-6266 Metadata verify of the HS file can fail if underlying objects are corrupted WT-6278 Return from resolve prepared op when we have already resolved the operations WT-6284 History store isn't visible to wt dump WT-6287 Remove WT_TXN_HAS_TS_READ flag
Diffstat (limited to 'src/third_party/wiredtiger/src/txn')
-rw-r--r--src/third_party/wiredtiger/src/txn/txn.c7
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_ckpt.c15
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_log.c2
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_timestamp.c4
4 files changed, 15 insertions, 13 deletions
diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c
index dac020c35f1..af9aac63b11 100644
--- a/src/third_party/wiredtiger/src/txn/txn.c
+++ b/src/third_party/wiredtiger/src/txn/txn.c
@@ -889,14 +889,15 @@ __txn_resolve_prepared_op(WT_SESSION_IMPL *session, WT_TXN_OP *op, bool commit,
* Aborted updates can exist in the update chain of our transaction. Generally this will occur
* due to a reserved update. As such we should skip over these updates.
*/
- for (; upd->txnid == WT_TXN_ABORTED; upd = upd->next)
+ for (; upd != NULL && upd->txnid == WT_TXN_ABORTED; upd = upd->next)
;
/*
* The head of the update chain is not a prepared update, which means all the prepared updates
- * of the key are resolved.
+ * of the key are resolved. The head of the update chain can also be null in the scenario that
+ * we rolled back all associated updates in the previous iteration of this function.
*/
- if (upd->prepare_state != WT_PREPARE_INPROGRESS)
+ if (upd == NULL || upd->prepare_state != WT_PREPARE_INPROGRESS)
return (0);
/*
diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c
index 4d09899ddf5..eb3ab25b823 100644
--- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c
+++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c
@@ -605,8 +605,8 @@ __checkpoint_prepare(WT_SESSION_IMPL *session, bool *trackingp, const char *cfg[
* We rely on having the global transaction data locked so the oldest timestamp can't move past
* the stable timestamp.
*/
- WT_ASSERT(session, !F_ISSET(txn, WT_TXN_HAS_TS_COMMIT | WT_TXN_HAS_TS_READ |
- WT_TXN_SHARED_TS_DURABLE | WT_TXN_SHARED_TS_READ));
+ WT_ASSERT(session,
+ !F_ISSET(txn, WT_TXN_HAS_TS_COMMIT | WT_TXN_SHARED_TS_DURABLE | WT_TXN_SHARED_TS_READ));
if (use_timestamp) {
/*
@@ -773,8 +773,9 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
logging = FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED);
- /* Reset the maximum page size seen by eviction. */
- conn->cache->evict_max_page_size = 0;
+ /* Reset the statistics tracked per checkpoint. */
+ cache->evict_max_page_size = 0;
+ conn->rec_maximum_seconds = 0;
/* Initialize the verbose tracking timer */
__wt_epoch(session, &conn->ckpt_timer_start);
@@ -1702,20 +1703,20 @@ __checkpoint_tree_helper(WT_SESSION_IMPL *session, const char *cfg[])
txn = session->txn;
/* Are we using a read timestamp for this checkpoint transaction? */
- with_timestamp = F_ISSET(txn, WT_TXN_HAS_TS_READ);
+ with_timestamp = F_ISSET(txn, WT_TXN_SHARED_TS_READ);
/*
* For tables with immediate durability (indicated by having logging enabled), ignore any read
* timestamp configured for the checkpoint.
*/
if (__wt_btree_immediately_durable(session))
- F_CLR(txn, WT_TXN_HAS_TS_READ);
+ F_CLR(txn, WT_TXN_SHARED_TS_READ);
ret = __checkpoint_tree(session, true, cfg);
/* Restore the use of the timestamp for other tables. */
if (with_timestamp)
- F_SET(txn, WT_TXN_HAS_TS_READ);
+ F_SET(txn, WT_TXN_SHARED_TS_READ);
/*
* Whatever happened, we aren't visiting this tree again in this checkpoint. Don't keep updates
diff --git a/src/third_party/wiredtiger/src/txn/txn_log.c b/src/third_party/wiredtiger/src/txn/txn_log.c
index 37a91dd0d6a..e52cc139906 100644
--- a/src/third_party/wiredtiger/src/txn/txn_log.c
+++ b/src/third_party/wiredtiger/src/txn/txn_log.c
@@ -428,7 +428,7 @@ __wt_txn_ts_log(WT_SESSION_IMPL *session)
durable = txn->durable_timestamp;
if (F_ISSET(txn, WT_TXN_HAS_TS_PREPARE))
prepare = txn->prepare_timestamp;
- if (F_ISSET(txn, WT_TXN_HAS_TS_READ))
+ if (F_ISSET(txn, WT_TXN_SHARED_TS_READ))
read = txn_shared->read_timestamp;
__wt_epoch(session, &t);
diff --git a/src/third_party/wiredtiger/src/txn/txn_timestamp.c b/src/third_party/wiredtiger/src/txn/txn_timestamp.c
index a2a3dea7a5c..ba311cc93f0 100644
--- a/src/third_party/wiredtiger/src/txn/txn_timestamp.c
+++ b/src/third_party/wiredtiger/src/txn/txn_timestamp.c
@@ -830,7 +830,7 @@ __wt_txn_set_read_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t read_ts)
" isolation");
/* Read timestamps can't change once set. */
- if (F_ISSET(txn, WT_TXN_HAS_TS_READ))
+ if (F_ISSET(txn, WT_TXN_SHARED_TS_READ))
WT_RET_MSG(session, EINVAL,
"a read_timestamp"
" may only be set once per transaction");
@@ -1152,7 +1152,7 @@ __wt_txn_publish_read_timestamp(WT_SESSION_IMPL *session)
++txn_global->read_timestampq_len;
WT_STAT_CONN_INCR(session, txn_read_queue_inserts);
txn_shared->clear_read_q = false;
- F_SET(txn, WT_TXN_HAS_TS_READ | WT_TXN_SHARED_TS_READ);
+ F_SET(txn, WT_TXN_SHARED_TS_READ);
__wt_writeunlock(session, &txn_global->read_timestamp_rwlock);
}