diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-08-27 13:06:38 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-08-29 16:47:09 -0400 |
commit | 4cb0742947dabee476c9979cae39c728a21568d5 (patch) | |
tree | 8ec6baacaab48a11b20eae4781f32be1bdad6ec2 /src/mongo/db/repl/oplog.cpp | |
parent | aa36a9e8ad8c98e828f1b53966672b368d973380 (diff) | |
download | mongo-4cb0742947dabee476c9979cae39c728a21568d5.tar.gz |
SERVER-36015 Remove references to system.namespaces and system.indexes
Diffstat (limited to 'src/mongo/db/repl/oplog.cpp')
-rw-r--r-- | src/mongo/db/repl/oplog.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index 5e9890bc896..5ea63255c23 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -1024,45 +1024,6 @@ StatusWith<OplogApplication::Mode> OplogApplication::parseMode(const std::string MONGO_UNREACHABLE; } -std::pair<BSONObj, NamespaceString> prepForApplyOpsIndexInsert(const BSONElement& fieldO, - const BSONObj& op, - const NamespaceString& requestNss) { - uassert(ErrorCodes::NoSuchKey, - str::stream() << "Missing expected index spec in field 'o': " << op, - !fieldO.eoo()); - uassert(ErrorCodes::TypeMismatch, - str::stream() << "Expected object for index spec in field 'o': " << op, - fieldO.isABSONObj()); - BSONObj indexSpec = fieldO.embeddedObject(); - - std::string indexNs; - uassertStatusOK(bsonExtractStringField(indexSpec, "ns", &indexNs)); - const NamespaceString indexNss(indexNs); - uassert(ErrorCodes::InvalidNamespace, - str::stream() << "Invalid namespace in index spec: " << op, - indexNss.isValid()); - uassert(ErrorCodes::InvalidNamespace, - str::stream() << "Database name mismatch for database (" << requestNss.db() - << ") while creating index: " - << op, - requestNss.db() == indexNss.db()); - - if (!indexSpec["v"]) { - // If the "v" field isn't present in the index specification, then we assume it is a - // v=1 index from an older version of MongoDB. This is because - // (1) we haven't built v=0 indexes as the default for a long time, and - // (2) the index version has been included in the corresponding oplog entry since - // v=2 indexes were introduced. - BSONObjBuilder bob; - - bob.append("v", static_cast<int>(IndexVersion::kV1)); - bob.appendElements(indexSpec); - - indexSpec = bob.obj(); - } - - return std::make_pair(indexSpec, indexNss); -} // @return failure status if an update should have happened and the document DNE. // See replset initial sync code. Status applyOperation_inlock(OperationContext* opCtx, @@ -1222,14 +1183,6 @@ Status applyOperation_inlock(OperationContext* opCtx, str::stream() << "Oplog entry did not have 'ts' field when expected: " << redact(op)); if (*opType == 'i') { - if (requestNss.isSystemDotIndexes()) { - BSONObj indexSpec; - NamespaceString indexNss; - std::tie(indexSpec, indexNss) = - repl::prepForApplyOpsIndexInsert(fieldO, op, requestNss); - createIndexForApplyOps(opCtx, indexSpec, indexNss, incrementOpsAppliedStats, mode); - return Status::OK(); - } uassert(ErrorCodes::NamespaceNotFound, str::stream() << "Failed to apply insert due to missing collection: " << op.toString(), |