summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2018-06-13 11:43:36 -0400
committerBenety Goh <benety@mongodb.com>2018-06-13 11:43:36 -0400
commit9a7b88779fd519bd955daa106d5d19244fe4072d (patch)
treef11ddbecadb171a62a2b517fc4b444c20120d4f9 /src/mongo
parente0663788e47453452ef2adf4438ba5e4b734864d (diff)
downloadmongo-9a7b88779fd519bd955daa106d5d19244fe4072d.tar.gz
SERVER-33864 BackgroundSync no longer implements OplogApplier::Observer
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/repl/bgsync.h7
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.cpp9
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mongo/db/repl/bgsync.h b/src/mongo/db/repl/bgsync.h
index 9340a9483ac..7492ef80b27 100644
--- a/src/mongo/db/repl/bgsync.h
+++ b/src/mongo/db/repl/bgsync.h
@@ -60,7 +60,7 @@ class ReplicationCoordinatorExternalState;
class ReplicationProcess;
class StorageInterface;
-class BackgroundSync : public OplogApplier::Observer {
+class BackgroundSync {
MONGO_DISALLOW_COPYING(BackgroundSync);
public:
@@ -138,11 +138,6 @@ public:
// Starts the producer if it's stopped. Otherwise, let it keep running.
void startProducerIfStopped();
- // OplogApplier::Observer functions
- void onBatchBegin(const OplogApplier::Operations&) final {}
- void onBatchEnd(const StatusWith<OpTime>&, const OplogApplier::Operations&) final {}
- void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>&) final {}
-
private:
bool _inShutdown_inlock() const;
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
index 33aa721b036..8b6abf7f02d 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
@@ -143,6 +143,13 @@ ServerStatusMetricField<Counter64> displayBufferSize("repl.buffer.sizeBytes", &b
ServerStatusMetricField<Counter64> displayBufferMaxSize("repl.buffer.maxSizeBytes",
&bufferGauge.maxSize);
+class NoopOplogApplierObserver : public repl::OplogApplier::Observer {
+public:
+ void onBatchBegin(const repl::OplogApplier::Operations&) final {}
+ void onBatchEnd(const StatusWith<repl::OpTime>&, const repl::OplogApplier::Operations&) final {}
+ void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>&) final {}
+} noopOplogApplierObserver;
+
/**
* Returns new thread pool for thread pool task executor.
*/
@@ -233,7 +240,7 @@ void ReplicationCoordinatorExternalStateImpl::startSteadyStateReplication(
_oplogApplier =
stdx::make_unique<OplogApplierImpl>(_oplogApplierTaskExecutor.get(),
_oplogBuffer.get(),
- _bgSync.get(),
+ &noopOplogApplierObserver,
replCoord,
_replicationProcess->getConsistencyMarkers(),
_storageInterface,