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: small clear up and optimize on _recover_now and should_share_map function #13476

Merged
merged 1 commit into from Feb 28, 2017

Conversation

Projects
None yet
4 participants
@songbaisen

songbaisen commented Feb 17, 2017

osd: small clear up and optimize on _recover_now and should_share_map function

Signed-off-by: song baisen song.baisen@zte.com.cn

@songbaisen

This comment has been minimized.

songbaisen commented Feb 17, 2017

@branch-predictor Hi! Have a look?

@@ -8434,8 +8436,8 @@ void OSD::_remove_pg(PG *pg)
// and handle_notify_timeout
pg->on_removal(&rmt);
service.cancel_pending_splits_for_parent(pg->info.pgid);
int tr = service.cancel_pending_splits_for_parent(pg->info.pgid);

This comment has been minimized.

@tchaikov

tchaikov Feb 17, 2017

Contributor

cancel_pending_splits_for_parent() does not return a value.

This comment has been minimized.

@songbaisen

songbaisen Feb 17, 2017

@tchaikov Thank you! Sorry i mistake it.

@@ -8476,6 +8477,16 @@ void OSDService::_maybe_queue_recovery() {
bool OSDService::_recover_now(uint64_t *available_pushes)
{
if (ceph_clock_now() < defer_recovery_until) {
dout(15) << "_recover_now defer until " << defer_recovery_until << dendl;

This comment has been minimized.

@tchaikov

tchaikov Feb 17, 2017

Contributor

nit, could use __func__ here.

This comment has been minimized.

@songbaisen

songbaisen Feb 17, 2017

@tchaikov Thank you tchaikov!I will change it later.

This comment has been minimized.

@songbaisen
}
if (recovery_paused) {
dout(15) << "_recover_now paused" << dendl;

This comment has been minimized.

@tchaikov

tchaikov Feb 17, 2017

Contributor

ditto

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Feb 17, 2017

and the title of your commit could be more specific. "small change and optimization" is way too vague, imo.

@@ -962,6 +962,7 @@ bool OSDService::should_share_map(entity_name_t name, Connection *con,
<< " versus osdmap epoch " << osdmap->get_epoch() << dendl;
if (*sent_epoch_p < osdmap->get_epoch()) {
should_send = true;
return should_send;

This comment has been minimized.

@liewegas

liewegas Feb 17, 2017

Member

let's just drop should_send entirely and return true directly?

This comment has been minimized.

@songbaisen

@songbaisen songbaisen changed the title from osd: small change and optimization to osd: small clear up and optimize on _recover_now and should_share_map function Feb 20, 2017

@songbaisen

This comment has been minimized.

songbaisen commented Feb 20, 2017

jenkins test this please

@@ -8489,15 +8499,6 @@ bool OSDService::_recover_now(uint64_t *available_pushes)
if (available_pushes)
*available_pushes = max - recovery_ops_active - recovery_ops_reserved;

This comment has been minimized.

@branch-predictor

branch-predictor Feb 20, 2017

Member

Returning early will cause this function to return correct result, but leave *available_pushes unchanged, this may break code that call _recover_now and rely on available_pushes set regardless of result returned.

This comment has been minimized.

@songbaisen

songbaisen Feb 20, 2017

@branch-predictor Agree with it good eyes man. and i change it.

@@ -8489,15 +8499,6 @@ bool OSDService::_recover_now(uint64_t *available_pushes)
if (available_pushes)
*available_pushes = max - recovery_ops_active - recovery_ops_reserved;

This comment has been minimized.

@branch-predictor

branch-predictor Feb 20, 2017

Member

Returning early will cause this function to return correct result, but leave *available_pushes unchanged, this may break code that call _recover_now and rely on available_pushes set regardless of result returned.

songbaisen
osd: small clear up and optimize on _recover_now and should_share_map…
… function

Signed-off-by: song baisen <song.baisen@zte.com.cn>

@tchaikov tchaikov added the needs-qa label Feb 25, 2017

@liewegas liewegas merged commit 9fcef12 into ceph:master Feb 28, 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