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

catalog::openCatalog must rebuild all indexes for a collection in one pass

    • Fully Compatible
    • ALL
    • Repl 2018-02-12, Repl 2018-02-26

      KVStorageEngine::reconcileCatalogAndIdents returns a list of (collection name, index name) pairs that need to be rebuilt. If a collection requires rebuilding multiple indexes, they will be separate entries in this list.

      This API suggests that rebuilding indexes one by one would work, but that's unfortunately not true.[1]

      There are two obvious ways to correct catalog::openCatalog rebuilding indexes one by one.

      1. Complete the TODO to enable building an index without the collection object.
      2. Have catalog::openCatalog group all the indexes to rebuild per collection before passing them to rebuildIndexesOnCollection.

      [1] More completely: creating the collection object will cascade and create all of the in-memory index objects for that collection. The WiredTigerIndex constructor will fail when searching for the underlying table. rebuildIndexesOnCollection avoids this situation by first dropping all indexes that are to be rebuilt from the storage engine's implementation of the collection catalog. Thus when the Collection object is constructed, it does not observe the indexes to be rebuilt. Thus this bug only manifests when there is more than one missing index to rebuild on a collection.

            Assignee:
            kyle.suarez@mongodb.com Kyle Suarez
            Reporter:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: