mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
osd: add get_num_unfound() helper
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
413ecb0bcf
commit
671b1c09fa
@ -579,8 +579,10 @@ void PG::discover_all_missing(map< int, map<pg_t,PG::Query> > &query_map)
|
||||
{
|
||||
assert(missing.have_missing());
|
||||
|
||||
dout(10) << __func__ << ": searching for " << missing.num_missing()
|
||||
<< " missing objects." << dendl;
|
||||
dout(10) << __func__ << " "
|
||||
<< missing.num_missing() << " missing, "
|
||||
<< get_num_unfound() << " unfound"
|
||||
<< dendl;
|
||||
|
||||
std::map<int,Info>::const_iterator end = peer_info.end();
|
||||
for (std::map<int,Info>::const_iterator pi = peer_info.begin();
|
||||
@ -2015,8 +2017,7 @@ void PG::update_stats()
|
||||
}
|
||||
pg_stats_stable.num_objects_degraded += degraded;
|
||||
|
||||
pg_stats_stable.num_objects_unfound =
|
||||
missing.num_missing() - missing_loc.size();
|
||||
pg_stats_stable.num_objects_unfound = get_num_unfound();
|
||||
}
|
||||
|
||||
dout(15) << "update_stats " << pg_stats_stable.reported << dendl;
|
||||
@ -3405,7 +3406,7 @@ ostream& operator<<(ostream& out, const PG& pg)
|
||||
if (pg.missing.num_missing()) {
|
||||
out << " m=" << pg.missing.num_missing();
|
||||
if (pg.is_primary()) {
|
||||
int unfound = pg.missing.num_missing() - pg.missing_loc.size();
|
||||
int unfound = pg.get_num_unfound();
|
||||
if (unfound)
|
||||
out << " u=" << unfound;
|
||||
}
|
||||
|
@ -852,6 +852,9 @@ public:
|
||||
bool have_unfound() const {
|
||||
return missing.num_missing() > missing_loc.size();
|
||||
}
|
||||
int get_num_unfound() const {
|
||||
return missing.num_missing() - missing_loc.size();
|
||||
}
|
||||
|
||||
virtual void clean_up_local(ObjectStore::Transaction& t) = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user