diff options
Diffstat (limited to 'src/mongo/db/repl/bgsync.cpp')
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index dc8ad23ed71..8217e38090a 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -114,7 +114,10 @@ public: const rpc::ReplSetMetadata& replMetadata, const rpc::OplogQueryMetadata& oqMetadata, const OpTime& previousOpTimeFetched, - const OpTime& lastOpTimeFetched) override; + const OpTime& lastOpTimeFetched) const final; + + ChangeSyncSourceAction shouldStopFetchingOnError(const HostAndPort& source, + const OpTime& lastOpTimeFetched) const final; private: BackgroundSync* _bgsync; @@ -132,7 +135,7 @@ ChangeSyncSourceAction DataReplicatorExternalStateBackgroundSync::shouldStopFetc const rpc::ReplSetMetadata& replMetadata, const rpc::OplogQueryMetadata& oqMetadata, const OpTime& previousOpTimeFetched, - const OpTime& lastOpTimeFetched) { + const OpTime& lastOpTimeFetched) const { if (_bgsync->shouldStopFetching()) { return ChangeSyncSourceAction::kStopSyncingAndEnqueueLastBatch; } @@ -141,6 +144,15 @@ ChangeSyncSourceAction DataReplicatorExternalStateBackgroundSync::shouldStopFetc source, replMetadata, oqMetadata, previousOpTimeFetched, lastOpTimeFetched); } +ChangeSyncSourceAction DataReplicatorExternalStateBackgroundSync::shouldStopFetchingOnError( + const HostAndPort& source, const OpTime& lastOpTimeFetched) const { + if (_bgsync->shouldStopFetching()) { + return ChangeSyncSourceAction::kStopSyncingAndDropLastBatchIfPresent; + } + + return DataReplicatorExternalStateImpl::shouldStopFetchingOnError(source, lastOpTimeFetched); +} + size_t getSize(const BSONObj& o) { // SERVER-9808 Avoid Fortify complaint about implicit signed->unsigned conversion return static_cast<size_t>(o.objsize()); |