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

Multiple indexes via createIndexes could bypass index limits

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.12
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • Storage NYC 2019-05-20

      It looks like if multiple indexes are requested via a single createIndexes cmd, we can incorrectly build indexes that exceed the allowable number for various reasons. For example, IndexCatalogImpl::_doesSpecConflictWithExisting will check that we are not exceeding the _maxNumIndexesAllowed setting. However, suppose the max is 5, the collection has 4 indexes and a createIndexes cmd requests 2 more indexes. Then we will run IndexCatalogImpl::_doesSpecConflictWithExisting on both index specs, it'll pass, and we will go build 2 more indexes – this is because neither index is part of the index catalog yet.

      It looks like we could bypass the subsequent text index limit check, too, if a caller specified two text indexes in one createIndexes cmd.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: