summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2015-10-01 09:46:10 -0400
committerScott Hernandez <scotthernandez@gmail.com>2015-10-12 12:26:17 -0400
commitcc1f48bce42728f3af21e8c6d3a9766f3675ac8a (patch)
tree67b286e94b2d6057883cddd8a0ce03f021faa340 /src
parentf3f46acbb54a505d91505bd5908fe8424ecc5bcd (diff)
downloadmongo-cc1f48bce42728f3af21e8c6d3a9766f3675ac8a.tar.gz
SERVER-18983: Apply oplog and record in oplog concurrently
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl/sync_tail.cpp6
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 548a3928432..fe3d0cfda7d 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -314,7 +314,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,
@@ -382,11 +381,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);