ldout(pg->cct, 10) << __func__ << ": adding sources in batch "
<< sources.size() << dendl;
unsigned loop = 0;
+ bool sources_updated = false;
for (map<hobject_t, pg_missing_item>::const_iterator i = needs_recovery_map.begin();
i != needs_recovery_map.end();
++i) {
if (i->second.is_delete())
continue;
missing_loc[i->first].insert(sources.begin(), sources.end());
- missing_loc_sources.insert(sources.begin(), sources.end());
+ if (!sources_updated) {
+ missing_loc_sources.insert(sources.begin(), sources.end());
+ sources_updated = true;
+ }
}
}
{
bool found_missing = false;
unsigned loop = 0;
+ bool sources_updated = false;
// found items?
for (map<hobject_t,pg_missing_item>::const_iterator p = needs_recovery_map.begin();
p != needs_recovery_map.end();
<< " is on osd." << fromosd << dendl;
missing_loc[soid].insert(fromosd);
- missing_loc_sources.insert(fromosd);
+ if (!sources_updated) {
+ missing_loc_sources.insert(fromosd);
+ sources_updated = true;
+ }
found_missing = true;
}