diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2017-11-12 00:00:52 -0500 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2017-11-22 11:37:25 -0500 |
commit | 9ab80a38613917a9d4c66331c923e09f3151445a (patch) | |
tree | 6deb6bf8ac89d5a5bfe76d7acc9e374562f85f7a /src/mongo/db/op_observer_impl.cpp | |
parent | 969ddd3d921cd8e6c5ab3068fdb77cb2dc271ed5 (diff) | |
download | mongo-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.cpp | 7 |
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); |