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
osd/PrimaryLogPG: optimal pick_newest_available #12695
Conversation
@tchaikov is there bug in build system? i found some PRs build failed due to same error |
retest this please |
assert(pg_log.get_missing().is_missing(oid)); | ||
v = pg_log.get_missing().get_items().find(oid)->second.have; | ||
pg_missing_item pmi; | ||
assert(pg_log.get_missing().is_missing(oid, &pmi)); |
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 do not rely on a side effect of an assert() call. assign the result to a bool local and assert that is true.
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.
like this ?
- bool is_missing = pg_log.get_missing().is_missing(oid, &pmi);
- assert(is_missing);
- v = pmi.have;
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.
yup
we can get pg_missing_item from is_missing(), no need to find it again. Signed-off-by: huangjun <hjwsm1989@gmail.com>
exactly! thanks
|
777de4c
to
891c099
Compare
v = pg_log.get_missing().get_items().find(oid)->second.have; | ||
pg_missing_item pmi; | ||
bool is_missing = pg_log.get_missing().is_missing(oid, &pmi); | ||
assert(is_missing); |
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 are moving from assert()
to ceph_assert()
. see the thread of https://www.spinics.net/lists/ceph-devel/msg31049.html
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.
hasn't happened yet, tho, can be fixed up later
retest this please |
we can get pg_missing_item from is_missing(), no need to find it again.
Signed-off-by: huangjun hjwsm1989@gmail.com