-
Notifications
You must be signed in to change notification settings - Fork 19
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
Simplify mend region selection #1606
base: main
Are you sure you want to change the base?
Conversation
05aef15
to
a4f7593
Compare
I found some more cleanup:
|
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.
Changing this makes me a little nervous as it has been working, but the tests we have should have found any issues if their were some.
upstairs/src/mend.rs
Outdated
/// - Highest flush number (if generation numbers are equal) | ||
/// - Dirty bit set (if generation and flush numbers are equal) | ||
/// | ||
/// If there is still a tie at the end, then the earliest source is chosen |
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.
What does earliest source
mean here?
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.
Numerically lowest, I updated the comment
upstairs/src/mend.rs
Outdated
|
||
info!( | ||
log, | ||
"find dest for source {} for extent at index {}", source, i | ||
"find dest for source {source} for extent at index {i} => {out:?}" |
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 think we can update this message to indicate we have found our result. This was printing before we did the search, but now this log comes after we have found our answer.
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.
Sure, changed to "found dest ..."
I spent a while staring at
find_source
, convincing myself that it was just picking the highest(gen, flush, dirty)
tuple. We can express it more compactly by leaning into#[derive(Ord)]
.Similarly,
find_dest
is picking clients which are not the source client, picking all such clients if the source is dirty, and clients which differ from the source otherwise.