summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer_impl.cpp
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2017-11-12 00:00:52 -0500
committerXiangyu Yao <xiangyu.yao@mongodb.com>2017-11-22 11:37:25 -0500
commit9ab80a38613917a9d4c66331c923e09f3151445a (patch)
tree6deb6bf8ac89d5a5bfe76d7acc9e374562f85f7a /src/mongo/db/op_observer_impl.cpp
parent969ddd3d921cd8e6c5ab3068fdb77cb2dc271ed5 (diff)
downloadmongo-9ab80a38613917a9d4c66331c923e09f3151445a.tar.gz
SERVER-29453 Disallow removing featureCompatibilityVersion document and renaming collection
Diffstat (limited to 'src/mongo/db/op_observer_impl.cpp')
-rw-r--r--src/mongo/db/op_observer_impl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp
index 6da9b7f9599..cdc1dbc4756 100644
--- a/src/mongo/db/op_observer_impl.cpp
+++ b/src/mongo/db/op_observer_impl.cpp
@@ -437,8 +437,11 @@ void OpObserverImpl::onDelete(OperationContext* opCtx,
Scope::storedFuncMod(opCtx);
} else if (nss.coll() == DurableViewCatalog::viewsCollectionName()) {
DurableViewCatalog::onExternalChange(opCtx, nss);
- } else if (nss.ns() == FeatureCompatibilityVersion::kCollection) {
- FeatureCompatibilityVersion::onDelete(opCtx, deleteState.documentKey);
+ } else if (nss.isAdminDotSystemDotVersion()) {
+ auto _id = deleteState.documentKey["_id"];
+ if (_id.type() == BSONType::String &&
+ _id.String() == FeatureCompatibilityVersion::kParameterName)
+ uasserted(40670, "removing FeatureCompatibilityVersion document is not allowed");
} else if (nss == NamespaceString::kSessionTransactionsTableNamespace &&
!opTime.writeOpTime.isNull()) {
SessionCatalog::get(opCtx)->invalidateSessions(opCtx, deleteState.documentKey);