From d753adf541a85c152fa0db90432accfce3d49676 Mon Sep 17 00:00:00 2001 From: Siyuan Zhou Date: Fri, 5 Oct 2018 21:59:19 -0400 Subject: SERVER-37505 Run applyOps with prepare: true in its own batch in MultiApplier. --- src/mongo/db/repl/oplog_applier.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/repl/oplog_applier.cpp') diff --git a/src/mongo/db/repl/oplog_applier.cpp b/src/mongo/db/repl/oplog_applier.cpp index e7c5160f902..3b86518fd7c 100644 --- a/src/mongo/db/repl/oplog_applier.cpp +++ b/src/mongo/db/repl/oplog_applier.cpp @@ -179,7 +179,8 @@ StatusWith OplogApplier::getNextApplierBatch( // Commands must be processed one at a time. The only exception to this is applyOps because // applyOps oplog entries are effectively containers for CRUD operations. Therefore, it is // safe to batch applyOps commands with CRUD operations when reading from the oplog buffer. - if (entry.isCommand() && entry.getCommandType() != OplogEntry::CommandType::kApplyOps) { + if (entry.isCommand() && (entry.getCommandType() != OplogEntry::CommandType::kApplyOps || + entry.shouldPrepare())) { if (ops.empty()) { // Apply commands one-at-a-time. ops.push_back(std::move(entry)); -- cgit v1.2.1