summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2023-02-07 22:49:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-10 22:27:11 +0000
commitb6d8c5f1e0bc19f0223a026594246d247a1083e6 (patch)
tree794a032a99e3e9380c602e6d846b472e9476ffa0
parenteeebf8387291cf2c0e92ab092e3db4882042b50b (diff)
downloadmongo-b6d8c5f1e0bc19f0223a026594246d247a1083e6.tar.gz
SERVER-73706 Save WTRecordStoreUassertOutOfOrder fail point state to prevent concurrency bugs in testing
(cherry picked from commit 237c050c840b906a8d4b4cd48e7e71e219f72df4)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index 0ce8fa2eb47..a8744700509 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -2209,9 +2209,9 @@ boost::optional<Record> WiredTigerRecordStoreCursorBase::next() {
return {};
}
- if ((_forward && _lastReturnedId >= id) ||
- MONGO_unlikely(WTRecordStoreUassertOutOfOrder.shouldFail())) {
- if (!WTRecordStoreUassertOutOfOrder.shouldFail()) {
+ const bool failWithOutOfOrderForTest = WTRecordStoreUassertOutOfOrder.shouldFail();
+ if ((_forward && _lastReturnedId >= id) || MONGO_unlikely(failWithOutOfOrderForTest)) {
+ if (!failWithOutOfOrderForTest) {
// Crash when testing diagnostics are enabled and not explicitly uasserting on
// out-of-order keys.
invariant(!TestingProctor::instance().isEnabled(), "cursor returned out-of-order keys");