From a18228593a8e86f037e102a5e5f61dae68c1583e Mon Sep 17 00:00:00 2001 From: Gregory Wlodarek Date: Tue, 1 Feb 2022 21:09:49 +0000 Subject: SERVER-61203 Use the WiredTiger version cursor to print the collection records metadata when corruption is detected during validation --- src/mongo/db/catalog/index_consistency.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mongo/db/catalog/index_consistency.cpp b/src/mongo/db/catalog/index_consistency.cpp index c5c0a2d1ce7..141a54cf00b 100644 --- a/src/mongo/db/catalog/index_consistency.cpp +++ b/src/mongo/db/catalog/index_consistency.cpp @@ -348,6 +348,9 @@ void IndexConsistency::addDocKey(OperationContext* opCtx, invariant(_missingIndexEntries.count(key) == 0); _missingIndexEntries.insert( std::make_pair(key, IndexEntryInfo(*indexInfo, recordId, idKeyBuilder.obj(), ks))); + + // Prints the collection document's metadata. + _validateState->getCollection()->getRecordStore()->printRecordMetadata(opCtx, recordId); } } @@ -419,6 +422,10 @@ void IndexConsistency::addIndexKey(OperationContext* opCtx, if (search == _extraIndexEntries.end()) { SimpleBSONObjSet infoSet = {info}; _extraIndexEntries.insert(std::make_pair(key, infoSet)); + + // Prints the collection document's metadata. + _validateState->getCollection()->getRecordStore()->printRecordMetadata(opCtx, + recordId); return; } search->second.insert(info); -- cgit v1.2.1