}
}
}
-
+
+void PG::MissingLoc::remove_stray_recovery_sources(pg_shard_t stray)
+{
+ set<pg_shard_t> now_stray;
+ for (set<pg_shard_t>::iterator p = missing_loc_sources.begin();
+ p != missing_loc_sources.end();
+ ) {
+ if (*p != stray) {
+ ++p;
+ continue;
+ }
+ ldout(pg->cct, 10) << __func__ << " source osd." << *p << " now stray" << dendl;
+ now_stray.insert(*p);
+ missing_loc_sources.erase(p++);
+ }
+
+ if (now_stray.empty()) {
+ ldout(pg->cct, 10) << __func__ << " no source osds (" << missing_loc_sources << ") became stray" << dendl;
+ } else {
+ ldout(pg->cct, 10) << __func__ << " sources osds " << now_stray << " now stray, remaining sources are "
+ << missing_loc_sources << dendl;
+
+ // filter missing_loc
+ map<hobject_t, set<pg_shard_t>>::iterator p = missing_loc.begin();
+ while (p != missing_loc.end()) {
+ set<pg_shard_t>::iterator q = p->second.begin();
+ bool changed = false;
+ while (q != p->second.end()) {
+ if (now_stray.count(*q)) {
+ if (!changed) {
+ changed = true;
+ _dec_count(p->second);
+ }
+ p->second.erase(q++);
+ } else {
+ ++q;
+ }
+ }
+ if (p->second.empty()) {
+ missing_loc.erase(p++);
+ } else {
+ if (changed) {
+ _inc_count(p->second);
+ }
+ ++p;
+ }
+ }
+ }
+}
+
void PG::discover_all_missing(map<int, map<spg_t,pg_query_t> > &query_map)
{
auto &missing = pg_log.get_missing();
}
peer_missing.erase(*p);
peer_info.erase(*p);
+ missing_loc.remove_stray_recovery_sources(*p);
peer_purged.insert(*p);
removed = true;
}
/// Uses osdmap to update structures for now down sources
void check_recovery_sources(const OSDMapRef& osdmap);
+ /// Remove stray from recovery sources
+ void remove_stray_recovery_sources(pg_shard_t stray);
+
/// Call when hoid is no longer missing in acting set
void recovered(const hobject_t &hoid) {
needs_recovery_map.erase(hoid);