set<pg_shard_t> *acting_backfill,
ostream &ss)
{
- ss << "calc_acting newest update on osd." << auth_log_shard->first
+ pg_shard_t auth_log_shard_id = auth_log_shard->first;
+
+ ss << __func__ << " newest update on osd." << auth_log_shard_id
<< " with " << auth_log_shard->second
<< (restrict_to_up_acting ? " restrict_to_up_acting" : "") << std::endl;
- pg_shard_t auth_log_shard_id = auth_log_shard->first;
// select primary
- map<pg_shard_t,pg_info_t>::const_iterator primary;
+ map<pg_shard_t,pg_info_t>::const_iterator primary = all_info.find(up_primary);
if (up.size() &&
- !all_info.find(up_primary)->second.is_incomplete() &&
- all_info.find(up_primary)->second.last_update >=
+ !primary->second.is_incomplete() &&
+ primary->second.last_update >=
auth_log_shard->second.log_tail) {
ss << "up_primary: " << up_primary << ") selected as primary" << std::endl;
- primary = all_info.find(up_primary); // prefer up[0], all thing being equal
} else {
assert(!auth_log_shard->second.is_incomplete());
ss << "up[0] needs backfill, osd." << auth_log_shard_id