Create size-limiting class for _extraIndexEntries and _missingIndexEntries

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • Fully Compatible
    • Storage Execution 2026-07-20, Storage Execution 2026-08-03
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      These two class members are currently stored as `std::vector<BSONObj>` within the ValidateResults class in validate_results.h:325-226, however the code is expected to maintain a class invariant that the total size of the objects in the container are capped to a memory limit.  

      This is implemented by some free functions that accept the input values, a memory limit, and operate the vector as a heap to evict the largest objects first.  Effectively prioritizing quantity of entries over maximum size. 

      This should be refactored to an explicit class that properly maintains the these invariants through the public interface:

      • Largest entries evicted upon exceeding the size limit when a new element is added
      • Minimum 1 entry maintained even if it exceeds the size limit
      • Getter for current size
      • Underlying container is accessible for const iteration (this is not provided by default with the C++ STL priority_queue implementation) 

            Assignee:
            Ayesha Islam
            Reporter:
            Benjamin Pearce
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: