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.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index df792fa6fdc..9d129284de0 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -313,13 +313,12 @@ void BackgroundSync::_produce(OperationContext* opCtx) {
if (syncSourceResp.syncSourceStatus == ErrorCodes::OplogStartMissing) {
// All (accessible) sync sources were too stale.
- // TODO: End catchup mode early if we are too stale.
if (_replCoord->getMemberState().primary()) {
warning() << "Too stale to catch up.";
log() << "Our newest OpTime : " << lastOpTimeFetched;
log() << "Earliest OpTime available is " << syncSourceResp.earliestOpTimeSeen
<< " from " << syncSourceResp.getSyncSource();
- sleepsecs(1);
+ _replCoord->abortCatchupIfNeeded();
return;
}
@@ -568,9 +567,8 @@ void BackgroundSync::_runRollback(OperationContext* opCtx,
int requiredRBID,
StorageInterface* storageInterface) {
if (_replCoord->getMemberState().primary()) {
- // TODO: Abort catchup mode early if rollback detected.
- warning() << "Rollback situation detected in catch-up mode; catch-up mode will end.";
- sleepsecs(1);
+ warning() << "Rollback situation detected in catch-up mode. Aborting catch-up mode.";
+ _replCoord->abortCatchupIfNeeded();
return;
}