summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2016-12-06 15:13:17 -0500
committerBenety Goh <benety@mongodb.com>2016-12-07 10:11:50 -0500
commitb666c293b8dee59b0bb8926afafc6eebf9c7d21c (patch)
tree3bdc6f54dea3aec82cbdad525e8edc2ec1541936 /src/mongo/db/commands
parent27b1e9a1d61fdd522df5376495859cf9f63725a9 (diff)
downloadmongo-b666c293b8dee59b0bb8926afafc6eebf9c7d21c.tar.gz
SERVER-27301 converted OpObserver into an interface. ServiceContext should always return a valid OpObserver implementation.
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/create_indexes.cpp6
-rw-r--r--src/mongo/db/commands/feature_compatibility_version.cpp2
-rw-r--r--src/mongo/db/commands/mr.cpp2
3 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp
index 116a6248cc9..570d95a7bdb 100644
--- a/src/mongo/db/commands/create_indexes.cpp
+++ b/src/mongo/db/commands/create_indexes.cpp
@@ -392,10 +392,8 @@ public:
for (auto&& infoObj : indexInfoObjs) {
std::string systemIndexes = ns.getSystemIndexesCollection();
- auto opObserver = getGlobalServiceContext()->getOpObserver();
- if (opObserver) {
- opObserver->onCreateIndex(txn, systemIndexes, infoObj);
- }
+ getGlobalServiceContext()->getOpObserver()->onCreateIndex(
+ txn, systemIndexes, infoObj, false);
}
wunit.commit();
diff --git a/src/mongo/db/commands/feature_compatibility_version.cpp b/src/mongo/db/commands/feature_compatibility_version.cpp
index 2e38906b685..73988bef0c7 100644
--- a/src/mongo/db/commands/feature_compatibility_version.cpp
+++ b/src/mongo/db/commands/feature_compatibility_version.cpp
@@ -227,7 +227,7 @@ void FeatureCompatibilityVersion::set(OperationContext* txn, StringData version)
MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN {
WriteUnitOfWork wuow(txn);
getGlobalServiceContext()->getOpObserver()->onCreateIndex(
- txn, autoDB.getDb()->getSystemIndexesName(), k32IncompatibleIndexSpec);
+ txn, autoDB.getDb()->getSystemIndexesName(), k32IncompatibleIndexSpec, false);
wuow.commit();
}
MONGO_WRITE_CONFLICT_RETRY_LOOP_END(txn, "FeatureCompatibilityVersion::set", nss.ns());
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 5c0b45fc6f4..5e5306f5452 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -510,7 +510,7 @@ void State::prepTempCollection() {
}
// Log the createIndex operation.
string logNs = nsToDatabase(_config.tempNamespace) + ".system.indexes";
- getGlobalServiceContext()->getOpObserver()->onCreateIndex(_txn, logNs, *it);
+ getGlobalServiceContext()->getOpObserver()->onCreateIndex(_txn, logNs, *it, false);
}
wuow.commit();
}