diff options
Diffstat (limited to 'src/mongo/db/catalog/collection_validation.cpp')
-rw-r--r-- | src/mongo/db/catalog/collection_validation.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/mongo/db/catalog/collection_validation.cpp b/src/mongo/db/catalog/collection_validation.cpp index 847514e1e7a..ac929f56234 100644 --- a/src/mongo/db/catalog/collection_validation.cpp +++ b/src/mongo/db/catalog/collection_validation.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kStorage #include "mongo/platform/basic.h" @@ -49,7 +49,7 @@ namespace mongo { -using logger::LogComponent; +using logv2::LogComponent; using std::string; MONGO_FAIL_POINT_DEFINE(pauseCollectionValidationWithLock); @@ -93,7 +93,7 @@ std::map<std::string, int64_t> _validateIndexesInternalStructure( const IndexAccessMethod* iam = entry->accessMethod(); LOGV2_OPTIONS(20295, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "validating internal structure", "index"_attr = descriptor->indexName(), "namespace"_attr = descriptor->parentNS()); @@ -132,7 +132,7 @@ void _validateIndexes(OperationContext* opCtx, const IndexDescriptor* descriptor = index->descriptor(); LOGV2_OPTIONS(20296, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "validating index consistency", "index"_attr = descriptor->indexName(), "namespace"_attr = descriptor->parentNS()); @@ -195,9 +195,8 @@ void _gatherIndexEntryErrors(OperationContext* opCtx, return; } - LOGV2_OPTIONS(20297, - {logComponentV1toV2(LogComponent::kIndex)}, - "Starting to traverse through all the document key sets."); + LOGV2_OPTIONS( + 20297, {LogComponent::kIndex}, "Starting to traverse through all the document key sets."); // During the second phase of validation, iterate through each documents key set and only record // the keys that were inconsistent during the first phase of validation. @@ -207,12 +206,9 @@ void _gatherIndexEntryErrors(OperationContext* opCtx, indexValidator->traverseRecordStore(opCtx, &tempValidateResults, &tempBuilder); } - LOGV2_OPTIONS(20298, - {logComponentV1toV2(LogComponent::kIndex)}, - "Finished traversing through all the document key sets."); - LOGV2_OPTIONS(20299, - {logComponentV1toV2(LogComponent::kIndex)}, - "Starting to traverse through all the indexes."); + LOGV2_OPTIONS( + 20298, {LogComponent::kIndex}, "Finished traversing through all the document key sets."); + LOGV2_OPTIONS(20299, {LogComponent::kIndex}, "Starting to traverse through all the indexes."); // Iterate through all the indexes in the collection and only record the index entry keys that // had inconsistencies during the first phase. @@ -222,7 +218,7 @@ void _gatherIndexEntryErrors(OperationContext* opCtx, const IndexDescriptor* descriptor = index->descriptor(); LOGV2_OPTIONS(20300, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "Traversing through the index entries", "index"_attr = descriptor->indexName()); @@ -232,9 +228,7 @@ void _gatherIndexEntryErrors(OperationContext* opCtx, /*ValidateResults=*/nullptr); } - LOGV2_OPTIONS(20301, - {logComponentV1toV2(LogComponent::kIndex)}, - "Finished traversing through all the indexes."); + LOGV2_OPTIONS(20301, {LogComponent::kIndex}, "Finished traversing through all the indexes."); indexConsistency->addIndexEntryErrors(indexNsResultsMap, result); } @@ -316,7 +310,7 @@ void _reportInvalidResults(OperationContext* opCtx, _reportValidationResults( opCtx, validateState, indexNsResultsMap, keysPerIndex, results, output); LOGV2_OPTIONS(20302, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "Validation complete -- Corruption found.", "namespace"_attr = validateState->nss(), "uuid"_attr = uuidString); @@ -493,7 +487,7 @@ Status validate(OperationContext* opCtx, // Validate the record store. LOGV2_OPTIONS(20303, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "validating collection", "namespace"_attr = validateState.nss(), "uuid"_attr = uuidString); @@ -546,7 +540,7 @@ Status validate(OperationContext* opCtx, if (indexConsistency.haveEntryMismatch()) { LOGV2_OPTIONS(20305, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "Index inconsistencies were detected. " "Starting the second phase of index validation to gather concise errors.", "namespace"_attr = validateState.nss()); @@ -589,7 +583,7 @@ Status validate(OperationContext* opCtx, opCtx, &validateState, &indexNsResultsMap, &keysPerIndex, results, output); LOGV2_OPTIONS(20306, - {logComponentV1toV2(LogComponent::kIndex)}, + {LogComponent::kIndex}, "Validation complete for collection. No " "corruption found.", "namespace"_attr = validateState.nss(), |