-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
Repl 2016-09-19
StorageIntefaceImpl::dropCollection() uses AutoGetOrCreateDb when acquiring a lock on the database to drop the collection. Instead, it should probably use AutoGetDb and bail out if the database doesn't exist.
Status StorageInterfaceImpl::dropCollection(OperationContext* txn, const NamespaceString& nss) { MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN { ScopedTransaction transaction(txn, MODE_IX); AutoGetOrCreateDb autoDB(txn, nss.db(), MODE_X); WriteUnitOfWork wunit(txn); const auto status = autoDB.getDb()->dropCollection(txn, nss.ns()); if (status.isOK()) { wunit.commit(); } return status; } MONGO_WRITE_CONFLICT_RETRY_LOOP_END(txn, "StorageInterfaceImpl::dropCollection", nss.ns()); }