diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2015-10-01 09:46:10 -0400 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2015-10-01 09:46:50 -0400 |
commit | 3937e8a5a855aebc4c8e16206fd69c863f567e15 (patch) | |
tree | 9925974190374a081e4559c617a2ee0d56e046fe /src | |
parent | 3f273cfeaeb8aa29efa9aaab4c7e1d4cc93ac917 (diff) | |
download | mongo-3937e8a5a855aebc4c8e16206fd69c863f567e15.tar.gz |
SERVER-18983: Apply oplog and record in oplog concurrently
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 5ceb240989d..182c9a47994 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -333,7 +333,6 @@ void applyOps(const std::vector<std::vector<BSONObj>>& writerVectors, writerPool->schedule(func, stdx::cref(*it), sync); } } - writerPool->join(); } void fillWriterVectors(const std::deque<BSONObj>& ops, @@ -401,11 +400,12 @@ OpTime SyncTail::multiApply(OperationContext* txn, const OpQueue& ops) { applyOps(writerVectors, &_writerPool, _applyFunc, this); + OpTime lastOpTime = writeOpsToOplog(txn, ops.getDeque()); if (inShutdown()) { return OpTime(); } - - OpTime lastOpTime = writeOpsToOplog(txn, ops.getDeque()); + _writerPool.join(); + // We have now written all database writes and updated the oplog to match. ReplClientInfo::forClient(txn->getClient()).setLastOp(lastOpTime); replCoord->setMyLastOptime(lastOpTime); |