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

remove hierarchical structure between databases and collections from CatalogCache

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.7.4
    • None
    • Sharding
    • None
    • Fully Compatible
    • Sharding 2018-03-26, Sharding 2018-04-09

    Description

      The CatalogCache currently stores databases and collections hierarchically:

      DatabaseInfoEntry -> map<string, CollectionRoutingInfoEntry>

      So, the CatalogCache::getDatabase() method will refresh a single DatabaseInfoEntry, which

      • refreshes from config.databases for the document representing this database
      • refreshes from config.collections for the documents representing collections in this database

      The CatalogCache::getDatabase() method additionally marks each collection in the database as needsRefresh=true, so any subsequent calls to CatalogCache::getCollectionRoutingInfo will

      • refresh from config.chunks for the documents representing chunks in this collection

      This is problematic for the database versioning project, where we would like to do a lightweight refresh just from config.databases on StaleDbVersion, without causing heavyweight refreshes from config.collections and, worse, config.chunks.

      This ticket is to remove the hierarchy from the CatalogCache, so that

      • CatalogCache::getDatabase() refreshes from just config.databases
      • CatalogCache::getCollection() refreshes from just config.collections and config.chunks

      This ticket will also remove the CachedCollectionRoutingInfo, which is currently a "package" of both the CachedDatabaseInfo and ChunkManager, in favor of:

      • CatalogCache::getDatabase() returning CachedDatabaseInfo
      • CatalogCache::getCollection() returning CachedCollectionInfo

      The CachedDatabaseInfo/CachedCollectionInfo will be thin wrappers around a shared_ptr to the corresponding DatabaseInfoEntry/CollectionInfoEntry, except they will not expose the ability to mark the entries as needsRefresh=true.

      This ticket will also add the ability to mark a DatabaseInfoEntry as needsRefresh=true.

      Attachments

        Activity

          People

            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: