summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/catalog_control.cpp
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2020-02-13 11:49:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-13 18:16:35 +0000
commita84c09a19720b73cedb2e8ef7c5cfeedfa1c9761 (patch)
tree85ac46cd5f4ea6d5134560bf764fb9e6cf11fe4e /src/mongo/db/catalog/catalog_control.cpp
parent6df40e01f7b6899affc4536e7e73a35802cabf98 (diff)
downloadmongo-a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761.tar.gz
SERVER-45869 automatically converted structured logging
Diffstat (limited to 'src/mongo/db/catalog/catalog_control.cpp')
-rw-r--r--src/mongo/db/catalog/catalog_control.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/mongo/db/catalog/catalog_control.cpp b/src/mongo/db/catalog/catalog_control.cpp
index 3df128c471f..97010dc6ac3 100644
--- a/src/mongo/db/catalog/catalog_control.cpp
+++ b/src/mongo/db/catalog/catalog_control.cpp
@@ -43,6 +43,7 @@
#include "mongo/db/index_builds_coordinator.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/rebuild_indexes.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/log.h"
namespace mongo {
@@ -72,8 +73,13 @@ MinVisibleTimestampMap closeCatalog(OperationContext* opCtx) {
// If there's a minimum visible, invariant there's also a UUID.
invariant(!minVisible || uuid);
if (uuid && minVisible) {
- LOG(1) << "closeCatalog: preserving min visible timestamp. Collection: "
- << coll->ns() << " UUID: " << uuid << " TS: " << minVisible;
+ LOGV2_DEBUG(20269,
+ 1,
+ "closeCatalog: preserving min visible timestamp. Collection: {coll_ns} "
+ "UUID: {uuid} TS: {minVisible}",
+ "coll_ns"_attr = coll->ns(),
+ "uuid"_attr = uuid,
+ "minVisible"_attr = minVisible);
minVisibleTimestampMap[*uuid] = *minVisible;
}
}
@@ -87,14 +93,14 @@ MinVisibleTimestampMap closeCatalog(OperationContext* opCtx) {
// to work before acquiring locks, and might otherwise spuriously regard a UUID as unknown
// while reloading the catalog.
CollectionCatalog::get(opCtx).onCloseCatalog(opCtx);
- LOG(1) << "closeCatalog: closing collection catalog";
+ LOGV2_DEBUG(20270, 1, "closeCatalog: closing collection catalog");
// Close all databases.
- log() << "closeCatalog: closing all databases";
+ LOGV2(20271, "closeCatalog: closing all databases");
databaseHolder->closeAll(opCtx);
// Close the storage engine's catalog.
- log() << "closeCatalog: closing storage engine catalog";
+ LOGV2(20272, "closeCatalog: closing storage engine catalog");
opCtx->getServiceContext()->getStorageEngine()->closeCatalog(opCtx);
reopenOnFailure.dismiss();
@@ -105,11 +111,11 @@ void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisib
invariant(opCtx->lockState()->isW());
// Load the catalog in the storage engine.
- log() << "openCatalog: loading storage engine catalog";
+ LOGV2(20273, "openCatalog: loading storage engine catalog");
auto storageEngine = opCtx->getServiceContext()->getStorageEngine();
storageEngine->loadCatalog(opCtx);
- log() << "openCatalog: reconciling catalog and idents";
+ LOGV2(20274, "openCatalog: reconciling catalog and idents");
auto reconcileResult = fassert(40688, storageEngine->reconcileCatalogAndIdents(opCtx));
// Determine which indexes need to be rebuilt. rebuildIndexesOnCollection() requires that all
@@ -149,8 +155,10 @@ void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisib
invariant(collection, str::stream() << "couldn't get collection " << collNss.toString());
for (const auto& indexName : entry.second.first) {
- log() << "openCatalog: rebuilding index: collection: " << collNss.toString()
- << ", index: " << indexName;
+ LOGV2(20275,
+ "openCatalog: rebuilding index: collection: {collNss}, index: {indexName}",
+ "collNss"_attr = collNss.toString(),
+ "indexName"_attr = indexName);
}
std::vector<BSONObj> indexSpecs = entry.second.second;
@@ -165,7 +173,7 @@ void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisib
opCtx, reconcileResult.indexBuildsToRestart);
// Open all databases and repopulate the CollectionCatalog.
- log() << "openCatalog: reopening all databases";
+ LOGV2(20276, "openCatalog: reopening all databases");
auto databaseHolder = DatabaseHolder::get(opCtx);
std::vector<std::string> databasesToOpen = storageEngine->listDatabases();
for (auto&& dbName : databasesToOpen) {
@@ -189,7 +197,7 @@ void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisib
// If this is the oplog collection, re-establish the replication system's cached pointer
// to the oplog.
if (collNss.isOplog()) {
- log() << "openCatalog: updating cached oplog pointer";
+ LOGV2(20277, "openCatalog: updating cached oplog pointer");
collection->establishOplogCollectionForLogging(opCtx);
}
}
@@ -199,7 +207,7 @@ void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisib
// catalog. Clear the pre-closing state.
CollectionCatalog::get(opCtx).onOpenCatalog(opCtx);
opCtx->getServiceContext()->incrementCatalogGeneration();
- log() << "openCatalog: finished reloading collection catalog";
+ LOGV2(20278, "openCatalog: finished reloading collection catalog");
}
} // namespace catalog
} // namespace mongo