mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
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:
parent
151e40e2c0
commit
66c2973a99
5 changed files with 42 additions and 20 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue