fix: removal of Expiry bit when overriding external strings (#4785)

The bug: during the override of the existing external string, we called
`TieredStorage::Delete` to delete the external reference. This function
called CompactObj::Reset that cleared all the attributes on the value, including
expiry.

The fix: preserve the mask but clear the external state from the object.
Fixes #4672

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2025-03-17 13:45:07 +02:00 committed by GitHub
parent 151e40e2c0
commit 66c2973a99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 42 additions and 20 deletions

View file

@ -875,6 +875,8 @@ void CompactObj::InitRobj(CompactObjType type, unsigned encoding, void* obj) {
}
void CompactObj::SetInt(int64_t val) {
DCHECK(!IsExternal());
if (INT_TAG != taglen_) {
SetMeta(INT_TAG, mask_ & ~kEncMask);
}