If we have a huge pool it may take a while for the PGs to get out of the
queue and be created. If we use the epoch the pool was created it may
mean a lot of old OSDMaps the OSD has to process. If we use the current
epoch (the first epoch in which any OSD learned that this PG should
exist) we limit PastIntervals as much as possible.
It is still possible that we start trying to create a PG but the cluster
is unhealthy for a long time, resulting in a long PastIntervals that
needs to be generated by a primary OSD when it eventually comes up. So
this only partially
Partially-fixes: http://tracker.ceph.com/issues/20050
Signed-off-by: Sage Weil <sage@redhat.com>
ps_t end = first + n;
for (ps_t ps = first; ps < end; ++ps) {
const pg_t pgid{ps, static_cast<uint64_t>(poolid)};
- pending_creatings.pgs.emplace(pgid, make_pair(p->second.created,
+ // NOTE: use the *current* epoch as the PG creation epoch so that the
+ // OSD does not have to generate a long set of PastIntervals.
+ pending_creatings.pgs.emplace(pgid, make_pair(inc.epoch,
p->second.modified));
dout(10) << __func__ << " adding " << pgid << dendl;
}