Integrate latest size/count into Collection API

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • Storage Execution 2026-04-13, Storage Execution 2026-04-27
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Implement a new member function in the Collection API called latestSizeCount() that returns the fully accurate collection size/count, even after shutdown. We expect ReplicatedFastCountManager::findLatest() to incur significant overhead to size/count lookups, so only use the function where required:
      1. User commands (count, dataSize)

      2. Validation

      3. Capped collections

      Future work in SERVER-121777 will replace the numRecords() and dataSize() implementations with persistedSizeCount() which will only contains changes to the collection's size/count as of the last checkpoint. This will be much more performant because there is no oplog traversal involved.

       

            Assignee:
            Cedric Sirianni
            Reporter:
            Cedric Sirianni
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: