summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_applier_impl.cpp
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@mongodb.com>2020-06-05 11:09:50 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-28 18:37:55 +0000
commit17457592a2a1b64ed4ac90c93b32aa47598d5c90 (patch)
treebe681db9c1f0c6d5280e43dbf5eea3e9e569721e /src/mongo/db/repl/oplog_applier_impl.cpp
parent24890bbac9ee27cf3fb9a1b6bb8123ab120a1594 (diff)
downloadmongo-17457592a2a1b64ed4ac90c93b32aa47598d5c90.tar.gz
SERVER-48149 Move callers of RecoveryUnit::waitUntilDurable onto JournalFlusher::waitForJournalFlush
Operations running concurrently with stepdown must call JournalFlusher::waitForJournalFlush so that writes to the oplogTruncateAfterPoint are interrupted correctly during stepdown and callers waiting for durability don't receive unexpected InterruptedDueToReplStateChange errors.
Diffstat (limited to 'src/mongo/db/repl/oplog_applier_impl.cpp')
-rw-r--r--src/mongo/db/repl/oplog_applier_impl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/repl/oplog_applier_impl.cpp b/src/mongo/db/repl/oplog_applier_impl.cpp
index 9b3b3d0aa61..24ff5ad96d6 100644
--- a/src/mongo/db/repl/oplog_applier_impl.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl.cpp
@@ -47,7 +47,7 @@
#include "mongo/db/repl/transaction_oplog_application.h"
#include "mongo/db/stats/counters.h"
#include "mongo/db/stats/timer_stats.h"
-#include "mongo/db/storage/control/storage_control.h"
+#include "mongo/db/storage/control/journal_flusher.h"
#include "mongo/logv2/log.h"
#include "mongo/platform/basic.h"
#include "mongo/util/fail_point.h"
@@ -227,7 +227,7 @@ void ApplyBatchFinalizerForJournal::_run() {
}
auto opCtx = cc().makeOperationContext();
- opCtx->recoveryUnit()->waitUntilDurable(opCtx.get());
+ JournalFlusher::get(opCtx.get())->waitForJournalFlush();
_recordDurable(latestOpTimeAndWallTime);
}
}
@@ -561,7 +561,7 @@ StatusWith<OpTime> OplogApplierImpl::_applyOplogBatch(OperationContext* opCtx,
// new writes with timestamps associated with those oplog entries will show up in the future. We
// want to flush the journal as soon as possible in order to free ops waiting with 'j' write
// concern.
- StorageControl::triggerJournalFlush(opCtx->getServiceContext());
+ JournalFlusher::get(opCtx)->triggerJournalFlush();
// Use this fail point to hold the PBWM lock and prevent the batch from completing.
if (MONGO_unlikely(pauseBatchApplicationBeforeCompletion.shouldFail())) {