diff options
Diffstat (limited to 'src/mongo/db/s/sharding_ddl_util.cpp')
-rw-r--r-- | src/mongo/db/s/sharding_ddl_util.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/mongo/db/s/sharding_ddl_util.cpp b/src/mongo/db/s/sharding_ddl_util.cpp index 5ce1ffe27a3..64571ae6284 100644 --- a/src/mongo/db/s/sharding_ddl_util.cpp +++ b/src/mongo/db/s/sharding_ddl_util.cpp @@ -872,37 +872,5 @@ BSONObj getCriticalSectionReasonForRename(const NamespaceString& from, const Nam << "rename" << "from" << from.toString() << "to" << to.toString()); } - -void ensureCollectionDroppedNoChangeEvent(OperationContext* opCtx, - const NamespaceString& nss, - const boost::optional<UUID>& uuid) { - invariant(!opCtx->lockState()->isLocked()); - invariant(!opCtx->lockState()->inAWriteUnitOfWork()); - - writeConflictRetry(opCtx, - "mongo::sharding_ddl_util::ensureCollectionDroppedNoChangeEvent", - nss.toString(), - [&] { - try { - AutoGetCollection coll(opCtx, nss, MODE_X); - if (!coll || (uuid && coll->uuid() != uuid)) { - // If the collection doesn't exist or exists with a different - // UUID, then the requested collection has been dropped already. - return; - } - - WriteUnitOfWork wuow(opCtx); - uassertStatusOK(coll.getDb()->dropCollectionEvenIfSystem( - opCtx, nss, {} /* dropOpTime */, true /* markFromMigrate */)); - wuow.commit(); - } catch (const ExceptionFor<ErrorCodes::InvalidViewDefinition>&) { - // AutoGetCollection may raise this exception when the collection - // doesn't exist and the CollectionCatalog starts looking into the - // list of existing views; the error can be ignored, and the - // collection may be considered as already dropped. - return; - } - }); -} } // namespace sharding_ddl_util } // namespace mongo |