]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/mon/PGMap.cc: check unfound obejcts in `get_unavailable_pg_in_pool_map`
authorShraddha Agrawal <shraddha.agrawal000@gmail.com>
Mon, 7 Oct 2024 06:16:34 +0000 (11:46 +0530)
committerShraddha Agrawal <shraddha.agrawal000@gmail.com>
Thu, 24 Apr 2025 14:11:30 +0000 (19:41 +0530)
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 <shraddha.agrawal000@gmail.com>
src/mon/PGMap.cc

index 0c81b2a9ff484b83d140c5d1e3f8316dc586a5f8..07304cfcd8e64f297ca454ddd56d142bfc7ebe15 100644 (file)
@@ -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;
     }
   }
 }