summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/bgsync.cpp
diff options
context:
space:
mode:
authorMedha Potluri <medha.potluri@mongodb.com>2019-07-25 13:21:56 -0400
committerMedha Potluri <medha.potluri@mongodb.com>2019-08-13 08:37:45 -0400
commit796214e8426b3036f4eb4bdcc4af9d218589778f (patch)
treef874a9d5202c110104134f52d4d389f735f0a2d6 /src/mongo/db/repl/bgsync.cpp
parenteaf81228328738b685532c7eb10f833362434061 (diff)
downloadmongo-796214e8426b3036f4eb4bdcc4af9d218589778f.tar.gz
SERVER-41502 Track the number of times primary catchup concludes for each reason in serverStatus
Diffstat (limited to 'src/mongo/db/repl/bgsync.cpp')
-rw-r--r--src/mongo/db/repl/bgsync.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 4e1224c08e6..990e7167aeb 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -305,7 +305,11 @@ void BackgroundSync::_produce() {
log() << "Our newest OpTime : " << lastOpTimeFetched;
log() << "Earliest OpTime available is " << syncSourceResp.earliestOpTimeSeen
<< " from " << syncSourceResp.getSyncSource();
- _replCoord->abortCatchupIfNeeded().transitional_ignore();
+ auto status = _replCoord->abortCatchupIfNeeded(
+ ReplicationCoordinator::PrimaryCatchUpConclusionReason::kFailedWithError);
+ if (!status.isOK()) {
+ LOG(1) << "Aborting catch-up failed with status: " << status;
+ }
return;
}
@@ -532,7 +536,11 @@ void BackgroundSync::_runRollback(OperationContext* opCtx,
StorageInterface* storageInterface) {
if (_replCoord->getMemberState().primary()) {
warning() << "Rollback situation detected in catch-up mode. Aborting catch-up mode.";
- _replCoord->abortCatchupIfNeeded().transitional_ignore();
+ auto status = _replCoord->abortCatchupIfNeeded(
+ ReplicationCoordinator::PrimaryCatchUpConclusionReason::kFailedWithError);
+ if (!status.isOK()) {
+ LOG(1) << "Aborting catch-up failed with status: " << status;
+ }
return;
}