summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-03-02 14:52:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-03 18:14:05 +0000
commit2803adc3ba76f87101d493cb940df4e0f53c7879 (patch)
tree73d5e0dbcf26bcff51fecc469b5e31d01c918585 /src/mongo/db/exec
parenta68774045ce42d55e82236408bd9cf004c54d12a (diff)
downloadmongo-2803adc3ba76f87101d493cb940df4e0f53c7879.tar.gz
SERVER-46520 Add mechanism to emit uassert as part of a logv2 log statement
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/working_set_common.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mongo/db/exec/working_set_common.cpp b/src/mongo/db/exec/working_set_common.cpp
index a481d0df533..3e2670ca7b4 100644
--- a/src/mongo/db/exec/working_set_common.cpp
+++ b/src/mongo/db/exec/working_set_common.cpp
@@ -90,21 +90,15 @@ bool WorkingSetCommon::fetch(OperationContext* opCtx,
const auto& keyDatum) {
return keyDatum.snapshotId == currentSnapshotId;
})) != member->keyData.end()) {
- std::stringstream ss;
- ss << "Erroneous index key found with reference to non-existent record id "
- << member->recordId << ": " << indexKeyVectorDebugString(member->keyData)
- << ". Consider dropping and then re-creating the index with key pattern "
- << keyDataIt->indexKeyPattern << " and then running the validate command on the "
- << ns << " collection.";
-
auto indexKeyEntryToObjFn = [](const IndexKeyDatum& ikd) {
BSONObjBuilder builder;
builder.append("key"_sd, redact(ikd.keyData));
builder.append("pattern"_sd, ikd.indexKeyPattern);
return builder.obj();
};
- LOGV2_ERROR(
+ LOGV2_ERROR_OPTIONS(
4615603,
+ {logv2::UserAssertAfterLog(ErrorCodes::DataCorruptionDetected)},
"Erroneous index key found with reference to non-existent record id "
"{recordId}: "
"{indexKeyData}. Consider dropping and then re-creating the index with key "
@@ -115,7 +109,6 @@ bool WorkingSetCommon::fetch(OperationContext* opCtx,
boost::make_transform_iterator(member->keyData.begin(), indexKeyEntryToObjFn),
boost::make_transform_iterator(member->keyData.end(), indexKeyEntryToObjFn)),
"indexKeyPattern"_attr = keyDataIt->indexKeyPattern);
- uasserted(ErrorCodes::DataCorruptionDetected, ss.str());
}
return false;
}