-
Notifications
You must be signed in to change notification settings - Fork 77
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
Reimplement GC in move-rocks by added CF index #902
base: main
Are you sure you want to change the base?
Conversation
Resolve the problem of GC not being implemented for the key format that ended up being merged, by introducing a time-sorted index CF named "transaction_timeline". The entries are added with each transaction, but are only collected by GC passes when their time window passes.
while let Some(res) = iter.next() { | ||
let (timeline_key, key) = res?; | ||
|
||
batch.delete_cf(&timeline_cf_handle, &timeline_key); |
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.
Two things w.r.t. to this implementation and testing that would be nice to haves:
- I think we might want to fuzz a fair few of these tests--particularly the GC.
- I think we would benefit from using domain-specific types for GC timestamps. I was looking at the usage here and in the other garbage collected containers we have, and it's quite easy to mix up the timestamps with something else.
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.
Sounds reasonable. As we need custom formatting here, perhaps a newtype defined in the library and implementing Display
to format into {:032}
would be appropriate.
Fixes: #879 #880 #881
Summary
protocol-units
.Resolve the problem of GC not being implemented for the key format that ended up being merged, by introducing a time-sorted index CF named "transaction_timeline". The entries are added with each transaction, but are only collected by GC passes when their time window passes.
Changelog
Testing
test_rocksdb_gc
passes in the move-rocks crate.