ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1024
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • Storage Execution 2026-10-12
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The SizeCountStore API includes two ways to write to the underlying container: SizeCountStore::write() and SizeCountStore::insert(). insert() asserts that the container does not contain a pre-existing entry for the provided key. write() upserts. 

      Since write() is a void function, callers do not know if the write was an update or an insert. As a result, The insertCount and updateCount metrics cannot be updated.

      These two member functions can be combined if we strengthen the return type. Combine SizeCountStore::write() and SizeCountStore::insert into simply SizeCountStore::update() (or SizeCountStore::write(), though there is enthusiasm for using "update" generically in the StorEx layer).

      boost::optional<SizeCountStore::Entry> update(OperationContext* opCtx, UUID uuid, const Entry& entry);

      Return the old element, if it exists. For callers that previously used SizeCountStore::insert(), simply assert that the return value is boost::none.

      As part of this change, track insertCount and updateCount again.

       

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

              Created:
              Updated:
              Resolved: