diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-01-31 15:11:54 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-31 04:40:07 +0000 |
commit | 81ade37dc92f890f56cd9e72e1dd69e79d8a880d (patch) | |
tree | 69b817d6eb6f961f9f9bc71cb9cd77f515a99aaf | |
parent | 45d65c6733bdf9703ac818b7f0d8c4d4b6548372 (diff) | |
download | mongo-81ade37dc92f890f56cd9e72e1dd69e79d8a880d.tar.gz |
Import wiredtiger: 6fbe6dbeb566a6ae4672141a549980c64a615c86 from branch mongodb-master
ref: 5a05d84696..6fbe6dbeb5
for: 5.3.0
WT-8748 Turn off key-consistent checking for MongoDB builds
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn.c | 72 |
2 files changed, 44 insertions, 30 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 1edd5ac5058..9f6767443a2 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "5a05d846966df259cf48567f09b2b7632e394319" + "commit": "6fbe6dbeb566a6ae4672141a549980c64a615c86" } diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c index 5b4fd6e80d8..536663b0e57 100644 --- a/src/third_party/wiredtiger/src/txn/txn.c +++ b/src/third_party/wiredtiger/src/txn/txn.c @@ -1388,16 +1388,16 @@ err: return (ret); } +#ifdef WT_STANDALONE_BUILD /* - * __txn_commit_timestamps_assert -- + * __txn_commit_timestamps_assert_standalone -- * Validate that timestamps provided to commit are legal. */ static inline int -__txn_commit_timestamps_assert(WT_SESSION_IMPL *session) +__txn_commit_timestamps_assert_standalone(WT_SESSION_IMPL *session, WT_TXN *txn) { WT_CURSOR *cursor; WT_DECL_RET; - WT_TXN *txn; WT_TXN_OP *op; WT_UPDATE *upd; #ifdef HAVE_DIAGNOSTIC @@ -1405,34 +1405,10 @@ __txn_commit_timestamps_assert(WT_SESSION_IMPL *session) #endif wt_timestamp_t prev_op_durable_ts, prev_op_ts; u_int i; - bool op_zero_ts, upd_zero_ts, used_ts; + bool op_zero_ts, upd_zero_ts; - txn = session->txn; cursor = NULL; - used_ts = F_ISSET(txn, WT_TXN_HAS_TS_COMMIT) || F_ISSET(txn, WT_TXN_HAS_TS_DURABLE); - /* - * Debugging checks on timestamps, if user requested them. We additionally don't expect recovery - * to be using timestamps when applying commits. If recovery is running, skip this assert to - * avoid failing the recovery process. - */ - if (F_ISSET(txn, WT_TXN_TS_WRITE_ALWAYS) && !used_ts && txn->mod_count != 0 && - !F_ISSET(S2C(session), WT_CONN_RECOVERING)) - WT_RET_MSG(session, EINVAL, "commit_timestamp required and none set on this transaction"); - if (F_ISSET(txn, WT_TXN_TS_WRITE_NEVER) && used_ts && txn->mod_count != 0) - WT_RET_MSG( - session, EINVAL, "no commit_timestamp expected and timestamp set on this transaction"); - - if (txn->commit_timestamp > txn->durable_timestamp) - WT_RET_MSG( - session, EINVAL, "transaction with commit timestamp greater than durable timestamp"); - - /* - * If we're not doing any key consistency checking, we're done. - */ - if (!F_ISSET(txn, WT_TXN_TS_WRITE_ORDERED)) - return (0); - /* * Error on any valid update structures for the same key that are at a later timestamp or use * timestamps inconsistently. @@ -1523,7 +1499,7 @@ __txn_commit_timestamps_assert(WT_SESSION_IMPL *session) * comparing commit timestamps would be. */ WT_ASSERT(session, txn->durable_timestamp >= op_ts && prev_op_durable_ts >= prev_op_ts); - if (F_ISSET(txn, WT_TXN_TS_WRITE_ORDERED) && txn->durable_timestamp < prev_op_durable_ts) + if (txn->durable_timestamp < prev_op_durable_ts) WT_ERR_MSG(session, EINVAL, "out of order commit timestamps"); } @@ -1536,6 +1512,44 @@ err: WT_TRET(cursor->close(cursor)); return (ret); } +#endif + +/* + * __txn_commit_timestamps_assert -- + * Validate that timestamps provided to commit are legal. + */ +static inline int +__txn_commit_timestamps_assert(WT_SESSION_IMPL *session) +{ + WT_TXN *txn; + bool used_ts; + + txn = session->txn; + used_ts = F_ISSET(txn, WT_TXN_HAS_TS_COMMIT) || F_ISSET(txn, WT_TXN_HAS_TS_DURABLE); + + /* + * Debugging checks on timestamps, if user requested them. We additionally don't expect recovery + * to be using timestamps when applying commits. If recovery is running, skip this assert to + * avoid failing the recovery process. + */ + if (F_ISSET(txn, WT_TXN_TS_WRITE_ALWAYS) && !used_ts && txn->mod_count != 0 && + !F_ISSET(S2C(session), WT_CONN_RECOVERING)) + WT_RET_MSG(session, EINVAL, "commit_timestamp required and none set on this transaction"); + if (F_ISSET(txn, WT_TXN_TS_WRITE_NEVER) && used_ts && txn->mod_count != 0) + WT_RET_MSG( + session, EINVAL, "no commit_timestamp expected and timestamp set on this transaction"); + + if (txn->commit_timestamp > txn->durable_timestamp) + WT_RET_MSG( + session, EINVAL, "transaction with commit timestamp greater than durable timestamp"); + +#ifdef WT_STANDALONE_BUILD + /* If we're not doing any key consistency checking, we're done. */ + if (F_ISSET(txn, WT_TXN_TS_WRITE_ORDERED)) + WT_RET(__txn_commit_timestamps_assert_standalone(session, txn)); +#endif + return (0); +} /* * __txn_mod_compare -- |