Skip to content

Commit

Permalink
Merge pull request #13574 from liewegas/wip-mon-mapping
Browse files Browse the repository at this point in the history
mon/OSDMonitor: make mapping job behave if mon_osd_prime_pg_temp = false

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
yuriw committed Feb 27, 2017
2 parents 924121b + e00ef43 commit ab6cde5
Showing 1 changed file with 25 additions and 23 deletions.
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) {
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 @@ -1129,24 +1131,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

0 comments on commit ab6cde5

Please sign in to comment.