[WIP] StaticHeader::setup Improve error reporting#1562
[WIP] StaticHeader::setup Improve error reporting#1562GuillaumeGomez wants to merge 1 commit intostratis-storage:masterfrom
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.
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.
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. |
|
I need to rebase once again. :) |
|
yup. conflicts galore, unfortunately, but ultimately a better situation. |
|
Test with Jenkins? |
68f6beb to
d63a18e
Compare
d63a18e to
6457012
Compare
fe145a7 to
32d98e5
Compare
|
cargo fmt once again. T_T |
mulkieran
left a comment
There was a problem hiding this comment.
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.
Please add some explanatory header comments.
There was a problem hiding this comment.
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.
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.
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. |
mulkieran
left a comment
There was a problem hiding this comment.
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.
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.
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)?