-
Notifications
You must be signed in to change notification settings - Fork 55
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
[WIP] StaticHeader::setup Improve error reporting #1562
base: master
Are you sure you want to change the base?
[WIP] StaticHeader::setup Improve error reporting #1562
Conversation
Test with Jenkins? |
1 similar comment
Test with Jenkins? |
ok to test |
Yes, this is exactly right. We should consider the error on repair attempt as non-fatal, because if we tried to repair that means we think we have good data on hand. |
@mulkieran suggested to use an enum instead and also to add |
3463876
to
8759a4e
Compare
Should I do something with the errors or...? |
7307162
to
d1ef8a3
Compare
Updated. Is there anything else to do in here? |
Ok(Some(sh)) => Ok(Some((sh.pool_uuid, sh.dev_uuid))), | ||
Ok(Some(SetupResult::Ok(sh))) => Ok(Some((sh.pool_uuid, sh.dev_uuid))), | ||
Ok(Some(SetupResult::OkWithError(sh, err))) => { | ||
warn!("StaticHeader::setup didn't completely succeed: {:?}", err); |
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.
The I/O error that you picked up doesn't really explain what happened. So, a clearer explanation would be something like:
warn!("Experienced an I/O error while attempting to repair an ill-formed, unreadable, or stale signature block: {:?}", err);
This has the flaw that it does not identify which signature block, on which device, etc., so it is more alarming than helpful in that simple state.
But you can improve it quite a bit, by including the good StaticHeader, the one that was succesfully read, in the error message (or possibly just selected identifying information from that StaticHeader). This would probably be worth a separate function, since you do it in two places.
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 extended your text a bit. Tell me if it's what you had in mind otherwise I'll just update. :)
db984b7
to
c39cb15
Compare
c39cb15
to
9daec43
Compare
@GuillaumeGomez Could you rebase this one? |
Sure! |
9daec43
to
68f6beb
Compare
Rebased. |
Makes sense to call this blocked b #1575. |
unblocked. |
yup. conflicts galore, unfortunately, but ultimately a better situation. |
Test with Jenkins? |
d63a18e
to
6457012
Compare
fe145a7
to
32d98e5
Compare
cargo fmt once again. T_T |
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'm not done just yet, I think that if the extra curly brace is removed then it'll look like fewer changes, which will make it easier to review. So, please go ahead and do that and I'll take another look.
} | ||
} | ||
|
||
fn setup_warn(header: &StaticHeader, err: StratisError) { |
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.
Please add some explanatory header comments.
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 added a comment. Considering the function was just emitting a warning, I didn't think it was necessary to kinda repeat what it was doing but I guess a comment cannot hurt. Also, don't hesitate if the comment isn't well written.
warn!( | ||
"Experienced an I/O error while attempting to repair an ill-formed, \ | ||
unreadable, or stale signature block: {:?}.\n\ | ||
Returning device \"{:?}\" from pool \"{:?}\".", |
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.
How about Read and returned static header {:?}, sh
for the second sentence. We implemented Debug
for StaticHeader
so that is doable; we had to implement it explicitly since the Debug info for UUIDs is far too long.
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 updated the text but not sure if it was how you had it in mind?
32d98e5
to
b95c5c9
Compare
Updated. |
Travis failed due to infrastructure errors, not test failiures, I tried restarting it. |
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.
Thanks, I think we're getting close to finish. Please look into the further abstractions suggested...it doesn't make sense to waste the opportunity, once we've made it this far.
Right now this PR needs only 50 additional lines of code to introduce a significant improvement in behavior, because it improves the method structure at the same time; I hope we can do better still.
fn setup_warn(header: &StaticHeader, err: StratisError) { | ||
warn!( | ||
"Experienced an I/O error while attempting to repair an ill-formed, \ | ||
unreadable, or stale signature block: {:?}.\n\ |
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.
Please drop the newline. We should allow something else to do the formatting at some later, post-processing step.
where | ||
F: Read + Seek + SyncAll, | ||
{ | ||
fn bda_write_check<F>( |
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.
Please change name to just write_check
. The use of bda is wrong, because some bad nomenclature crept in in a previous PR, and since the method is defined in setup, it doesn't really need a long identifying name anyway.
b95c5c9
to
22f2281
Compare
22f2281
to
8f09efb
Compare
Updated. |
@GuillaumeGomez I've realized that there is yet another preliminary step that should happen before you try to move forward w/ this. I'ld already worked it out, but now I realize that it will conflict w/ this very badly. So, please put this on hold, and I'll assign to you this additional pre-project. |
Blocked by #1579. |
Blocked by #1586. |
Test with Jenkins? |
Can one of the admins verify this patch? |
Fixes #1443.
Before finalizing this: do we want to provide two different kind of errors in here or consider the second case of error as non-fatal and providing it alongside the returned data (like I did currently)?