From f278c9612f46ff7c394a68851a3352aa14496e2b Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Sun, 26 Nov 2023 14:02:41 +0000 Subject: [PATCH] tools/ceph_objectstore_tool: action_on_all_objects_in_pg to skip pgmeta See "Error getting attr on" after creating an empty pool: ``` $ ceph-objectstore-tool --data-path ./dev/osd0 --op list Error getting attr on : 2.0_head,#2:00000000::::head#, (61) No data available ["2.0",{"oid":"","key":"","snapid":-2,"hash":0,"max":0,"pool":2,"namespace":"","max":0}] ``` _action_on_all_objects_in_pg() should skip getting the (non-existing) attributes of pgmeta hobjects. Note: pgmeta_oid is created at the PG's constructor and is written to disk in init_pg_ondisk() without any OI_ATTR. Fixes: https://tracker.ceph.com/issues/63640 Signed-off-by: Matan Breizman (cherry picked from commit 6b0a9a580f3376a5db208674a24e4599500b712f) --- src/tools/ceph_objectstore_tool.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 590b4a344cbaf..6593364fdd9a9 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -107,7 +107,7 @@ int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_obje if (obj->is_pgmeta()) continue; object_info_t oi; - if (coll != coll_t::meta()) { + if (coll != coll_t::meta() && !obj->is_pgmeta()) { bufferlist attr; r = store->getattr(ch, *obj, OI_ATTR, attr); if (r < 0) { -- 2.39.5