summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/validate_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/validate_state.cpp')
-rw-r--r--src/mongo/db/catalog/validate_state.cpp46
1 files changed, 33 insertions, 13 deletions
diff --git a/src/mongo/db/catalog/validate_state.cpp b/src/mongo/db/catalog/validate_state.cpp
index 4abd966b19e..843d7527c9b 100644
--- a/src/mongo/db/catalog/validate_state.cpp
+++ b/src/mongo/db/catalog/validate_state.cpp
@@ -42,6 +42,7 @@
#include "mongo/db/operation_context.h"
#include "mongo/db/storage/durable_catalog.h"
#include "mongo/db/views/view_catalog.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/fail_point.h"
#include "mongo/util/log.h"
@@ -167,8 +168,11 @@ void ValidateState::initializeCursors(OperationContext* opCtx) {
} catch (const ExceptionFor<ErrorCodes::CursorNotFound>& ex) {
invariant(_background);
// End the validation if we can't open a checkpoint cursor on the collection.
- log() << "Skipping background validation on collection '" << _nss
- << "' because the collection is not yet in a checkpoint: " << ex;
+ LOGV2(20405,
+ "Skipping background validation on collection '{nss}' because the collection is not "
+ "yet in a checkpoint: {ex}",
+ "nss"_attr = _nss,
+ "ex"_attr = ex);
throw;
}
@@ -178,8 +182,11 @@ void ValidateState::initializeCursors(OperationContext* opCtx) {
opCtx, _collection->getCatalogId(), &readyDurableIndexes);
} catch (const ExceptionFor<ErrorCodes::CursorNotFound>& ex) {
invariant(_background);
- log() << "Skipping background validation on collection '" << _nss
- << "' because the data is not yet in a checkpoint: " << ex;
+ LOGV2(20406,
+ "Skipping background validation on collection '{nss}' because the data is not yet in "
+ "a checkpoint: {ex}",
+ "nss"_attr = _nss,
+ "ex"_attr = ex);
throw;
}
@@ -197,8 +204,11 @@ void ValidateState::initializeCursors(OperationContext* opCtx) {
std::find(readyDurableIndexes.begin(), readyDurableIndexes.end(), desc->indexName()) !=
readyDurableIndexes.end();
if (_background && !isIndexDurable) {
- log() << "Skipping validation on index '" << desc->indexName() << "' in collection '"
- << _nss << "' because the index is not yet in a checkpoint.";
+ LOGV2(20407,
+ "Skipping validation on index '{desc_indexName}' in collection '{nss}' because "
+ "the index is not yet in a checkpoint.",
+ "desc_indexName"_attr = desc->indexName(),
+ "nss"_attr = _nss);
continue;
}
@@ -211,8 +221,11 @@ void ValidateState::initializeCursors(OperationContext* opCtx) {
opCtx->getServiceContext()->getStorageEngine()->getCatalog()->getIndexIdent(
opCtx, _collection->getCatalogId(), desc->indexName());
if (entry->getIdent() != diskIndexIdent) {
- log() << "Skipping validation on index '" << desc->indexName() << "' in collection '"
- << _nss << "' because the index was recreated and is not yet in a checkpoint.";
+ LOGV2(20408,
+ "Skipping validation on index '{desc_indexName}' in collection '{nss}' because "
+ "the index was recreated and is not yet in a checkpoint.",
+ "desc_indexName"_attr = desc->indexName(),
+ "nss"_attr = _nss);
continue;
}
@@ -224,8 +237,12 @@ void ValidateState::initializeCursors(OperationContext* opCtx) {
invariant(_background);
// This can only happen if the checkpoint has the MDB catalog entry for the index, but
// not the corresponding index table.
- log() << "Skipping validation on index '" << desc->indexName() << "' in collection '"
- << _nss << "' because the index data is not in a checkpoint: " << ex;
+ LOGV2(20409,
+ "Skipping validation on index '{desc_indexName}' in collection '{nss}' because "
+ "the index data is not in a checkpoint: {ex}",
+ "desc_indexName"_attr = desc->indexName(),
+ "nss"_attr = _nss,
+ "ex"_attr = ex);
continue;
}
@@ -235,8 +252,11 @@ void ValidateState::initializeCursors(OperationContext* opCtx) {
opCtx->getServiceContext()->getStorageEngine()->isInIndividuallyCheckpointedIndexesList(
diskIndexIdent)) {
_indexCursors.erase(desc->indexName());
- log() << "Skipping validation on index '" << desc->indexName() << "' in collection '"
- << _nss << "' because the index data is not yet consistent in the checkpoint.";
+ LOGV2(20410,
+ "Skipping validation on index '{desc_indexName}' in collection '{nss}' because "
+ "the index data is not yet consistent in the checkpoint.",
+ "desc_indexName"_attr = desc->indexName(),
+ "nss"_attr = _nss);
continue;
}
@@ -261,7 +281,7 @@ void ValidateState::_relockDatabaseAndCollection(OperationContext* opCtx) {
_databaseLock.reset();
if (MONGO_unlikely(hangDuringYieldingLocksForValidation.shouldFail())) {
- log() << "Hanging on fail point 'hangDuringYieldingLocksForValidation'";
+ LOGV2(20411, "Hanging on fail point 'hangDuringYieldingLocksForValidation'");
hangDuringYieldingLocksForValidation.pauseWhileSet();
}