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
os/bluestore: pass strict flag to bluestore_blob_use_tracker_t::equal() #15705
Conversation
fb2f7ea
to
c25cd8a
Compare
I'm disagree with the initial assumption that <1> isn't equal to <2>. In fact <2> doesn't have that actual range information [1..1001] - it contains total referenced bytes counter only. And that amount of referenced bytes equivalent (weakly?) to the one at <1> hence returning true. I.e. equal method returns true if there is a chance that two trackers describe the same used_range rather than strict comparison. Probably it makes sense to change the function name though.. |
I see the only caller is fsck(), which means we use this method to measure the same blob, so I guess we'd better narrow the constraints down. |
I'd prefer to leave current comparison mode as well. May be we can have a boolean flag for equal() call to request strict/weak equivalence comparison. |
c25cd8a
to
a527cfd
Compare
a527cfd
to
89bc642
Compare
Updated! |
@@ -488,7 +488,8 @@ void bluestore_blob_use_tracker_t::split( | |||
} | |||
|
|||
bool bluestore_blob_use_tracker_t::equal( | |||
const bluestore_blob_use_tracker_t& other) const | |||
const bluestore_blob_use_tracker_t& other, |
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.
Could you please add some UT for that
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.
LGTM.
89bc642
to
8b6d76c
Compare
Sure, added. |
And if that flag is true, we'll do a strict equivalence comparison instead. Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
8b6d76c
to
5070999
Compare
retest this please |
1 similar comment
retest this please |
And if that flag is true, we'll do a strict equivalence comparison instead.
Signed-off-by: xie xingguo xie.xingguo@zte.com.cn