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

Simplify the CatalogCache API

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Catalog and Routing
    • 3

      The current CatalogCache API is overly complex for what it does and has too many methods. Here are some of the things to consider simplifying that may themselves be done under separate tickets:

      1. There are too many getCollectionRoutingInfoXXX methods. Some provide causality for only a subset of the catalog state for a collection. There is no need for such granularity - there should be only one method that obtains a coherent snapshot of an entire collection, including its indexes.
      2. The retrieval of a collection state is currently split into two aggregations - one for the collection and another one for the indexes. We should have one aggregation that runs as a snapshot and returns everything for the collection.
      3. The WithRefresh methods are a misnomer that's easy to misuse, because they don't actually provide linearizable guarantee since they are not guaranteed to see everything that happened up until the time they are called. For example, changing some catalog state on one router (mongos) and then calling a WithRefresh method on another doesn't guarantee that the second router will see the changes from the first write. Ideally we should just remove them and rely on causality based on the database/collection timestamp.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: