summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_applier_impl.cpp
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@mongodb.com>2019-11-05 20:42:59 +0000
committerevergreen <evergreen@mongodb.com>2019-11-05 20:42:59 +0000
commitb96794b6a5fb8805ebc226d2e6f26c78107fdee2 (patch)
tree4a63d0d1cbb61a6be5794e3fc565d8f781baaba2 /src/mongo/db/repl/oplog_applier_impl.cpp
parent05aec2872159cf583fe8655ca55f4bf70268efcf (diff)
downloadmongo-b96794b6a5fb8805ebc226d2e6f26c78107fdee2.tar.gz
SERVER-44180 repl batch applier thread should prompt WiredTigerJournalFlusher thread to flush the journal rather than the oplog visibility thread
Diffstat (limited to 'src/mongo/db/repl/oplog_applier_impl.cpp')
-rw-r--r--src/mongo/db/repl/oplog_applier_impl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/repl/oplog_applier_impl.cpp b/src/mongo/db/repl/oplog_applier_impl.cpp
index eec61306a67..e3ccb71056c 100644
--- a/src/mongo/db/repl/oplog_applier_impl.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl.cpp
@@ -672,11 +672,13 @@ StatusWith<OpTime> OplogApplierImpl::_applyOplogBatch(OperationContext* opCtx,
}
}
- // Notify the storage engine that a replication batch has completed. This means that all the
- // writes associated with the oplog entries in the batch are finished and no new writes with
- // timestamps associated with those oplog entries will show up in the future.
+ // Tell the storage engine to flush the journal now that a replication batch has completed. This
+ // means that all the writes associated with the oplog entries in the batch are finished and no
+ // 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.
const auto storageEngine = opCtx->getServiceContext()->getStorageEngine();
- storageEngine->replicationBatchIsComplete();
+ storageEngine->triggerJournalFlush();
// Use this fail point to hold the PBWM lock and prevent the batch from completing.
if (MONGO_unlikely(pauseBatchApplicationBeforeCompletion.shouldFail())) {