-
Notifications
You must be signed in to change notification settings - Fork 316
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
feat(porep): skip existing layers if they already exist #1282
Conversation
2920db5
to
b59b651
Compare
) | ||
.is_ok(); | ||
if generated { | ||
// successfull load |
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.
'succesful'
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.
fixed
states | ||
} | ||
|
||
fn generate_labels_replicate( |
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.
Can you come up with a more descriptive name and/or add a comment to explain exactly what this does? We're getting into a soup of self-referential names which is hard to get a handle on by just looking at one part. It would be good to reverse that trend where we can.
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.
added some docs and improved the name a little, honestly can't come up with something better
@dignifiedquire Can we also get a test — maybe an addition to the |
Added a check in replicate + extract that checks that it detects the already existing layers |
This is looking good. There is one detail, I'm not sure is accounted for. I am not 100% sure of the
Either way, it seems possible the file has been partially written then interrupted. In that case, even though the layer will have been completely created, we still need to discard the layer and begin from the last layer completely stored on disk. Although this may be heavy, one thorough solution would be to build up an incremental digest of the layer throughout the sealing process. This is not wasteful, since replication will leave most cores idle. Then the digest can be written to a status file and checked when restarting. However, this may be overkill, since the primary issue we are trying to address is not disk corruption. In that case, the mere presence of the 'completion status' file would suffice to signal completion. As above, it might also be that we can simply use file length as a check, but also as above, we should probably aim to fully allocate space for the layer files before writing them. This will allow for better performance (less fragmentation) and also better error handling when disk is full. Incidentally, if we don't do this, then a full disk will definitely create the situation of an only-partially-written Regarding recovery, since we cannot prevent the possibility of a partially-written file from existing, resumption should also ensure cleanup of the partial file. I think that will happen automatically, in the current design, though. |
@dignifiedquire Did you mean to push something that didn't make it? I don't see this. |
) | ||
.expect("label generation failed"); | ||
for state in label_states { | ||
assert!(state.generated); |
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.
@porcuquine this is the place where I check that things are not generated twice
@porcuquine Instead of using the |
5be8dfd
to
d681591
Compare
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.
Looks good. Would be great if someone can manually verify this too, but tests look reasonable.
a3d55aa
to
d3a21aa
Compare
cd0c828
to
285d003
Compare
This allows resuming sealing operations, as only layers are generated that don't yet exist on disk. Closes #884
285d003
to
0bdc2e8
Compare
closing in favor of #1292 |
This allows resuming sealing operations, as only layers are generated that don't yet exist on disk.
Closes #884