Skip to content

Commit

Permalink
tools/ceph_objectstore_tool: action_on_all_objects_in_pg to skip pgmeta
Browse files Browse the repository at this point in the history
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 <mbreizma@redhat.com>
(cherry picked from commit 6b0a9a5)
  • Loading branch information
Matan-B committed Nov 28, 2023
1 parent 02a2ddb commit 2f4b201
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/ceph_objectstore_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_obje
obj != list.end();
++obj) {
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) {
Expand Down

0 comments on commit 2f4b201

Please sign in to comment.