Skip to content
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

mon/OSDMonitor: make mapping job behave if mon_osd_prime_pg_temp = false #13574

Merged
merged 1 commit into from Feb 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 25 additions & 23 deletions src/mon/OSDMonitor.cc
Expand Up @@ -380,13 +380,15 @@ void OSDMonitor::on_active()
<< dendl;
mapping_job->abort();
}
C_PrintTime *fin = new C_PrintTime(osdmap.get_epoch());
mapping.reset(new OSDMapMapping);
mapping_job = mapping->start_update(osdmap, mapper,
g_conf->mon_osd_mapping_pgs_per_chunk);
dout(10) << __func__ << " started mapping job " << mapping_job.get()
<< " at " << fin->start << dendl;
mapping_job->set_finish_event(fin);
if (g_conf->mon_osd_prime_pg_temp) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes http://tracker.ceph.com/issues/19020 also, as src/test/erasure-code/test-erasure-code.sh sets mon_osd_prime_pg_temp to false.

could you add a "Fixes" tag in the commit message?

C_PrintTime *fin = new C_PrintTime(osdmap.get_epoch());
mapping.reset(new OSDMapMapping);
mapping_job = mapping->start_update(osdmap, mapper,
g_conf->mon_osd_mapping_pgs_per_chunk);
dout(10) << __func__ << " started mapping job " << mapping_job.get()
<< " at " << fin->start << dendl;
mapping_job->set_finish_event(fin);
}
}

void OSDMonitor::on_shutdown()
Expand Down Expand Up @@ -1127,24 +1129,24 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
int r = pending_inc.propagate_snaps_to_tiers(g_ceph_context, osdmap);
assert(r == 0);

if (g_conf->mon_osd_prime_pg_temp) {
if (mapping && mapping_job) {
if (!mapping_job->is_done()) {
dout(1) << __func__ << " skipping prime_pg_temp; mapping job "
<< mapping_job.get() << " did not complete, "
<< mapping_job->shards << " left" << dendl;
mapping_job->abort();
} else if (mapping->get_epoch() == osdmap.get_epoch()) {
dout(1) << __func__ << " skipping prime_pg_temp; mapping job "
<< mapping_job.get() << " is prior epoch "
<< mapping->get_epoch() << dendl;
} else {
if (mapping && mapping_job) {
if (!mapping_job->is_done()) {
dout(1) << __func__ << " skipping prime_pg_temp; mapping job "
<< mapping_job.get() << " did not complete, "
<< mapping_job->shards << " left" << dendl;
mapping_job->abort();
} else if (mapping->get_epoch() == osdmap.get_epoch()) {
dout(1) << __func__ << " skipping prime_pg_temp; mapping job "
<< mapping_job.get() << " is prior epoch "
<< mapping->get_epoch() << dendl;
} else {
if (g_conf->mon_osd_prime_pg_temp) {
maybe_prime_pg_temp();
}
} else {
dout(1) << __func__ << " skipping prime_pg_temp; mapping job did not start"
<< dendl;
}
}
} else if (g_conf->mon_osd_prime_pg_temp) {
dout(1) << __func__ << " skipping prime_pg_temp; mapping job did not start"
<< dendl;
}
mapping_job.reset();

Expand Down