-
Notifications
You must be signed in to change notification settings - Fork 23.5k
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
HFE to support AOF and replicas #13285
HFE to support AOF and replicas #13285
Conversation
@moticless should the TODO in https://github.com/redis/redis/blob/a25b15392c3f50909ab2dafbcbdb3794ada29620/src/rdb.c#L2312:L2315 be handled here? |
I will handle it on the next commit. |
/* Delete all the expired fields in one go */ | ||
if (r.expired > 0) | ||
lpt->lp = lpDeleteRange(lpt->lp, 0, r.expired * 3); | ||
ptr = lpNext(lpt->lp, ptr); |
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.
Just a note to all of us, maybe we can implement this logic with lpFindCb() in future to avoid performance cost of lpNext() calls.
int isHashDeleted; | ||
int exists = hashTypeExists(key->db, key->value, field->ptr, &isHashDeleted); | ||
/* hash-field-expiration is not exposed to modules */ | ||
serverAssert(isHashDeleted == 0); |
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.
if i use hexpire
command to create a hash with TTL fields, then operate the hash with RM_HashSet
, will thia assertion be triggered?
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.
Regarding this matter, I am seeking input from those experienced with modules:
- We likely need to pass the mode/flags of the opened key and respond appropriately.
- Should we update the opened key if the key was deleted due to last field expiration?
@MeirShpilraien, perhaps you can assist. Thanks.
shared.hdel, | ||
createStringObject((char*) key, sdslen(key)), | ||
createStringObject(field, fieldLen) | ||
}; |
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.
Note: Later, maybe we can add a check to avoid creating these objects if we are not going to propagate anything.
H*EXPIRE*
,HSETF
,HGETF
to have absolute unix time in msec.propagateHashFieldDeletion()
)hashTypeGetValue()
now callshashTypeDelete()
. It also takes care to callpropagateHashFieldDeletion()
).H*EXPIRE*
command such that if it gets flagLT
and it doesn’t have any expiration on the field then it will considered as valid condition.Note, replicas doesn’t make any active expiration, and should avoid lazy expiration. On
hashTypeGetValue()
it doesn't check expiration (As long as the master didn’t request to delete the field, it is valid)TODO:
dbid
to HASH metadata. See here