summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2023-01-31 13:59:49 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-10 23:57:03 +0000
commit835768e45b76a71cc9e12f6684e51a6d1d8dcc87 (patch)
tree768dde785cc93309efc79043fd9e56e5561f20dd
parent9eab85fedf0c1c07999f26384631e6a0fcd400b3 (diff)
downloadmongo-835768e45b76a71cc9e12f6684e51a6d1d8dcc87.tar.gz
SERVER-71950 Fail and log the operation when out-of-order keys are detected in WiredTiger
(cherry picked from commit b2085e2d422278733bb6925614eb0c2f36348034)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index 48c1dea7283..b6901ac3811 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -2195,19 +2195,18 @@ boost::optional<Record> WiredTigerRecordStoreCursorBase::next() {
}
if (_forward && _lastReturnedId >= id) {
- LOGV2(22406,
- "WTCursor::next -- c->next_key ( {next}) was not greater than _lastReturnedId "
- "({last}) which is a bug.",
- "WTCursor::next -- next was not greater than last which is a bug",
- "next"_attr = id,
- "last"_attr = _lastReturnedId);
-
// Crash when testing diagnostics are enabled.
invariant(!TestingProctor::instance().isEnabled());
- // Force a retry of the operation from our last known position by acting as-if
- // we received a WT_ROLLBACK error.
- throw WriteConflictException();
+ // uassert with 'DataCorruptionDetected' after logging.
+ LOGV2_ERROR_OPTIONS(22406,
+ {logv2::UserAssertAfterLog(ErrorCodes::DataCorruptionDetected)},
+ "WT_Cursor::next -- returned out-of-order keys",
+ "forward"_attr = _forward,
+ "next"_attr = id,
+ "last"_attr = _lastReturnedId,
+ "ident"_attr = _rs._ident,
+ "ns"_attr = _rs.ns());
}
WT_ITEM value;