From b6d8c5f1e0bc19f0223a026594246d247a1083e6 Mon Sep 17 00:00:00 2001 From: Gregory Wlodarek Date: Tue, 7 Feb 2023 22:49:42 +0000 Subject: SERVER-73706 Save WTRecordStoreUassertOutOfOrder fail point state to prevent concurrency bugs in testing (cherry picked from commit 237c050c840b906a8d4b4cd48e7e71e219f72df4) --- src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp | 6 +++--- 1 file 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 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"); -- cgit v1.2.1