diff options
Diffstat (limited to 'src/mongo/db/repl/bgsync.cpp')
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 6867269f138..f7de957f48d 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -373,7 +373,7 @@ void BackgroundSync::_produce() { "earliestOpTimeSeen"_attr = syncSourceResp.earliestOpTimeSeen); // Activate maintenance mode and transition to RECOVERING. - auto status = _replCoord->setMaintenanceMode(true); + auto status = _replCoord->setMaintenanceMode(opCtx.get(), true); if (!status.isOK()) { LOGV2_WARNING(21116, "Failed to transition into maintenance mode: {error}", @@ -461,7 +461,9 @@ void BackgroundSync::_produce() { "No longer too stale. Able to sync from {syncSource}", "No longer too stale. Able to start syncing", "syncSource"_attr = source); - auto status = _replCoord->setMaintenanceMode(false); + + auto opCtx = cc().makeOperationContext(); + auto status = _replCoord->setMaintenanceMode(opCtx.get(), false); if (!status.isOK()) { LOGV2_WARNING(21118, "Failed to leave maintenance mode: {error}", |