info.stats.stats.sum.num_objects_unfound = 0;
info.stats.stats.sum.num_objects_misplaced = 0;
info.stats.avail_no_missing.clear();
+ info.stats.object_location_counts.clear();
if ((is_remapped() || is_undersized() || !is_clean()) && (is_peered() || is_activating())) {
dout(20) << __func__ << " actingset " << actingset << " upset "
<< dendl;
}
+ // Compute object_location_counts
+ for (auto& ml: missing_loc.get_missing_locs()) {
+ info.stats.object_location_counts[ml.second]++;
+ dout(30) << __func__ << " " << ml.first << " object_location_counts["
+ << ml.second << "]=" << info.stats.object_location_counts[ml.second]
+ << dendl;
+ }
+ int64_t not_missing = num_objects - missing_loc.get_missing_locs().size();
+ if (not_missing) {
+ // During recovery we know upset == actingset and is being populated
+ // During backfill we know that all non-missing objects are in the actingset
+ info.stats.object_location_counts[actingset] = not_missing;
+ }
+ dout(30) << __func__ << " object_location_counts["
+ << upset << "]=" << info.stats.object_location_counts[upset]
+ << dendl;
+ dout(20) << __func__ << " object_location_counts "
+ << info.stats.object_location_counts << dendl;
+
// A misplaced object is not stored on the correct OSD
int64_t misplaced = 0;
// a degraded objects has fewer replicas or EC shards than the pool specifies.
for (auto p = avail_no_missing.cbegin(); p != avail_no_missing.cend(); ++p)
f->dump_stream("shard") << *p;
f->close_section();
+ f->open_array_section("object_location_counts");
+ for (auto p = object_location_counts.cbegin(); p != object_location_counts.cend(); ++p) {
+ f->open_object_section("entry");
+ f->dump_stream("shards") << p->first;
+ f->dump_int("objects", p->second);
+ f->close_section();
+ }
+ f->close_section();
f->open_array_section("blocked_by");
for (vector<int32_t>::const_iterator p = blocked_by.begin();
p != blocked_by.end(); ++p)
encode(purged_snaps, bl);
encode(manifest_stats_invalid, bl);
encode(avail_no_missing, bl);
+ encode(object_location_counts, bl);
ENCODE_FINISH(bl);
}
}
if (struct_v >= 26) {
decode(avail_no_missing, bl);
+ decode(object_location_counts, bl);
}
}
DECODE_FINISH(bl);
a.up_primary = 123;
a.acting.push_back(456);
a.avail_no_missing.push_back(pg_shard_t(456, shard_id_t::NO_SHARD));
+ set<pg_shard_t> sset = { pg_shard_t(0), pg_shard_t(1) };
+ a.object_location_counts.insert(make_pair(sset, 10));
+ sset.insert(pg_shard_t(2));
+ a.object_location_counts.insert(make_pair(sset, 5));
a.acting_primary = 456;
o.push_back(new pg_stat_t(a));
l.up == r.up &&
l.acting == r.acting &&
l.avail_no_missing == r.avail_no_missing &&
+ l.object_location_counts == r.object_location_counts &&
l.mapping_epoch == r.mapping_epoch &&
l.blocked_by == r.blocked_by &&
l.last_became_active == r.last_became_active &&