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

Iterating through ViewCatalog must be done under the mutex

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Integration 2016-08-29
    • 0

    Description

      After this commit, it is no longer permissible to expose the ViewMap's begin() and end() iterators to external users. Because no mutex is held, the catalog's map may change at any time, invalidating the iterators. Instead, we should create an iterate() method that accepts a callback, and iterate through the ViewMap under the protection of the catalog's mutex.

      In addition, we should call reloadIfNeeded() before beginning the iteration to sync with any changes to system.views.

      Original Description

      listCollections does not refresh the ViewCatalog before iterating through it, meaning that it won't be updated even if a change to system.views would have marked it as invalid.

      Attachments

        Activity

          People

            kyle.suarez@mongodb.com Kyle Suarez
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: