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.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 9555db6f95b..93cd829c620 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -359,7 +359,7 @@ void BackgroundSync::_produce() {
log() << "See http://dochub.mongodb.org/core/resyncingaverystalereplicasetmember";
// Activate maintenance mode and transition to RECOVERING.
- auto status = _replCoord->setMaintenanceMode(true);
+ auto status = _replCoord->setMaintenanceMode(opCtx.get(), true);
if (!status.isOK()) {
warning() << "Failed to transition into maintenance mode: " << status;
// Do not mark ourselves too stale on errors so we can try again next time.
@@ -413,11 +413,13 @@ void BackgroundSync::_produce() {
// transition to SECONDARY.
if (_tooStale) {
+
_tooStale = false;
log() << "No longer too stale. Able to sync from " << source;
- auto status = _replCoord->setMaintenanceMode(false);
+ auto opCtx = cc().makeOperationContext();
+ auto status = _replCoord->setMaintenanceMode(opCtx.get(), false);
if (!status.isOK()) {
warning() << "Failed to leave maintenance mode: " << status;
}