summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/include/txn.i
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/include/txn.i')
-rw-r--r--src/third_party/wiredtiger/src/include/txn.i17
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;