summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoustafa Maher Khalil <m.maher@mongodb.com>2021-11-01 16:55:39 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-02 19:02:24 +0000
commit5218ed8e510bdc1a6bfc14084f81bcc236b90964 (patch)
tree5e2fd23a7c3dda27f305db09513a0e2435b48489
parente93b52d81b9cecb85544d07d3777d0448632a2af (diff)
downloadmongo-5218ed8e510bdc1a6bfc14084f81bcc236b90964.tar.gz
SERVER-61048 Make BackupCursorService use current engine instead of storing a stale one
-rw-r--r--src/mongo/db/mongod_main.cpp2
-rw-r--r--src/mongo/db/storage/backup_cursor_hooks.cpp6
-rw-r--r--src/mongo/db/storage/backup_cursor_hooks.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index 36f6842d691..d8944c895f2 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -517,7 +517,7 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
invariant(storageEngine);
storageEngine->notifyStartupComplete();
- BackupCursorHooks::initialize(serviceContext, storageEngine);
+ BackupCursorHooks::initialize(serviceContext);
startMongoDFTDC();
diff --git a/src/mongo/db/storage/backup_cursor_hooks.cpp b/src/mongo/db/storage/backup_cursor_hooks.cpp
index 68fdfd5c3e5..d656d26509a 100644
--- a/src/mongo/db/storage/backup_cursor_hooks.cpp
+++ b/src/mongo/db/storage/backup_cursor_hooks.cpp
@@ -38,7 +38,7 @@
namespace mongo {
namespace {
-BackupCursorHooks::InitializerFunction initializer = [](StorageEngine* storageEngine) {
+BackupCursorHooks::InitializerFunction initializer = []() {
return std::make_unique<BackupCursorHooks>();
};
@@ -53,8 +53,8 @@ void BackupCursorHooks::registerInitializer(InitializerFunction func) {
initializer = func;
}
-void BackupCursorHooks::initialize(ServiceContext* service, StorageEngine* storageEngine) {
- getBackupCursorHooks(service).ptr = initializer(storageEngine);
+void BackupCursorHooks::initialize(ServiceContext* service) {
+ getBackupCursorHooks(service).ptr = initializer();
}
BackupCursorHooks* BackupCursorHooks::get(ServiceContext* service) {
diff --git a/src/mongo/db/storage/backup_cursor_hooks.h b/src/mongo/db/storage/backup_cursor_hooks.h
index e166181aa03..bb7f5b712aa 100644
--- a/src/mongo/db/storage/backup_cursor_hooks.h
+++ b/src/mongo/db/storage/backup_cursor_hooks.h
@@ -41,11 +41,11 @@ class StorageEngine;
class BackupCursorHooks {
public:
- using InitializerFunction = std::function<std::unique_ptr<BackupCursorHooks>(StorageEngine*)>;
+ using InitializerFunction = std::function<std::unique_ptr<BackupCursorHooks>()>;
static void registerInitializer(InitializerFunction func);
- static void initialize(ServiceContext* service, StorageEngine* storageEngine);
+ static void initialize(ServiceContext* service);
static BackupCursorHooks* get(ServiceContext* service);