Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29374

Remove massert check on numIndexesInProgress() from IndexCatalog::dropAllIndexes()

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.1
    • None
    • Storage
    • Fully Compatible
    • Execution Team 2019-09-09

    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.

      https://github.com/mongodb/mongo/blob/ff2cf3e560c4768f88c9911d09d8fa60526911dc/src/mongo/db/catalog/index_catalog_impl.cpp#L864

      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

        Activity

          People

            haley.connelly@mongodb.com Haley Connelly
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: