-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
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.
- is duplicated by
-
SERVER-123275 Update SizeCountStore::write() to signal if an entry was inserted or updated
-
- Closed
-
- related to
-
SERVER-136271 Return old value in SizeCountTimestampStore::insert()
-
- Open
-