diff options
Diffstat (limited to 'src/mongo/db/repl/bgsync.cpp')
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 41b58658162..25c39e8c640 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -635,14 +635,15 @@ void BackgroundSync::_fetcherCallback(const StatusWith<Fetcher::QueryResponse>& return; } - // We fill in 'bob' to signal the fetcher to process with another getMore. - invariant(bob); - bob->append("getMore", queryResponse.cursorId); - bob->append("collection", queryResponse.nss.coll()); - bob->append("maxTimeMS", durationCount<Milliseconds>(fetcherMaxTimeMS)); - if (receivedMetadata) { - bob->append("term", _replCoord->getTerm()); - _replCoord->getLastCommittedOpTime().append(bob, "lastKnownCommittedOpTime"); + // We fill in 'bob' to signal the fetcher to process with another getMore, if needed. + if (bob) { + bob->append("getMore", queryResponse.cursorId); + bob->append("collection", queryResponse.nss.coll()); + bob->append("maxTimeMS", durationCount<Milliseconds>(fetcherMaxTimeMS)); + if (receivedMetadata) { + bob->append("term", _replCoord->getTerm()); + _replCoord->getLastCommittedOpTime().append(bob, "lastKnownCommittedOpTime"); + } } } |