}
}
+void OSDMonitor::remove_down_pg_temp()
+{
+ dout(10) << "remove_down_pg_temp" << dendl;
+ OSDMap tmpmap(osdmap);
+ tmpmap.apply_incremental(pending_inc);
+
+ for (map<pg_t,vector<int> >::iterator p = tmpmap.pg_temp->begin();
+ p != tmpmap.pg_temp->end();
+ p++) {
+ unsigned num_up = 0;
+ for (vector<int>::iterator i = p->second.begin();
+ i != p->second.end();
+ ++i) {
+ if (!tmpmap.is_down(*i))
+ ++num_up;
+ }
+ if (num_up == 0)
+ pending_inc.new_pg_temp[p->first].clear();
+ }
+}
+
/* Assign a lower weight to overloaded OSDs.
*
* The osds that will get a lower weight are those with with a utilization
// drop any redundant pg_temp entries
remove_redundant_pg_temp();
+
+ // drop any pg_temp entries with no up entries
+ remove_down_pg_temp();
}
void send_incremental(epoch_t first, entity_inst_t& dest, bool onetime);
void remove_redundant_pg_temp();
+ void remove_down_pg_temp();
int reweight_by_utilization(int oload, std::string& out_str);
bool preprocess_failure(class MOSDFailure *m);