diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2023-01-31 13:59:49 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-10 22:27:11 +0000 |
commit | befb5b1bf6b71bd168f73467d1c3d7c66d737ed2 (patch) | |
tree | e14da439004ace958698d15671e288d5462a55f5 | |
parent | 9dbe0a11bf15f2c4079e5a1ddd1d9e5838f4addc (diff) | |
download | mongo-befb5b1bf6b71bd168f73467d1c3d7c66d737ed2.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.cpp | 19 |
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 359ac8318b2..6c6d7ad19f7 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -2209,19 +2209,18 @@ boost::optional<Record> WiredTigerRecordStoreCursorBase::next() { } if (_forward && _lastReturnedId >= id) { - LOGV2_ERROR(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(), "next was not greater than last"); - // 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; |