diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-10-09 14:52:18 -0400 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-10-09 14:52:18 -0400 |
commit | fc95450eafb94f080cf6769948358d42770f05ca (patch) | |
tree | 614aad734b6854ea9b9c1b2b9835028157c5ccd5 /src/third_party/wiredtiger/src/include/txn.i | |
parent | addc24e5dcc8c2053df56697d35162a8776446e5 (diff) | |
download | mongo-fc95450eafb94f080cf6769948358d42770f05ca.tar.gz |
Import wiredtiger: d235e0e71ef84c3f9d5a870f08feeff9a7c5581e from branch mongodb-4.2
ref: e7d742daa2..d235e0e71e
for: 4.1.4
WT-4214 Simplify timestamp handling for timestamp abort test
WT-4220 Enable long running prepared support
WT-4293 WT_CURSOR.remove can lose a cursor position
WT-4297 Enhance steady throughput workload
WT-4346 Remove prepared updates from lookaside on reading the page.
WT-4351 Ensure resolving prepared transactions use updates from itself
Diffstat (limited to 'src/third_party/wiredtiger/src/include/txn.i')
-rw-r--r-- | src/third_party/wiredtiger/src/include/txn.i | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/third_party/wiredtiger/src/include/txn.i b/src/third_party/wiredtiger/src/include/txn.i index 0b7e9ae1aa2..81646af5217 100644 --- a/src/third_party/wiredtiger/src/include/txn.i +++ b/src/third_party/wiredtiger/src/include/txn.i @@ -249,7 +249,6 @@ __wt_txn_op_set_key(WT_SESSION_IMPL *session, const WT_ITEM *key) WT_IS_METADATA(op->btree->dhandle)) return (0); -#ifdef HAVE_LONG_RUNNING_PREPARE WT_ASSERT(session, op->type == WT_TXN_OP_BASIC_ROW || op->type == WT_TXN_OP_INMEM_ROW); @@ -263,10 +262,6 @@ __wt_txn_op_set_key(WT_SESSION_IMPL *session, const WT_ITEM *key) * prepared. */ return (__wt_buf_set(session, &op->u.op_row.key, key->data, key->size)); -#else - WT_UNUSED(key); - return (0); -#endif } /* @@ -359,17 +354,25 @@ __wt_txn_resolve_prepared_op( * case. */ WT_ASSERT(session, upd != NULL || txn->multi_update_count != 0); - if (upd == NULL) + + /* + * We track the update count only for commit, but not for rollback, as + * our tracking is based on transaction id, and in case of rollback, we + * set it to aborted. + */ + if (upd == NULL && commit) --txn->multi_update_count; #endif - op->u.op_upd = upd; WT_STAT_CONN_INCR(session, txn_prepared_updates_resolved); for (; upd != NULL; upd = upd->next) { if (upd->txnid != txn->id) continue; + if (op->u.op_upd == NULL) + op->u.op_upd = upd; + if (!commit) { upd->txnid = WT_TXN_ABORTED; continue; |