MB-23906: Delete-with-value: Fix count of deleted items
Prior to Spock, the valid state transitions for StoredValues (relating
to deletion) were:
/---\
| |
| V
Alive --------> Deleted
<--------
With the advent of Deleted Bodies for system XATTRs, Deleted SVs can
optionally have a value (Blob) associated with them, which can be
changed (or removed) without going back to Alive:
/---\ /---\
| | | |
\ V \ V
Alive --------> Deleted ----------> Deleted
^ <-------- with-value <---------- no-value
| |
| |
\-----------------------------------------/
Given that Deleted-with-Value and Alive both are moved-to using
updateStoredValue(), we need to handle increasing numDeletedItems in
additional code paths - specifically whenever the value changes.
Fix this in HashTable::unlocked_updateStoredValue, and add tests for
these cases to the Delete-with-value tests.
Change-Id: Id9224ed0e66d0298c0f73621fedba3af1fe62e86
Reviewed-on: http://review.couchbase.org/76120
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>