Details
Description
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 |
|
851
|
void IndexCatalogImpl::dropAllIndexes(OperationContext* opCtx, |
852
|
bool includingIdIndex, |
853
|
std::map<std::string, BSONObj>* droppedIndexes) {
|
854
|
invariant(opCtx->lockState()->isCollectionLockedForMode(_collection->ns().toString(), MODE_X));
|
855
|
|
856
|
BackgroundOperation::assertNoBgOpInProgForNs(_collection->ns().ns());
|
857
|
|
858
|
// there may be pointers pointing at keys in the btree(s). kill them. |
859
|
// TODO: can this can only clear cursors on this index? |
860
|
_collection->getCursorManager()->invalidateAll(
|
861
|
opCtx, false, "all indexes on collection dropped"); |
862
|
|
863
|
// make sure nothing in progress |
864
|
massert(17348,
|
865
|
"cannot dropAllIndexes when index builds in progress", |
866
|
numIndexesTotal(opCtx) == numIndexesReady(opCtx));
|
Attachments
Issue Links
- is related to
-
SERVER-29274 Two Phase Drops: rename collection to special drop-pending name
-
- Closed
-