if (_sizeInfo->dataSize.fetchAndAdd(amount) < 0)
_sizeInfo->dataSize.store(std::max(amount, int64_t(0)));
Value is checked before adding, and clamping is done only if the previous value was negative, so the value can still be negative.
Additionally, similar to SERVER-63585 with fast count, data size can be incorrect after a rollback due to a race. We should allow dataSize to be negative internally and clamp only in the getter.
- causes
-
SERVER-74303 Add a sizeStorer call to the onRollback handler for dataSize and numRecords changes
- Closed