summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/storage_interface_impl.cpp
diff options
context:
space:
mode:
authorGabe Villasana <villagab4@gmail.com>2019-06-13 10:33:20 -0400
committerGabe Villasana <villagab4@gmail.com>2019-07-11 11:32:13 -0400
commitd9b6940984db00c428441139a33f19b207e35f30 (patch)
treeffe233d034018c0decc4b40561e4ffefb8594767 /src/mongo/db/repl/storage_interface_impl.cpp
parent33fc66e686b4a48dc9527930c948f137d7628c14 (diff)
downloadmongo-d9b6940984db00c428441139a33f19b207e35f30.tar.gz
SERVER-40168 Pull the OplogTruncaterThread out of WiredTigerKVEngine and put it above the storage layer
Diffstat (limited to 'src/mongo/db/repl/storage_interface_impl.cpp')
-rw-r--r--src/mongo/db/repl/storage_interface_impl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp
index f1e80568f7a..7cfa35ba7af 100644
--- a/src/mongo/db/repl/storage_interface_impl.cpp
+++ b/src/mongo/db/repl/storage_interface_impl.cpp
@@ -75,7 +75,9 @@
#include "mongo/db/repl/rollback_gen.h"
#include "mongo/db/service_context.h"
#include "mongo/db/storage/durable_catalog.h"
+#include "mongo/db/storage/oplog_cap_maintainer_thread.h"
#include "mongo/util/assert_util.h"
+#include "mongo/util/background.h"
#include "mongo/util/log.h"
#include "mongo/util/str.h"
@@ -1091,6 +1093,18 @@ bool StorageInterfaceImpl::supportsRecoveryTimestamp(ServiceContext* serviceCtx)
return serviceCtx->getStorageEngine()->supportsRecoveryTimestamp();
}
+void StorageInterfaceImpl::initializeStorageControlsForReplication(
+ ServiceContext* serviceCtx) const {
+ // The storage engine may support the use of OplogStones to more finely control
+ // oplog history deletion, in which case we need to start the thread to
+ // periodically execute deletion via oplog stones. OplogStones are a replacement
+ // for capped collection deletion of the oplog collection history.
+ if (serviceCtx->getStorageEngine()->supportsOplogStones()) {
+ BackgroundJob* backgroundThread = new OplogCapMaintainerThread();
+ backgroundThread->go();
+ }
+}
+
boost::optional<Timestamp> StorageInterfaceImpl::getRecoveryTimestamp(
ServiceContext* serviceCtx) const {
return serviceCtx->getStorageEngine()->getRecoveryTimestamp();