New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add defragment support for HFE #13229
base: hash-field-expiry-integ
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider avoid adding defrag logic into ebuckets.c
. Instead we can expose a simplified function that merely gets pointer-to-the-pointer that points to the item. And all the logic will reside in defrag.c
Co-authored-by: Moti Cohen <moti.cohen@redis.com>
that is what i wanted to do, but then we need to expose a lot of interfaces, like ebIsList(), ebGetListPtr(), ebMarkAsList(), .etc. |
Co-authored-by: Moti Cohen <moti.cohen@redis.com>
|
Background
So when we defrag the hash object or the field in a dict with HFE, we also need to update the references in them.
Interface
ebDefragItem
, which can accept a defrag callback to defrag items in ebuckets, and simultaneously update their references in the ebucket.Mainly changes
activeDefragHfieldDict()
to defrag the dict instead ofactiveDefragSdsDict()
.dictScanDefrag()
, we always set the defrag callbackdefragKey
ofdictDefragFunctions
to NULL, because we can't reallocate a field with out updating it's reference in ebuckets.Instead, we will defrag the field of the dict and update its reference in the callback
dictScanDefrag
of dictScanFunction().ebDefragItem
to defrag the robj and update the reference in db->hexpires.Notification Support
hpersist
command.TODO:
More test for HFE defragment.