}
void PG::MissingLoc::add_batch_sources_info(
- const set<pg_shard_t> &sources)
+ const set<pg_shard_t> &sources, ThreadPool::TPHandle* handle)
{
dout(10) << __func__ << ": adding sources in batch " << sources.size() << dendl;
+ unsigned loop = 0;
for (map<hobject_t, pg_missing_t::item, hobject_t::ComparatorWithDefault>::const_iterator i = needs_recovery_map.begin();
i != needs_recovery_map.end();
++i) {
+ if (handle && ++loop >= g_conf->osd_loop_before_reset_tphandle) {
+ handle->reset_tp_timeout();
+ loop = 0;
+ }
missing_loc[i->first].insert(sources.begin(), sources.end());
missing_loc_sources.insert(sources.begin(), sources.end());
}
// and covers vast majority of the use cases, like one OSD/host is down for
// a while for hardware repairing
if (complete_shards.size() + 1 == actingbackfill.size()) {
- missing_loc.add_batch_sources_info(complete_shards);
+ missing_loc.add_batch_sources_info(complete_shards, ctx->handle);
} else {
missing_loc.add_source_info(pg_whoami, info, pg_log.get_missing(),
get_sort_bitwise(), ctx->handle);
/// Adds recovery sources in batch
void add_batch_sources_info(
- const set<pg_shard_t> &sources ///< [in] a set of resources which can be used for all objects
+ const set<pg_shard_t> &sources, ///< [in] a set of resources which can be used for all objects
+ ThreadPool::TPHandle* handle ///< [in] ThreadPool handle
);
/// Uses osdmap to update structures for now down sources