summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/control/journal_flusher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/control/journal_flusher.cpp')
-rw-r--r--src/mongo/db/storage/control/journal_flusher.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/mongo/db/storage/control/journal_flusher.cpp b/src/mongo/db/storage/control/journal_flusher.cpp
index 212f51cd88f..765d826cda8 100644
--- a/src/mongo/db/storage/control/journal_flusher.cpp
+++ b/src/mongo/db/storage/control/journal_flusher.cpp
@@ -87,13 +87,20 @@ void JournalFlusher::run() {
[&] { return _flushJournalNow || _needToPause || _shuttingDown; });
}
- // Initialize the thread's opCtx.
- _uniqueCtx.emplace(tc->makeOperationContext());
+ auto setUpOpCtx = [&] {
+ // Initialize the thread's opCtx.
+ _uniqueCtx.emplace(tc->makeOperationContext());
- // Updates to a non-replicated collection, oplogTruncateAfterPoint, are made by this thread.
- // Non-replicated writes will not contribute to replication lag and can be safely excluded
- // from Flow Control.
- _uniqueCtx->get()->setShouldParticipateInFlowControl(false);
+ // Updates to a non-replicated collection, oplogTruncateAfterPoint, are made by this thread.
+ // Non-replicated writes will not contribute to replication lag and can be safely excluded
+ // from Flow Control.
+ _uniqueCtx->get()->setShouldParticipateInFlowControl(false);
+
+ // The journal flusher should not conflict with the setFCV command.
+ _uniqueCtx->get()->lockState()->setShouldConflictWithSetFeatureCompatibilityVersion(false);
+ };
+
+ setUpOpCtx();
while (true) {
pauseJournalFlusherBeforeFlush.pauseWhileSet();
try {
@@ -107,8 +114,7 @@ void JournalFlusher::run() {
// the time during or before the next flush.
stdx::lock_guard<Latch> lk(_opCtxMutex);
_uniqueCtx.reset();
- _uniqueCtx.emplace(tc->makeOperationContext());
- _uniqueCtx->get()->setShouldParticipateInFlowControl(false);
+ setUpOpCtx();
});
_uniqueCtx->get()->recoveryUnit()->waitUntilDurable(_uniqueCtx->get());