summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2023-02-02 14:10:48 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-03 05:38:44 +0000
commit62bb15a35fa62ec4888b99ac511b55d2337949f4 (patch)
tree578b4d3f7baafe32acd93b75d5aa06ca299d3884
parentff06d8d8c15e6b4f79231a385539741bb169dac1 (diff)
downloadmongo-62bb15a35fa62ec4888b99ac511b55d2337949f4.tar.gz
SERVER-73497 Create an interface for the HealthLog
-rw-r--r--src/mongo/db/SConscript3
-rw-r--r--src/mongo/db/catalog/SConscript16
-rw-r--r--src/mongo/db/catalog/health_log.cpp23
-rw-r--r--src/mongo/db/catalog/health_log.h44
-rw-r--r--src/mongo/db/catalog/health_log_interface.cpp54
-rw-r--r--src/mongo/db/catalog/health_log_interface.h92
-rw-r--r--src/mongo/db/commands/dbcheck.cpp16
-rw-r--r--src/mongo/db/mongod_main.cpp9
-rw-r--r--src/mongo/db/namespace_string.cpp5
-rw-r--r--src/mongo/db/namespace_string.h3
-rw-r--r--src/mongo/db/repl/SConscript2
-rw-r--r--src/mongo/db/repl/dbcheck.cpp13
-rw-r--r--src/mongo/db/storage/wiredtiger/SConscript2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp4
-rw-r--r--src/mongo/embedded/embedded.cpp1
15 files changed, 204 insertions, 83 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 00bcea53987..ad4d9953c38 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -2181,7 +2181,7 @@ env.Library(
'catalog/catalog_impl',
'catalog/collection_options',
'catalog/document_validation',
- 'catalog/health_log',
+ 'catalog/health_log_interface',
'catalog/index_key_validate',
'client_metadata_propagation_egress_hook',
'collection_index_usage_tracker',
@@ -2307,6 +2307,7 @@ env.Library(
'catalog/catalog_helpers',
'catalog/catalog_impl',
'catalog/health_log',
+ 'catalog/health_log_interface',
'commands/mongod',
'commands/test_commands',
'concurrency/flow_control_ticketholder',
diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript
index 86bb7f1ec23..3cdfb6adcea 100644
--- a/src/mongo/db/catalog/SConscript
+++ b/src/mongo/db/catalog/SConscript
@@ -92,10 +92,21 @@ env.Library(
)
env.Library(
+ target='health_log_interface',
+ source=[
+ 'health_log.idl',
+ 'health_log_interface.cpp',
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/service_context',
+ '$BUILD_DIR/mongo/util/namespace_string_database_name_util',
+ ],
+)
+
+env.Library(
target='health_log',
source=[
'health_log.cpp',
- 'health_log.idl',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/concurrency/deferred_writer',
@@ -103,6 +114,7 @@ env.Library(
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/util/namespace_string_database_name_util',
'collection_options',
+ 'health_log_interface',
],
)
@@ -415,7 +427,7 @@ env.Library(
'collection_options',
'collection_query_info',
'document_validation',
- 'health_log',
+ 'health_log_interface',
'index_build_block',
'index_catalog',
'index_catalog_entry',
diff --git a/src/mongo/db/catalog/health_log.cpp b/src/mongo/db/catalog/health_log.cpp
index 46f14a5d662..9626d456111 100644
--- a/src/mongo/db/catalog/health_log.cpp
+++ b/src/mongo/db/catalog/health_log.cpp
@@ -27,18 +27,14 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include "mongo/db/catalog/health_log.h"
#include "mongo/db/catalog/health_log_gen.h"
#include "mongo/db/db_raii.h"
+#include "mongo/db/namespace_string.h"
namespace mongo {
namespace {
-const ServiceContext::Decoration<HealthLog> getHealthLog =
- ServiceContext::declareDecoration<HealthLog>();
-
const int64_t kDefaultHealthlogSize = 100'000'000;
CollectionOptions getOptions(void) {
@@ -50,24 +46,17 @@ CollectionOptions getOptions(void) {
}
} // namespace
-HealthLog::HealthLog() : _writer(nss, getOptions(), kMaxBufferSize) {}
+HealthLog::HealthLog()
+ : _writer(NamespaceString::kLocalHealthLogNamespace, getOptions(), kMaxBufferSize) {}
-void HealthLog::startup(void) {
+void HealthLog::startup() {
_writer.startup(std::string("healthlog writer"));
}
-void HealthLog::shutdown(void) {
+void HealthLog::shutdown() {
_writer.shutdown();
}
-HealthLog& HealthLog::get(ServiceContext* svcCtx) {
- return getHealthLog(svcCtx);
-}
-
-HealthLog& HealthLog::get(OperationContext* opCtx) {
- return getHealthLog(opCtx->getServiceContext());
-}
-
bool HealthLog::log(const HealthLogEntry& entry) {
BSONObjBuilder builder;
OID oid;
@@ -76,6 +65,4 @@ bool HealthLog::log(const HealthLogEntry& entry) {
entry.serialize(&builder);
return _writer.insertDocument(builder.obj());
}
-
-const NamespaceString HealthLog::nss("local", "system.healthlog");
} // namespace mongo
diff --git a/src/mongo/db/catalog/health_log.h b/src/mongo/db/catalog/health_log.h
index ba2bcbf440a..f9fe3c5b4c3 100644
--- a/src/mongo/db/catalog/health_log.h
+++ b/src/mongo/db/catalog/health_log.h
@@ -29,21 +29,14 @@
#pragma once
+#include "mongo/db/catalog/health_log_interface.h"
#include "mongo/db/concurrency/deferred_writer.h"
-#include "mongo/db/service_context.h"
namespace mongo {
class HealthLogEntry;
-/**
- * The interface to the local healthlog.
- *
- * This class contains facilities for creating and asynchronously writing to the local healthlog
- * collection. There should only be one instance of this class, initialized on startup and cleaned
- * up on shutdown.
- */
-class HealthLog {
+class HealthLog : public HealthLogInterface {
HealthLog(const HealthLog&) = delete;
HealthLog& operator=(const HealthLog&) = delete;
@@ -55,38 +48,11 @@ public:
*/
HealthLog();
- /**
- * The maximum size of the in-memory buffer of health-log entries, in bytes.
- */
- static const int64_t kMaxBufferSize = 25'000'000;
-
- /**
- * Start the worker thread writing the buffer to the collection.
- */
- void startup(void);
+ void startup() override;
- /**
- * Stop the worker thread.
- */
- void shutdown(void);
+ void shutdown() override;
- /**
- * The name of the collection.
- */
- static const NamespaceString nss;
-
- /**
- * Get the current context's HealthLog.
- */
- static HealthLog& get(ServiceContext* ctx);
- static HealthLog& get(OperationContext* ctx);
-
- /**
- * Asynchronously insert the given entry.
- *
- * Return `false` iff there is no more space in the buffer.
- */
- bool log(const HealthLogEntry& entry);
+ bool log(const HealthLogEntry& entry) override;
private:
DeferredWriter _writer;
diff --git a/src/mongo/db/catalog/health_log_interface.cpp b/src/mongo/db/catalog/health_log_interface.cpp
new file mode 100644
index 00000000000..69e8f03020f
--- /dev/null
+++ b/src/mongo/db/catalog/health_log_interface.cpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (C) 2023-present MongoDB, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the Server Side Public License, version 1,
+ * as published by MongoDB, Inc.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Server Side Public License for more details.
+ *
+ * You should have received a copy of the Server Side Public License
+ * along with this program. If not, see
+ * <http://www.mongodb.com/licensing/server-side-public-license>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the Server Side Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/db/catalog/health_log_interface.h"
+#include "mongo/db/operation_context.h"
+
+namespace mongo {
+
+namespace {
+const auto getHealthLog = ServiceContext::declareDecoration<std::unique_ptr<HealthLogInterface>>();
+} // namespace
+
+void HealthLogInterface::set(ServiceContext* serviceContext,
+ std::unique_ptr<HealthLogInterface> newHealthLog) {
+ auto& healthLog = getHealthLog(serviceContext);
+ invariant(!healthLog);
+
+ healthLog = std::move(newHealthLog);
+}
+
+HealthLogInterface* HealthLogInterface::get(ServiceContext* svcCtx) {
+ return getHealthLog(svcCtx).get();
+}
+
+HealthLogInterface* HealthLogInterface::get(OperationContext* opCtx) {
+ return getHealthLog(opCtx->getServiceContext()).get();
+}
+} // namespace mongo
diff --git a/src/mongo/db/catalog/health_log_interface.h b/src/mongo/db/catalog/health_log_interface.h
new file mode 100644
index 00000000000..885015fb6be
--- /dev/null
+++ b/src/mongo/db/catalog/health_log_interface.h
@@ -0,0 +1,92 @@
+/**
+ * Copyright (C) 2023-present MongoDB, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the Server Side Public License, version 1,
+ * as published by MongoDB, Inc.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Server Side Public License for more details.
+ *
+ * You should have received a copy of the Server Side Public License
+ * along with this program. If not, see
+ * <http://www.mongodb.com/licensing/server-side-public-license>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the Server Side Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+#include "mongo/db/catalog/health_log_gen.h"
+#include "mongo/db/service_context.h"
+
+namespace mongo {
+
+/**
+ * The interface to the local healthlog.
+ *
+ * This class contains facilities for creating and asynchronously writing to the local healthlog
+ * collection. There should only be one instance of this class, initialized on startup and cleaned
+ * up on shutdown.
+ */
+class HealthLogInterface {
+ HealthLogInterface(const HealthLogInterface&) = delete;
+ HealthLogInterface& operator=(const HealthLogInterface&) = delete;
+
+public:
+ /**
+ * The maximum size of the in-memory buffer of health-log entries, in bytes.
+ */
+ static const int64_t kMaxBufferSize = 25'000'000;
+
+ /**
+ * Stores a health log on the specified service context. May only be called once for the
+ * lifetime of the service context.
+ */
+ static void set(ServiceContext* serviceContext,
+ std::unique_ptr<HealthLogInterface> newHealthLog);
+
+ /**
+ * Get the current context's HealthLog. set() above must be called before any get() calls.
+ */
+ static HealthLogInterface* get(ServiceContext* ctx);
+ static HealthLogInterface* get(OperationContext* ctx);
+
+ /**
+ * Required to use HealthLogInterface as a ServiceContext decorator.
+ *
+ * Should not be used anywhere else.
+ */
+ HealthLogInterface() = default;
+ virtual ~HealthLogInterface() = default;
+
+ /**
+ * Start the worker thread writing the buffer to the collection.
+ */
+ virtual void startup() = 0;
+
+ /**
+ * Stop the worker thread.
+ */
+ virtual void shutdown() = 0;
+
+ /**
+ * Asynchronously insert the given entry.
+ *
+ * Return `false` iff there is no more space in the buffer.
+ */
+ virtual bool log(const HealthLogEntry& entry) = 0;
+};
+} // namespace mongo
diff --git a/src/mongo/db/commands/dbcheck.cpp b/src/mongo/db/commands/dbcheck.cpp
index 965c9eeae7c..9a61fcf3c51 100644
--- a/src/mongo/db/commands/dbcheck.cpp
+++ b/src/mongo/db/commands/dbcheck.cpp
@@ -35,7 +35,7 @@
#include "mongo/db/catalog/collection_catalog.h"
#include "mongo/db/catalog/collection_catalog_helper.h"
#include "mongo/db/catalog/database.h"
-#include "mongo/db/catalog/health_log.h"
+#include "mongo/db/catalog/health_log_interface.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/exception_util.h"
@@ -94,7 +94,7 @@ public:
OplogEntriesEnum::Start,
boost::none /*data*/
);
- HealthLog::get(_opCtx->getServiceContext()).log(*healthLogEntry);
+ HealthLogInterface::get(_opCtx->getServiceContext())->log(*healthLogEntry);
DbCheckOplogStartStop oplogEntry;
const auto nss = NamespaceString("admin.$cmd");
@@ -120,7 +120,7 @@ public:
OplogEntriesEnum::Stop,
boost::none /*data*/
);
- HealthLog::get(_opCtx->getServiceContext()).log(*healthLogEntry);
+ HealthLogInterface::get(_opCtx->getServiceContext())->log(*healthLogEntry);
} catch (const DBException&) {
LOGV2(6202201, "Could not log stop event");
}
@@ -300,7 +300,7 @@ protected:
} catch (const DBException& e) {
auto logEntry = dbCheckErrorHealthLogEntry(
coll.nss, "dbCheck failed", OplogEntriesEnum::Batch, e.toStatus());
- HealthLog::get(Client::getCurrent()->getServiceContext()).log(*logEntry);
+ HealthLogInterface::get(Client::getCurrent()->getServiceContext())->log(*logEntry);
return;
}
@@ -333,7 +333,7 @@ private:
"abandoning dbCheck batch because collection no longer exists",
OplogEntriesEnum::Batch,
Status(ErrorCodes::NamespaceNotFound, "collection not found"));
- HealthLog::get(Client::getCurrent()->getServiceContext()).log(*entry);
+ HealthLogInterface::get(Client::getCurrent()->getServiceContext())->log(*entry);
return;
}
}
@@ -411,7 +411,7 @@ private:
OplogEntriesEnum::Batch,
result.getStatus());
}
- HealthLog::get(opCtx).log(*entry);
+ HealthLogInterface::get(opCtx)->log(*entry);
if (retryable) {
continue;
}
@@ -434,7 +434,7 @@ private:
(_batchesProcessed % gDbCheckHealthLogEveryNBatches.load() == 0)) {
// On debug builds, health-log every batch result; on release builds, health-log
// every N batches.
- HealthLog::get(opCtx).log(*entry);
+ HealthLogInterface::get(opCtx)->log(*entry);
}
WriteConcernResult unused;
@@ -444,7 +444,7 @@ private:
"dbCheck failed waiting for writeConcern",
OplogEntriesEnum::Batch,
status);
- HealthLog::get(opCtx).log(*entry);
+ HealthLogInterface::get(opCtx)->log(*entry);
}
start = stats.lastKey;
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index 3cb467f8a7b..dff574670bb 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -598,7 +598,8 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
}
// Start up health log writer thread.
- HealthLog::get(startupOpCtx.get()).startup();
+ HealthLogInterface::set(serviceContext, std::make_unique<HealthLog>());
+ HealthLogInterface::get(startupOpCtx.get())->startup();
auto const globalAuthzManager = AuthorizationManager::get(serviceContext);
uassertStatusOK(globalAuthzManager->initialize(startupOpCtx.get()));
@@ -1513,8 +1514,10 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
LOGV2(4784925, "Shutting down free monitoring");
stopFreeMonitoring();
- LOGV2(4784927, "Shutting down the HealthLog");
- HealthLog::get(serviceContext).shutdown();
+ if (auto* healthLog = HealthLogInterface::get(serviceContext)) {
+ LOGV2(4784927, "Shutting down the HealthLog");
+ healthLog->shutdown();
+ }
LOGV2(4784928, "Shutting down the TTL monitor");
shutdownTTLMonitor(serviceContext);
diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp
index f0b7248173b..b6c5b1c3d2b 100644
--- a/src/mongo/db/namespace_string.cpp
+++ b/src/mongo/db/namespace_string.cpp
@@ -202,6 +202,9 @@ const NamespaceString NamespaceString::kConfigSampledQueriesNamespace(NamespaceS
const NamespaceString NamespaceString::kConfigSampledQueriesDiffNamespace(
NamespaceString::kConfigDb, "sampledQueriesDiff");
+const NamespaceString NamespaceString::kLocalHealthLogNamespace(NamespaceString::kLocalDb,
+ "system.healthlog");
+
NamespaceString NamespaceString::parseFromStringExpectTenantIdInMultitenancyMode(StringData ns) {
if (!gMultitenancySupport) {
return NamespaceString(boost::none, ns);
@@ -262,7 +265,7 @@ bool NamespaceString::isLegalClientSystemNS(
} else if (dbname == kLocalDb) {
if (coll() == kSystemReplSetNamespace.coll())
return true;
- if (coll() == "system.healthlog")
+ if (coll() == kLocalHealthLogNamespace.coll())
return true;
if (coll() == kConfigsvrRestoreNamespace.coll())
return true;
diff --git a/src/mongo/db/namespace_string.h b/src/mongo/db/namespace_string.h
index 86ee2914968..619a4e6a592 100644
--- a/src/mongo/db/namespace_string.h
+++ b/src/mongo/db/namespace_string.h
@@ -284,6 +284,9 @@ public:
// Namespace used for storing the diffs for sampled update queries.
static const NamespaceString kConfigSampledQueriesDiffNamespace;
+ // Namespace used for the health log.
+ static const NamespaceString kLocalHealthLogNamespace;
+
/**
* Constructs an empty NamespaceString.
*/
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index 5c61fe77581..d17bc24744e 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -213,7 +213,7 @@ env.Library(
'dbcheck.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/catalog/health_log',
+ '$BUILD_DIR/mongo/db/catalog/health_log_interface',
'$BUILD_DIR/mongo/db/shard_role',
'$BUILD_DIR/mongo/idl/idl_parser',
],
diff --git a/src/mongo/db/repl/dbcheck.cpp b/src/mongo/db/repl/dbcheck.cpp
index 0b0be849a5d..9e260fb4ad3 100644
--- a/src/mongo/db/repl/dbcheck.cpp
+++ b/src/mongo/db/repl/dbcheck.cpp
@@ -33,7 +33,7 @@
#include "mongo/db/catalog/collection_catalog.h"
#include "mongo/db/catalog/database.h"
#include "mongo/db/catalog/database_holder.h"
-#include "mongo/db/catalog/health_log.h"
+#include "mongo/db/catalog/health_log_interface.h"
#include "mongo/db/catalog/index_catalog.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/operation_context.h"
@@ -376,7 +376,7 @@ Status dbCheckBatchOnSecondary(OperationContext* opCtx,
"no readTimestamp in oplog entry. Ensure dbCheck "
"command is not using snapshotRead:false"},
entry.toBSON());
- HealthLog::get(opCtx).log(*logEntry);
+ HealthLogInterface::get(opCtx)->log(*logEntry);
return Status::OK();
}
@@ -393,7 +393,7 @@ Status dbCheckBatchOnSecondary(OperationContext* opCtx,
"dbCheck failed",
OplogEntriesEnum::Batch,
BSON("success" << false << "info" << msg));
- HealthLog::get(opCtx).log(*logEntry);
+ HealthLogInterface::get(opCtx)->log(*logEntry);
return Status::OK();
}
@@ -419,13 +419,13 @@ Status dbCheckBatchOnSecondary(OperationContext* opCtx,
(batchesProcessed % gDbCheckHealthLogEveryNBatches.load() == 0)) {
// On debug builds, health-log every batch result; on release builds, health-log
// every N batches.
- HealthLog::get(opCtx).log(*logEntry);
+ HealthLogInterface::get(opCtx)->log(*logEntry);
}
} catch (const DBException& exception) {
// In case of an error, report it to the health log,
auto logEntry = dbCheckErrorHealthLogEntry(
entry.getNss(), msg, OplogEntriesEnum::Batch, exception.toStatus(), entry.toBSON());
- HealthLog::get(opCtx).log(*logEntry);
+ HealthLogInterface::get(opCtx)->log(*logEntry);
return Status::OK();
}
return Status::OK();
@@ -463,7 +463,8 @@ Status dbCheckOplogCommand(OperationContext* opCtx,
const auto healthLogEntry = mongo::dbCheckHealthLogEntry(
boost::none /*nss*/, SeverityEnum::Info, "", type, boost::none /*data*/
);
- HealthLog::get(Client::getCurrent()->getServiceContext()).log(*healthLogEntry);
+ HealthLogInterface::get(Client::getCurrent()->getServiceContext())
+ ->log(*healthLogEntry);
return Status::OK();
}
diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript
index ae4b474cd43..c7406576127 100644
--- a/src/mongo/db/storage/wiredtiger/SConscript
+++ b/src/mongo/db/storage/wiredtiger/SConscript
@@ -77,7 +77,7 @@ wtEnv.Library(
'storage_wiredtiger_customization_hooks',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/catalog/health_log',
+ '$BUILD_DIR/mongo/db/catalog/health_log_interface',
'$BUILD_DIR/mongo/db/commands/server_status_core',
'$BUILD_DIR/mongo/db/concurrency/exception_util',
'$BUILD_DIR/mongo/db/mongod_options',
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index af7279d849e..3636a136b8f 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -42,8 +42,8 @@
#include "mongo/base/checked_cast.h"
#include "mongo/base/static_assert.h"
#include "mongo/bson/util/builder.h"
-#include "mongo/db/catalog/health_log.h"
#include "mongo/db/catalog/health_log_gen.h"
+#include "mongo/db/catalog/health_log_interface.h"
#include "mongo/db/catalog/validate_results.h"
#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/concurrency/locker.h"
@@ -2242,7 +2242,7 @@ boost::optional<Record> WiredTigerRecordStoreCursorBase::next() {
bob.appendElements(getStackTrace().getBSONRepresentation());
entry.setData(bob.obj());
- HealthLog::get(_opCtx).log(entry);
+ HealthLogInterface::get(_opCtx)->log(entry);
// Crash when testing diagnostics are enabled.
invariant(!TestingProctor::instance().isEnabled(), "cursor returned out-of-order keys");
diff --git a/src/mongo/embedded/embedded.cpp b/src/mongo/embedded/embedded.cpp
index 51bc6cd2392..28243994813 100644
--- a/src/mongo/embedded/embedded.cpp
+++ b/src/mongo/embedded/embedded.cpp
@@ -38,7 +38,6 @@
#include "mongo/db/catalog/collection_catalog.h"
#include "mongo/db/catalog/collection_impl.h"
#include "mongo/db/catalog/database_holder_impl.h"
-#include "mongo/db/catalog/health_log.h"
#include "mongo/db/catalog/index_key_validate.h"
#include "mongo/db/client.h"
#include "mongo/db/commands/feature_compatibility_version.h"