Eliminate duplicated code in CollectionCatalog::Stats counters update

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Catalog
    • Catalog and Routing
    • 1
    • None
    • 3
    • TBD
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      One can get a count on how many collections of each type there are in a cluster by running db.serverStatus().catalogStats. Those counters are managed by the CollectionCatalog, which keeps a CollectionCatalog::Stats data structure up to date with the catalog's contents.

       

      The code to increment and decrement those counters is (and must be) almost identical.

      Extract a common method to ensure we can not introduce bugs that get them out of sync.

      Potentially this method can belong to CollectionCatalog::Stats so that it becomes decoupled from the large CollectionCatalog class.

            Assignee:
            Unassigned
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: