if (!nocreating) {
if (s.state & PG_STATE_CREATING) {
creating_pgs.insert(pgid);
- if (s.acting_primary >= 0)
+ if (s.acting_primary >= 0) {
creating_pgs_by_osd[s.acting_primary].insert(pgid);
+ creating_pgs_by_osd_epoch[s.acting_primary][s.mapping_epoch].insert(pgid);
+ }
}
}
creating_pgs_by_osd[s.acting_primary].erase(pgid);
if (creating_pgs_by_osd[s.acting_primary].size() == 0)
creating_pgs_by_osd.erase(s.acting_primary);
+
+ map<epoch_t,set<pg_t> >& r = creating_pgs_by_osd_epoch[s.acting_primary];
+ r[s.mapping_epoch].erase(pgid);
+ if (r[s.mapping_epoch].empty())
+ r.erase(s.mapping_epoch);
+ if (r.empty())
+ creating_pgs_by_osd_epoch.erase(s.acting_primary);
}
}
}
set<pg_t> creating_pgs;
map<int,set<pg_t> > creating_pgs_by_osd;
+ map<int,map<epoch_t,set<pg_t> > > creating_pgs_by_osd_epoch;
// Bits that use to be enum StuckPG
static const int STUCK_INACTIVE = (1<<0);
pg_map.creating_pgs_by_osd[s->acting_primary].erase(pgid);
if (pg_map.creating_pgs_by_osd[s->acting_primary].size() == 0)
pg_map.creating_pgs_by_osd.erase(s->acting_primary);
+
+ map<epoch_t,set<pg_t> >& r =
+ pg_map.creating_pgs_by_osd_epoch[s->acting_primary];
+ r[s->mapping_epoch].erase(pgid);
+ if (r[s->mapping_epoch].empty())
+ r.erase(s->mapping_epoch);
+ if (r.empty())
+ pg_map.creating_pgs_by_osd_epoch.erase(s->acting_primary);
}
s->up = up;
s->up_primary = up_primary;
continue;
if (acting_primary != -1) {
- if (changed)
+ if (changed) {
+ pg_map.creating_pgs_by_osd_epoch[acting_primary][s->mapping_epoch].insert(
+ pgid);
pg_map.creating_pgs_by_osd[acting_primary].insert(pgid);
+ }
} else {
dout(20) << "map_pg_creates " << pgid << " -> no osds in epoch "
<< mon->osdmon()->osdmap.get_epoch() << ", skipping" << dendl;
for (map<int, set<pg_t> >::iterator p = pg_map.creating_pgs_by_osd.begin();
p != pg_map.creating_pgs_by_osd.end();
++p) {
- dout(10) << "map_pg_creates osd." << p->first << " has " << p->second.size() << " pgs" << dendl;
+ dout(10) << "map_pg_creates osd." << p->first
+ << " has " << p->second.size() << " pgs" << dendl;
}
}