summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2017-11-29 10:57:35 -0500
committerRandolph Tan <randolph@10gen.com>2017-12-19 12:08:36 -0500
commitbfa801da7c4031fd6711fccc5b4916d310fa4ff0 (patch)
tree5ef76e30d2970eb308ecc56a22dd25cfc136b2ac
parentacf23ecc5b897dd2b8fcd973d6a765fea5557caf (diff)
downloadmongo-bfa801da7c4031fd6711fccc5b4916d310fa4ff0.tar.gz
SERVER-32106 Don't lookup collection from catalog when applying optype 'n' oplog entries in secondaries
(cherry picked from commit dbb028ac3b40a4fcfd9502402aec729f26004fbe)
-rw-r--r--src/mongo/db/repl/oplog.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 07769c660db..0075413c560 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -1025,6 +1025,15 @@ Status applyOperation_inlock(OperationContext* opCtx,
// operation type -- see logOp() comments for types
const char* opType = fieldOp.valuestrsafe();
+ if (*opType == 'n') {
+ // no op
+ if (incrementOpsAppliedStats) {
+ incrementOpsAppliedStats();
+ }
+
+ return Status::OK();
+ }
+
NamespaceString requestNss;
Collection* collection = nullptr;
if (fieldUI) {
@@ -1416,11 +1425,6 @@ Status applyOperation_inlock(OperationContext* opCtx,
if (incrementOpsAppliedStats) {
incrementOpsAppliedStats();
}
- } else if (*opType == 'n') {
- // no op
- if (incrementOpsAppliedStats) {
- incrementOpsAppliedStats();
- }
} else {
invariant(*opType != 'c'); // commands are processed in applyCommand_inlock()
uasserted(14825, str::stream() << "error in applyOperation : unknown opType " << *opType);