From 28060526abfee2969ef02ee2051aef568e2477ed Mon Sep 17 00:00:00 2001 From: Shraddha Agrawal Date: Mon, 7 Oct 2024 11:46:34 +0530 Subject: [PATCH] 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 --- src/mon/PGMap.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 0c81b2a9ff484..07304cfcd8e64 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; } } } -- 2.39.5