-
Notifications
You must be signed in to change notification settings - Fork 174
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
Recovery #397
base: master
Are you sure you want to change the base?
Recovery #397
Conversation
src/rust/config/src/seg.rs
Outdated
@@ -151,6 +205,24 @@ impl Seg { | |||
pub fn datapool_path(&self) -> Option<PathBuf> { | |||
self.datapool_path.as_ref().map(|v| Path::new(v).to_owned()) | |||
} | |||
|
|||
pub fn segments_fields_path(&self) -> Option<PathBuf> { |
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.
Should each of these paths be it's own config option? I suspect we can be opinionated about the names for each file if we decide to keep the parts separate.
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.
Yes, I was going to wait until we decided how many files to use
bfe653e
to
7ca757c
Compare
…for TtlBuckets and Segments
… and neatened up TtlBuckets::restore()
…copy of the function
/// Copies `size` bytes at `byte_ptr` to the `offset` of `data` | ||
/// Returns the next `offset`, that is, the next byte of `data` to be copied into | ||
pub fn store_bytes_and_update_offset(byte_ptr: *const u8, offset: usize, size: usize, data: &mut [u8]) -> usize { | ||
// get corresponding bytes from byte pointer |
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.
I put this function here so that Segments
, TtlBuckets
and HashTable
could all access it. I am slightly concerned about security as I am not sure if this could be used as a "write what I want where I want"
…ecides whether to build a new segments or not
src/rust/entrystore/src/seg/mod.rs
Outdated
|
||
if config.graceful_shutdown() { | ||
// TODO: check if successfully shutdown and record result | ||
self.data.flush(); |
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.
This line currently produces a warning as I am ignoring the Result. Ideally the result would be intepreted here or passed along to server/segcache/src/lib.rs
where I intend this flush() function to be called
src/rust/entrystore/src/seg/mod.rs
Outdated
|
||
/// Flush (gracefully shutdown) the `Seg` cache if configured to do so | ||
pub fn flush<T: SegConfig>(self, config: &T) { | ||
let config = config.seg(); |
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.
I couldn't find a trait that I should implement (that only has the flush()
required method) so I just put this function as a method of Seg
. I did the same thing for the other files I added a flush()
to
…t yet, as this doesn't make sense
… not point in keeping this until there is a nice way to determine expected file size
…ll change code so that Segments use same file. Also need to tidy code up
…). What we want is shutdown of entire cache
…ld flush the cache
…receive its broadcast to its signal_queue
Adds support for recovering from file-based datapool, intended for use with PMEM.