diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2015-11-20 07:30:17 -0500 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2015-11-20 10:44:38 -0500 |
commit | 8b4f6e5aa491c26b135607bb9d16e3a815491b62 (patch) | |
tree | 8d1e78cfc02c64ac6c271e6b340b715cea1c4c8a /src/mongo/db/repl/sync_tail.cpp | |
parent | 3a8aab65a494f6e5b31ea0358a517b103e1cbcb6 (diff) | |
download | mongo-8b4f6e5aa491c26b135607bb9d16e3a815491b62.tar.gz |
SERVER-21589 SERVER-21362 disable journal sync in PV0
This reverts commit 9e431f4fd9a6af65292aff3729a3f6d281784ac1.
Diffstat (limited to 'src/mongo/db/repl/sync_tail.cpp')
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index c3cac15635e..fa495eb46ac 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -183,6 +183,14 @@ ApplyBatchFinalizer::~ApplyBatchFinalizer() { } void ApplyBatchFinalizer::record(OpTime newOp) { + const bool mustWaitUntilDurable = _replCoord->isV1ElectionProtocol(); + if (!mustWaitUntilDurable) { + // We have to use setMyLastOptimeForward since this thread races with + // logTransitionToPrimaryToOplog. + _replCoord->setMyLastOptimeForward(newOp); + return; + } + stdx::unique_lock<stdx::mutex> lock(_mutex); _latestOpTime = newOp; _cond.notify_all(); |