Currently, IndexCatalog::dropAllIndexes() does both a check on background operations on the collection and indexes that are still in the process of being built:
Since the only possible background operation is an index build, the check on the in-progress indexes may be redundant.
index_catalog_impl.cpp
void IndexCatalogImpl::dropAllIndexes(OperationContext* opCtx, bool includingIdIndex, std::map<std::string, BSONObj>* droppedIndexes) { invariant(opCtx->lockState()->isCollectionLockedForMode(_collection->ns().toString(), MODE_X)); BackgroundOperation::assertNoBgOpInProgForNs(_collection->ns().ns()); // there may be pointers pointing at keys in the btree(s). kill them. // TODO: can this can only clear cursors on this index? _collection->getCursorManager()->invalidateAll( opCtx, false, "all indexes on collection dropped"); // make sure nothing in progress massert(17348, "cannot dropAllIndexes when index builds in progress", numIndexesTotal(opCtx) == numIndexesReady(opCtx));
- is related to
-
SERVER-29274 Two Phase Drops: rename collection to special drop-pending name
- Closed