diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2015-11-11 13:42:05 -0500 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2015-11-11 17:32:21 -0500 |
commit | bc533c51a35dec1fcc5519509c1294769a26145b (patch) | |
tree | c305a4a917c27c2651bdde02ee68ec2493e17854 | |
parent | 7007d04fdbb3ee27f86c18e06f9d9ba906bb7e7c (diff) | |
download | mongo-bc533c51a35dec1fcc5519509c1294769a26145b.tar.gz |
SERVER-21410: Removed dead appliedBuffer code
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 29 | ||||
-rw-r--r-- | src/mongo/db/repl/bgsync.h | 7 | ||||
-rw-r--r-- | src/mongo/db/repl/rs_initialsync.cpp | 4 |
3 files changed, 0 insertions, 40 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index b214e96b2ce..ba9f0d66ad4 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -161,7 +161,6 @@ BackgroundSync::BackgroundSync() std::numeric_limits<long long>::max()), _lastFetchedHash(0), _pause(true), - _appliedBuffer(true), _replCoord(getGlobalReplicationCoordinator()), _initialSyncRequestedFlag(false), _indexPrefetchConfig(PREFETCH_ALL) {} @@ -181,20 +180,6 @@ void BackgroundSync::shutdown() { invariant(inShutdown()); clearBuffer(); _pause = true; - - // Wake up producerThread so it notices that we're in shutdown - _appliedBufferCondition.notify_all(); - _pausedCondition.notify_all(); -} - -void BackgroundSync::notify(OperationContext* txn) { - stdx::lock_guard<stdx::mutex> lock(_mutex); - - // If all ops in the buffer have been applied, unblock waitForRepl (if it's waiting) - if (_buffer.empty()) { - _appliedBuffer = true; - _appliedBufferCondition.notify_all(); - } } void BackgroundSync::producerThread() { @@ -505,11 +490,6 @@ void BackgroundSync::_fetcherCallback(const StatusWith<Fetcher::QueryResponse>& sleepsecs(20); } - { - stdx::unique_lock<stdx::mutex> lock(_mutex); - _appliedBuffer = false; - } - OCCASIONALLY { LOG(2) << "bgsync buffer has " << _buffer.size() << " bytes"; } @@ -647,8 +627,6 @@ void BackgroundSync::stop() { _syncSourceHost = HostAndPort(); _lastOpTimeFetched = OpTime(); _lastFetchedHash = 0; - _appliedBufferCondition.notify_all(); - _pausedCondition.notify_all(); } void BackgroundSync::start(OperationContext* txn) { @@ -670,13 +648,6 @@ bool BackgroundSync::isPaused() const { return _pause; } -void BackgroundSync::waitUntilPaused() { - stdx::unique_lock<stdx::mutex> lock(_mutex); - while (!_pause) { - _pausedCondition.wait(lock); - } -} - void BackgroundSync::clearBuffer() { _buffer.clear(); const auto count = bufferCountGauge.get(); diff --git a/src/mongo/db/repl/bgsync.h b/src/mongo/db/repl/bgsync.h index 56bedc5d8cf..f723dfe1cb5 100644 --- a/src/mongo/db/repl/bgsync.h +++ b/src/mongo/db/repl/bgsync.h @@ -87,13 +87,9 @@ public: void shutdown(); - void notify(OperationContext* txn); bool isPaused() const; - // Blocks until _pause becomes true from a call to stop() or shutdown() - void waitUntilPaused(); - virtual ~BackgroundSync() {} // starts the producer thread @@ -158,9 +154,6 @@ private: // if produce thread should be running bool _pause; - stdx::condition_variable _pausedCondition; - bool _appliedBuffer; - stdx::condition_variable _appliedBufferCondition; HostAndPort _syncSourceHost; diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp index ac2ec2ac420..aeec194cebb 100644 --- a/src/mongo/db/repl/rs_initialsync.cpp +++ b/src/mongo/db/repl/rs_initialsync.cpp @@ -439,10 +439,6 @@ Status _initialSync() { // Clear the initial sync flag -- cannot be done under a db lock, or recursive. clearInitialSyncFlag(&txn); - // If we just cloned & there were no ops applied, we still want the primary to know where - // we're up to - bgsync->notify(&txn); - log() << "initial sync done"; return Status::OK(); } |