Skip to content

Commit 2806052

Browse files
committed
src/mon/PGMap.cc: check unfound obejcts in get_unavailable_pg_in_pool_map
If a pool has any PG with unfound objects, we should consider it unavailable for the availability score. If a PG has unfound objects, it will be recorded in PGMap. In `get_unavailable_pg_in_map`, if a PG has unfound obejcts, we add it to `pool_pg_unavailable_map`. Fixes: https://tracker.ceph.com/issues/67777 Signed-off-by: Shraddha Agrawal <[email protected]>
1 parent 5485e00 commit 2806052

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mon/PGMap.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,8 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
12831283
- non-active
12841284
- stale
12851285
1286+
Any PG that has unfound objects is also added to the map.
1287+
12861288
Eg: {1=[1.0],2=[],3=[]}
12871289
Here the cluster has 3 pools with id 1,2,3 and pool 1 has an inactive PG 1.0
12881290
*/
@@ -1313,6 +1315,10 @@ void PGMap::get_unavailable_pg_in_pool_map(const OSDMap& osdmap)
13131315
pool_pg_unavailable_map[poolid].push_back(i->first);
13141316
dout(20) << "pool: " << poolid << " pg: " << i->first
13151317
<< " is stuck unavailable" << " state: " << i->second.state << dendl;
1318+
} else if (i->second.stats.sum.num_objects_unfound) {
1319+
pool_pg_unavailable_map[poolid].push_back(i->first);
1320+
dout(20) << "pool: " << poolid << " pg: " << i->first
1321+
<< " has " << i->second.stats.sum.num_objects_unfound << " unfound objects" << dendl;
13161322
}
13171323
}
13181324
}

0 commit comments

Comments
 (0)