From: Shraddha Agrawal Date: Mon, 7 Oct 2024 06:16:34 +0000 (+0530) Subject: src/mon/PGMap.cc: check unfound obejcts in `get_unavailable_pg_in_pool_map` X-Git-Tag: v20.3.0~10^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=28060526abfee2969ef02ee2051aef568e2477ed;p=ceph.git 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 --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 0c81b2a9ff4..07304cfcd8e 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1283,6 +1283,8 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc) - non-active - stale + Any PG that has unfound objects is also added to the map. + Eg: {1=[1.0],2=[],3=[]} Here the cluster has 3 pools with id 1,2,3 and pool 1 has an inactive PG 1.0 */ @@ -1313,6 +1315,10 @@ void PGMap::get_unavailable_pg_in_pool_map(const OSDMap& osdmap) pool_pg_unavailable_map[poolid].push_back(i->first); dout(20) << "pool: " << poolid << " pg: " << i->first << " is stuck unavailable" << " state: " << i->second.state << dendl; + } else if (i->second.stats.sum.num_objects_unfound) { + pool_pg_unavailable_map[poolid].push_back(i->first); + dout(20) << "pool: " << poolid << " pg: " << i->first + << " has " << i->second.stats.sum.num_objects_unfound << " unfound objects" << dendl; } } }