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

Merged
merged 1 commit into from Jan 9, 2017

Conversation

Projects
None yet
4 participants
@hjwsm1989
Contributor

hjwsm1989 commented Dec 28, 2016

we can get pg_missing_item from is_missing(), no need to find it again.

Signed-off-by: huangjun hjwsm1989@gmail.com

@hjwsm1989

This comment has been minimized.

Contributor

hjwsm1989 commented Dec 28, 2016

@tchaikov is there bug in build system? i found some PRs build failed due to same error

@liewegas

This comment has been minimized.

Member

liewegas commented Dec 28, 2016

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));

This comment has been minimized.

@liewegas

liewegas Dec 28, 2016

Member

Please do not rely on a side effect of an assert() call. assign the result to a bool local and assert that is true.

This comment has been minimized.

@hjwsm1989

hjwsm1989 Dec 29, 2016

Contributor

like this ?

  • bool is_missing = pg_log.get_missing().is_missing(oid, &pmi);
  • assert(is_missing);
  • v = pmi.have;

This comment has been minimized.

@xiexingguo
osd/PrimaryLogPG: optimize pick_newest_available
  we can get pg_missing_item from is_missing(), no need to find it again.

  Signed-off-by: huangjun <hjwsm1989@gmail.com>
@liewegas

This comment has been minimized.

Member

liewegas commented Dec 29, 2016

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);

This comment has been minimized.

@tchaikov

tchaikov Dec 29, 2016

Contributor

i think we are moving from assert() to ceph_assert(). see the thread of https://www.spinics.net/lists/ceph-devel/msg31049.html

This comment has been minimized.

@liewegas

liewegas Dec 29, 2016

Member

hasn't happened yet, tho, can be fixed up later

@liewegas liewegas added the needs-qa label Dec 29, 2016

@liewegas

This comment has been minimized.

Member

liewegas commented Dec 29, 2016

retest this please

@liewegas liewegas changed the title from osd/PrimaryLogPG: optimal pick_newest_available to osd/PrimaryLogPG: optimal pick_newest_available Jan 9, 2017

@liewegas liewegas merged commit 4ca7757 into ceph:master Jan 9, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment