diff options
author | Benety Goh <benety@mongodb.com> | 2018-06-13 11:43:36 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-06-13 11:43:36 -0400 |
commit | 9a7b88779fd519bd955daa106d5d19244fe4072d (patch) | |
tree | f11ddbecadb171a62a2b517fc4b444c20120d4f9 /src/mongo | |
parent | e0663788e47453452ef2adf4438ba5e4b734864d (diff) | |
download | mongo-9a7b88779fd519bd955daa106d5d19244fe4072d.tar.gz |
SERVER-33864 BackgroundSync no longer implements OplogApplier::Observer
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/repl/bgsync.h | 7 | ||||
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 9 |
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, |