summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/bgsync.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/bgsync.cpp')
-rw-r--r--src/mongo/db/repl/bgsync.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 118a9e02046..8f68fc0aad5 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -636,6 +636,11 @@ void BackgroundSync::cancelFetcher() {
void BackgroundSync::stop() {
stdx::lock_guard<stdx::mutex> lock(_mutex);
+ if (_replCoord->isWaitingForApplierToDrain()) {
+ // Signal to consumers that we have entered the paused state.
+ _buffer.pushEvenIfFull(BSONObj());
+ }
+
_pause = true;
_syncSourceHost = HostAndPort();
_lastOpTimeFetched = OpTime();